# An Adaptive Location-Based Tracking Algorithm Using Wireless Sensor Network for Smart Factory Environment

Authors: Po-Chih Chiu; Kuo-Wei Su; Tsung-Yin Ou; Chih-Lung Yu; Chen-Yang Cheng; Wei-Chieh Hsiao; Ming-Hung Shu; Guan-Yu Lin
Journal: Mathematical Problems in Engineering
 (2021)

---

## Abstract

In recent years, how to improve the performance of smart factories and reduce the cost of operation has been the focus of industry attention. This study proposes a new type of location-based service (LBS) to improve the accuracy of location information delivered by self-propelled robots. Traditional localization algorithms based on signal strength cannot produce accurate localization results because of the multipath effect. This study proposes a localization algorithm that combines the Kalman filter (KF) and the adaptive-network-based fuzzy inference system (ANFIS). Specifically, the KF was adopted to eliminate noise during the signal transmission process. Through the learning of the ANFIS, the environment parameter suitable for the target was generated, to overcome the deficiency of traditional localization algorithms that cannot obtain real signal strength. In this study, an experiment was conducted in a real environment to compare the proposed localization algorithm with other commonly used algorithms. The experimental results show that the proposed localization algorithm produces minimal errors and stable localization results.


---

## Body

## 1. Introduction

Through the development of artificial intelligence, the maintenance and repair of machines in smart factories are different from the old way. There are already smart factories that use mechanical vibration and noise detection or environmental data to improve the reliability of equipment or knives [1–4]. However, installing sensors for detection in all the equipment would increase the cost significantly. This time, self-propelled robots can be used for inspection, effectively reducing the related costs. Of course, location-based service technology is very important at this point because it can effectively provide accurate equipment information. Location-based services (LBSs) have been widely applied in warehouse management, transportation, personnel tracking, and medical care [5, 6].Currently, the commonly used location-based systems can be divided into indoor and outdoor systems [7]. In particular, although the global positioning system (GPS) is the most frequently used outdoor location-based system, it cannot be effectively used in an indoor environment because of the shading effect of buildings. Therefore, other techniques, such as radio frequency identification, wireless local area network, Bluetooth, and ZigBee, are required for indoor localization [8]. All of these techniques involve transmitting radio wave signals to establish a wireless sensor network for positioning. However, during the transmission process, signals may be influenced by the multipath effect; therefore, information received by the reader may be distorted, influencing the accuracy and stability of localization [9–11].The interference in signal transmission is not entirely caused by obstacles; signal transmission may be interfered with by signals emitted from other electronic devices [12]. In addition, various receivers may experience different levels of interference because of varying transmission directions, despite using the same signal transmitter. Therefore, the result of positioning is influenced by obstacles in an environment, signals from other electronic devices, and the direction of signal transmission [13].To solve the problems produced by varying transmission directions and the multipath effect caused by obstacles, this study proposed a localization algorithm by combining the Kalman filter (KF) to enhance the accuracy and stability of localization. The proposed algorithm was subsequently compared with existing localization algorithms.This study has proposed an adaptive tracking system. Section2 discusses related literature, the concepts of the location algorithm, Kalman filter, and adaptive-network-based fuzzy inference system (ANFIS). Section 3 illustrates the proposed algorithm for the smart factory. Section 4 details the demonstration of the experimental operations and examines the algorithm in the smart factory environment. Finally, Section 5 includes the conclusion and highlights follow-up research.


## 2. Related Work

Among the propagation path loss models, the most widely used models are the free-space propagation, log-distance path loss, and Hata models. In the free-space propagation model, the Friis free-space model is typically adopted. When the distance between a transmitter and receiver is given, the model can be used to calculate the average received power of the receiver as follows [14]:(1)Prd=PtGtGrλ24π2d2L,where Pt represents the transmission power of the transmitter; λ is the wavelength of the electromagnetic wave; L denotes the system dissipation coefficient; and Gt and Gr are the antenna gains for the transmitter and receiver, respectively. The calculation of antenna gains is related to the effective aperture (Ae):(2)G=4πAeλ2.The effective aperture is related to the antenna design. Therefore, when the transmitter and receiver use different antennas, despite using the same transmission power, the power received by the receiver may differ.In equation (1), when the distance between the transmitter and receiver is 0 (d = 0), the received power cannot be determined. Therefore, a close-in distance (d0) is defined in the model, and the received power in this condition is a reference power. Thus, the Friis free-space model can be expressed as (3):(3)Prd=PtGtGrλ24π2d2L=PtGtGrλ24π2d02Ld0d2=Prd0d0d2.


### 2.1. Kalman Filter

The KF is a well-known tool used to eliminate noise and can provide an efficient calculation approach for estimating system states [15,16]. By applying a series of regression models, the efficiency of the least-square method can be enhanced [17]. Because the internal state of a system cannot consistently be directly estimated, the KF has two primary assumptions: (1) the system is linear, and (2) the system error distribution and initial estimate probability distribution are both Gaussian distributions [16]. The KF applies the linear stochastic difference equation to construct prediction and measurement models, as expressed in equations (4) and (5):(4)xk+1=Axk+Buk+wk,(5)zk=Hxk+vk,where xk indicates the state of a system at time k, A represents the conversion model for the system state, B denotes the control model for the control factor uk, zk is the observation state of a system at time k, and H is an observation model. In addition, wk and vk are system noise and observation noise, respectively, which are assumed to be mutually independent and to follow Gaussian distribution. wk and vk are expressed as equations (6) and (7):(6)wk∼N0,Q,(7)vk∼N0,R.The calculation of the KF is a regression process that involves two steps, namely, prediction and correction. At the prediction step, the system state (x^k−1) at time k-1 is used to calculate the a priori state of the system (x^k−) at time k.(8)x^k−=Ax^k−1+Buk−1,Pk−=APk−1AT+Q.At the correction step, the observation value of the system at timek is used to adjust the system state at time k.(9)Kk=Pk−HTHPk−HT+R−1,x^k=x^k−+Kkzk−Hx^k−,Pk=I−KkHPk−,where Pk− is the a priori estimation error of the system at time k, pk is the estimation error of the system at time k, and Kk indicates the Kalman gain of the system at time k. In the KF, the Kalman gain is applied to adjust the state estimates; therefore, the estimation errors of the systems can converge over time.Other KF-related studies include that of Yim et al., who used KNN to find the distance between the target and the antenna and gave different weights to the EKF depending on whether the target was located at a corner or not [15].


### 2.2. Adaptive-Network-Based Fuzzy Inference System

The ANFIS has the characteristic of neural network learning and the advantage of the rules of a fuzzy inference system and can thus process nonlinear and complex systems and identify system rules. Figure1 shows the framework of the ANFIS, which consists of five layers. The layers that comprise squares involve parameters, among which an optimal parameter can be obtained in each layer through learning adjustment. No parameters are involved in the layers comprising circles. The layers are explained as follows.Figure 1
The framework of ANFIS [18].


#### 2.2.1. Layer 1: Input Layer

(10)Ol1=μAix,where x is the input of A, and Ai is the ith semantic tag for input A. μAi(x) is the membership function (MF) for the ith semantic tag of input A. The bell-shaped distribution is the most frequently used MF that has values within the range of 0 to 1, as shown in (11):(11)μAix=11+x−ci/ai2bi,where ai, bi, and ci are parameters of the MF.


#### 2.2.2. Layer 2: Rule Layer

The firing strength of the fuzzy rules is calculated using equation (12):(12)Oi2=wi=μAix×μBiy,i=1,2.


#### 2.2.3. Layer 3: Normalization Layer

(13)Oi3=w¯i=wiw1+w2,i=1,2.


#### 2.2.4. Layer 4: Inference Layer

The output of the normalization layer is multiplied by the fuzzy rules to calculate the result of each rule.(14)Oi4=w¯ifi=w¯ipix+qiy+ri,where fi is the ith rule, and pi, qi, and ri are parameters for the ith rule.


#### 2.2.5. Layer 5: Output Layer

The weighted average of the results of the inference layer is computed to be the output of the ANFIS.(15)Oi5=∑w¯ifi=∑wifi∑wi.The parameters in each layer of the ANFIS are adjusted using a hybrid learning algorithm. When the optimal parameter adjustment is achieved, the calculation efficiency of the system and the output accuracy can be improved. Related studies using ANFIS include the following: Oliveira et al. combined signal strength and Link Quality Indication (LQI) to calculate distance and then used a fuzzy inference system to find the target location [19]; Lee et al. applied the parameters considered in the computational process to a fuzzy inference system to generate a new filter, which was then combined with a prototype filter to find the location of the target [20]; and other related practical applications of the relevant literature [21, 22].


## 2.1. Kalman Filter

The KF is a well-known tool used to eliminate noise and can provide an efficient calculation approach for estimating system states [15,16]. By applying a series of regression models, the efficiency of the least-square method can be enhanced [17]. Because the internal state of a system cannot consistently be directly estimated, the KF has two primary assumptions: (1) the system is linear, and (2) the system error distribution and initial estimate probability distribution are both Gaussian distributions [16]. The KF applies the linear stochastic difference equation to construct prediction and measurement models, as expressed in equations (4) and (5):(4)xk+1=Axk+Buk+wk,(5)zk=Hxk+vk,where xk indicates the state of a system at time k, A represents the conversion model for the system state, B denotes the control model for the control factor uk, zk is the observation state of a system at time k, and H is an observation model. In addition, wk and vk are system noise and observation noise, respectively, which are assumed to be mutually independent and to follow Gaussian distribution. wk and vk are expressed as equations (6) and (7):(6)wk∼N0,Q,(7)vk∼N0,R.The calculation of the KF is a regression process that involves two steps, namely, prediction and correction. At the prediction step, the system state (x^k−1) at time k-1 is used to calculate the a priori state of the system (x^k−) at time k.(8)x^k−=Ax^k−1+Buk−1,Pk−=APk−1AT+Q.At the correction step, the observation value of the system at timek is used to adjust the system state at time k.(9)Kk=Pk−HTHPk−HT+R−1,x^k=x^k−+Kkzk−Hx^k−,Pk=I−KkHPk−,where Pk− is the a priori estimation error of the system at time k, pk is the estimation error of the system at time k, and Kk indicates the Kalman gain of the system at time k. In the KF, the Kalman gain is applied to adjust the state estimates; therefore, the estimation errors of the systems can converge over time.Other KF-related studies include that of Yim et al., who used KNN to find the distance between the target and the antenna and gave different weights to the EKF depending on whether the target was located at a corner or not [15].


## 2.2. Adaptive-Network-Based Fuzzy Inference System

The ANFIS has the characteristic of neural network learning and the advantage of the rules of a fuzzy inference system and can thus process nonlinear and complex systems and identify system rules. Figure1 shows the framework of the ANFIS, which consists of five layers. The layers that comprise squares involve parameters, among which an optimal parameter can be obtained in each layer through learning adjustment. No parameters are involved in the layers comprising circles. The layers are explained as follows.Figure 1
The framework of ANFIS [18].


### 2.2.1. Layer 1: Input Layer

(10)Ol1=μAix,where x is the input of A, and Ai is the ith semantic tag for input A. μAi(x) is the membership function (MF) for the ith semantic tag of input A. The bell-shaped distribution is the most frequently used MF that has values within the range of 0 to 1, as shown in (11):(11)μAix=11+x−ci/ai2bi,where ai, bi, and ci are parameters of the MF.


### 2.2.2. Layer 2: Rule Layer

The firing strength of the fuzzy rules is calculated using equation (12):(12)Oi2=wi=μAix×μBiy,i=1,2.


### 2.2.3. Layer 3: Normalization Layer

(13)Oi3=w¯i=wiw1+w2,i=1,2.


### 2.2.4. Layer 4: Inference Layer

The output of the normalization layer is multiplied by the fuzzy rules to calculate the result of each rule.(14)Oi4=w¯ifi=w¯ipix+qiy+ri,where fi is the ith rule, and pi, qi, and ri are parameters for the ith rule.


### 2.2.5. Layer 5: Output Layer

The weighted average of the results of the inference layer is computed to be the output of the ANFIS.(15)Oi5=∑w¯ifi=∑wifi∑wi.The parameters in each layer of the ANFIS are adjusted using a hybrid learning algorithm. When the optimal parameter adjustment is achieved, the calculation efficiency of the system and the output accuracy can be improved. Related studies using ANFIS include the following: Oliveira et al. combined signal strength and Link Quality Indication (LQI) to calculate distance and then used a fuzzy inference system to find the target location [19]; Lee et al. applied the parameters considered in the computational process to a fuzzy inference system to generate a new filter, which was then combined with a prototype filter to find the location of the target [20]; and other related practical applications of the relevant literature [21, 22].


## 2.2.1. Layer 1: Input Layer

(10)Ol1=μAix,where x is the input of A, and Ai is the ith semantic tag for input A. μAi(x) is the membership function (MF) for the ith semantic tag of input A. The bell-shaped distribution is the most frequently used MF that has values within the range of 0 to 1, as shown in (11):(11)μAix=11+x−ci/ai2bi,where ai, bi, and ci are parameters of the MF.


## 2.2.2. Layer 2: Rule Layer

The firing strength of the fuzzy rules is calculated using equation (12):(12)Oi2=wi=μAix×μBiy,i=1,2.


## 2.2.3. Layer 3: Normalization Layer

(13)Oi3=w¯i=wiw1+w2,i=1,2.


## 2.2.4. Layer 4: Inference Layer

The output of the normalization layer is multiplied by the fuzzy rules to calculate the result of each rule.(14)Oi4=w¯ifi=w¯ipix+qiy+ri,where fi is the ith rule, and pi, qi, and ri are parameters for the ith rule.


## 2.2.5. Layer 5: Output Layer

The weighted average of the results of the inference layer is computed to be the output of the ANFIS.(15)Oi5=∑w¯ifi=∑wifi∑wi.The parameters in each layer of the ANFIS are adjusted using a hybrid learning algorithm. When the optimal parameter adjustment is achieved, the calculation efficiency of the system and the output accuracy can be improved. Related studies using ANFIS include the following: Oliveira et al. combined signal strength and Link Quality Indication (LQI) to calculate distance and then used a fuzzy inference system to find the target location [19]; Lee et al. applied the parameters considered in the computational process to a fuzzy inference system to generate a new filter, which was then combined with a prototype filter to find the location of the target [20]; and other related practical applications of the relevant literature [21, 22].


## 3. Methods

### 3.1. Localization Algorithm Combining the Kalman Filter and Adaptive-Network-Based Fuzzy Inference System

The proposed localization algorithm assumed that the relationship between RSSI and distance remains the same in the same environment with the same distance. In addition, the concept of reference tag was used to identify the environment parameters suitable for the targeted object. The algorithm comprises four steps, as shown in Figure2. The following section describes Figure 2. For more information, please refer to the descriptions on pages 7–11.Figure 2
The framework of the proposed localization algorithm.First, considering the use of antennas to receive the signal of the reference tag and the object to be measured, the signal will be distorted by the influence of multipath during the transmission process. Therefore, this study uses the characteristics of the Kalman filter (KF) to eliminate the noise during the transmission of the signal, so that the received signal is clean. The KF was then integrated with the modified Friis free-space model to identify the relationship between signals and distance. Through the correction learning of the ANFIS, the environment parameter suitable for the target was yielded, which was then combined with the modified WCG to determine the location of the target.


#### 3.1.1. Kalman Filter

The KF can filter noise caused by interference in signal transmission; therefore, readers can receive clean signals emitted by reference tags and the target without interference. Because all of the reference tags and targets used in this study were static, their states would not change during the system conversion from the true state to the observation state, except for being interfered with by noise. Therefore, the prediction and measurement models of the KF were simplified as equations (16) and (17):(16)sk+1=sk+wk,(17)zk=xk+vk,where(18)sk=RSSIkrefRSSIktgtT,wk∼N0,Q,where Sk is the true state of the system at time k, RSSIkref represents the signal strength of a reference tag at time k, RSSIktgt signifies the signal strength of the target at time k, wk indicates the noise in the true state of the system at time k, and Q is the variance of the true system state. However, because the variation of the system’s true state cannot be obtained easily, Q is typically excluded from the consideration.(19)zk=RSSIkref,measureRSSIktgt,measureT,vk∼N0,R,where Zk is the observation state of the system at time k; RSSIkref,measure is the observed signal of a reference tag at time k; RSSIktgt,measure represents the observed signal of a target at time k; vk indicates the noise in the observation state of the system at time k; and R denotes the variance of the observation state.The observation state of the system was used to predict the estimate of the true state of the system, and the correction was performed to reduce errors in the estimate and the actual value. The initial estimate (s^0) and error (P0) were given, and iteration calculation was performed, as shown in equations (20)–(24):(20)s^k=s^k−1,(21)Pk−=Pk−1,(22)Kk=Pk−Pk−+R−1,(23)s^k=s^k−+Kkzk−s^k−,(24)Pk=I−KkPk−,where s^k− is the a priori true state estimate of the system at time k, s^k− is the true state estimate of the system at time k, Pk− signifies the a priori estimation error of the system at time k, Pk indicates the estimation error of the system at time k, and Kk is the Kalman gain of the system at time k.


#### 3.1.2. Friis Free-Space Model

The Friis free-space model is the propagation path loss model obtained in a free space based on the inverse square law, which assumes that RSSI is inversely square proportional to distance (RSSI∝1/d2). However, the real environment is subject to the influence of the multipath effect; in other words, the signals received by readers frequently interfere. Therefore, the relationship between signal values and distance is not inversely square proportional. Thus, the Friis free-space model was modified to be(25)RSSI=RSSId^0dd^0dn,where RSSId^0 and dd^0 are Pr (d0) and d0 in equation (25); and n is the environment parameter, which varies according to the change in environment and distance.Moreover, when the environment and distance between the transmitter and receiver are the same, the receiver signal strength is influenced by various levels of interference in signal transmission, causing changes in the value ofn. Thus, this study employed reference tags to determine the possible value of n in the environment. The approach is as follows:Assume thatI readers (i = 1, 2, …, I) and J reference tags (j = 1, 2, …, J) were deployed in an indoor environment for localization. The value of n was calculated as follows:(26)RSSIijref,clean=RSSIclosedclosedijnijref,⇒RSSIijref,cleanRSSIclose=dclosedijnijref,⇒logRSSIijref,cleanRSSIclose=nijreflogdclosedij,⇒nijref=logRSSIijref,clean−logRSSIcloselogdclose−logdij,where RSSIijref,clean represents the clean signal sent by the jth reference tag and received by the ith reader, dij indicates the distance between the ith reader and the jth reference tag, and nijref is the value of n for the ith reader corresponding to the jth reference tag.


#### 3.1.3. Adaptive-Network-Based Fuzzy Inference System

This study applied the ANFIS to obtain the value ofn for the target connected to various readers. The ANFIS model involves three input data, one output data, and five layers. The input data represented as RSSIiclean (i = 1, 2, 3) were clean signals received by the ith reader. The output data were the values of n for readers corresponding to reference tags and the target.(1) Input Layer. Each input involved three MFs, which can be expressed as follows:(27)Ol1=μRSSIilcleanx,where μRSSIilcleanx indicates the first MF of the clean signal received by the ith reader. The MF was a bell-shaped distribution with values ranging from 0 to 1, as shown in (28), where x is the input signal, and al, bl, and cl are MF parameters.(28)μRSSIcleanx=11+x−cl/al2bl.(2) Rule Layer. The firing strength of the fuzzy rules was calculated as follows:(29)Om2=wm=μRSSI1acleanx×μRSSI2bcleany×μRSSI2ccleanz,where m is the mth rule; a, b, and c are the semantic tags for the first, second, and third readers, respectively; and a = b = c = 1, 2, 3.(3) Normalization Layer. The firing strength of all rules was normalized using (30).(30)Om3=w¯m=wm∑wm.(4) Inference Layer. The output of the normalization layer was multiplied with the fuzzy rules to calculate the result of each rule.(31)Om4=w¯mfm=w¯mpmx+qmy+rmz+sm,where fm is the mth rule, and pm, qm, rm, and sm are parameters for the mth rule.(5) Output Layer. The results yielded in the inference layer were summed to be the output value of the ANFIS.(32)O15=∑w¯mfm=∑wmfm∑wm.The clean signal of reference tags (RSSIijref,clean) and the n values for reference tags corresponding to various readers (nijref) were used as the input and output of training data in the hybrid learning algorithm. Consequently, the optimal ANFIS in the environment was employed to determine the value of n (nitgt) for the target corresponding to various readers.


#### 3.1.4. Calculation of the Target Location

Then (nitgt) obtained using the ANFIS was incorporated in the modified WCG as follows:(33)xt=∑xi/RSSIitgt,cleannitgt∑1/RSSIitgt,cleannitgt,yt=∑yi/RSSIitgt,cleannitgt∑1/RSSIitgt,cleannitgt,where (xt, yt) is the coordinate of the target; (xi, yi) is the coordinate of the ith reader; and RSSIitgt,clean indicates the clean signal sent by the target and received by the ith reader.


## 3.1. Localization Algorithm Combining the Kalman Filter and Adaptive-Network-Based Fuzzy Inference System

The proposed localization algorithm assumed that the relationship between RSSI and distance remains the same in the same environment with the same distance. In addition, the concept of reference tag was used to identify the environment parameters suitable for the targeted object. The algorithm comprises four steps, as shown in Figure2. The following section describes Figure 2. For more information, please refer to the descriptions on pages 7–11.Figure 2
The framework of the proposed localization algorithm.First, considering the use of antennas to receive the signal of the reference tag and the object to be measured, the signal will be distorted by the influence of multipath during the transmission process. Therefore, this study uses the characteristics of the Kalman filter (KF) to eliminate the noise during the transmission of the signal, so that the received signal is clean. The KF was then integrated with the modified Friis free-space model to identify the relationship between signals and distance. Through the correction learning of the ANFIS, the environment parameter suitable for the target was yielded, which was then combined with the modified WCG to determine the location of the target.


### 3.1.1. Kalman Filter

The KF can filter noise caused by interference in signal transmission; therefore, readers can receive clean signals emitted by reference tags and the target without interference. Because all of the reference tags and targets used in this study were static, their states would not change during the system conversion from the true state to the observation state, except for being interfered with by noise. Therefore, the prediction and measurement models of the KF were simplified as equations (16) and (17):(16)sk+1=sk+wk,(17)zk=xk+vk,where(18)sk=RSSIkrefRSSIktgtT,wk∼N0,Q,where Sk is the true state of the system at time k, RSSIkref represents the signal strength of a reference tag at time k, RSSIktgt signifies the signal strength of the target at time k, wk indicates the noise in the true state of the system at time k, and Q is the variance of the true system state. However, because the variation of the system’s true state cannot be obtained easily, Q is typically excluded from the consideration.(19)zk=RSSIkref,measureRSSIktgt,measureT,vk∼N0,R,where Zk is the observation state of the system at time k; RSSIkref,measure is the observed signal of a reference tag at time k; RSSIktgt,measure represents the observed signal of a target at time k; vk indicates the noise in the observation state of the system at time k; and R denotes the variance of the observation state.The observation state of the system was used to predict the estimate of the true state of the system, and the correction was performed to reduce errors in the estimate and the actual value. The initial estimate (s^0) and error (P0) were given, and iteration calculation was performed, as shown in equations (20)–(24):(20)s^k=s^k−1,(21)Pk−=Pk−1,(22)Kk=Pk−Pk−+R−1,(23)s^k=s^k−+Kkzk−s^k−,(24)Pk=I−KkPk−,where s^k− is the a priori true state estimate of the system at time k, s^k− is the true state estimate of the system at time k, Pk− signifies the a priori estimation error of the system at time k, Pk indicates the estimation error of the system at time k, and Kk is the Kalman gain of the system at time k.


### 3.1.2. Friis Free-Space Model

The Friis free-space model is the propagation path loss model obtained in a free space based on the inverse square law, which assumes that RSSI is inversely square proportional to distance (RSSI∝1/d2). However, the real environment is subject to the influence of the multipath effect; in other words, the signals received by readers frequently interfere. Therefore, the relationship between signal values and distance is not inversely square proportional. Thus, the Friis free-space model was modified to be(25)RSSI=RSSId^0dd^0dn,where RSSId^0 and dd^0 are Pr (d0) and d0 in equation (25); and n is the environment parameter, which varies according to the change in environment and distance.Moreover, when the environment and distance between the transmitter and receiver are the same, the receiver signal strength is influenced by various levels of interference in signal transmission, causing changes in the value ofn. Thus, this study employed reference tags to determine the possible value of n in the environment. The approach is as follows:Assume thatI readers (i = 1, 2, …, I) and J reference tags (j = 1, 2, …, J) were deployed in an indoor environment for localization. The value of n was calculated as follows:(26)RSSIijref,clean=RSSIclosedclosedijnijref,⇒RSSIijref,cleanRSSIclose=dclosedijnijref,⇒logRSSIijref,cleanRSSIclose=nijreflogdclosedij,⇒nijref=logRSSIijref,clean−logRSSIcloselogdclose−logdij,where RSSIijref,clean represents the clean signal sent by the jth reference tag and received by the ith reader, dij indicates the distance between the ith reader and the jth reference tag, and nijref is the value of n for the ith reader corresponding to the jth reference tag.


### 3.1.3. Adaptive-Network-Based Fuzzy Inference System

This study applied the ANFIS to obtain the value ofn for the target connected to various readers. The ANFIS model involves three input data, one output data, and five layers. The input data represented as RSSIiclean (i = 1, 2, 3) were clean signals received by the ith reader. The output data were the values of n for readers corresponding to reference tags and the target.(1) Input Layer. Each input involved three MFs, which can be expressed as follows:(27)Ol1=μRSSIilcleanx,where μRSSIilcleanx indicates the first MF of the clean signal received by the ith reader. The MF was a bell-shaped distribution with values ranging from 0 to 1, as shown in (28), where x is the input signal, and al, bl, and cl are MF parameters.(28)μRSSIcleanx=11+x−cl/al2bl.(2) Rule Layer. The firing strength of the fuzzy rules was calculated as follows:(29)Om2=wm=μRSSI1acleanx×μRSSI2bcleany×μRSSI2ccleanz,where m is the mth rule; a, b, and c are the semantic tags for the first, second, and third readers, respectively; and a = b = c = 1, 2, 3.(3) Normalization Layer. The firing strength of all rules was normalized using (30).(30)Om3=w¯m=wm∑wm.(4) Inference Layer. The output of the normalization layer was multiplied with the fuzzy rules to calculate the result of each rule.(31)Om4=w¯mfm=w¯mpmx+qmy+rmz+sm,where fm is the mth rule, and pm, qm, rm, and sm are parameters for the mth rule.(5) Output Layer. The results yielded in the inference layer were summed to be the output value of the ANFIS.(32)O15=∑w¯mfm=∑wmfm∑wm.The clean signal of reference tags (RSSIijref,clean) and the n values for reference tags corresponding to various readers (nijref) were used as the input and output of training data in the hybrid learning algorithm. Consequently, the optimal ANFIS in the environment was employed to determine the value of n (nitgt) for the target corresponding to various readers.


### 3.1.4. Calculation of the Target Location

Then (nitgt) obtained using the ANFIS was incorporated in the modified WCG as follows:(33)xt=∑xi/RSSIitgt,cleannitgt∑1/RSSIitgt,cleannitgt,yt=∑yi/RSSIitgt,cleannitgt∑1/RSSIitgt,cleannitgt,where (xt, yt) is the coordinate of the target; (xi, yi) is the coordinate of the ith reader; and RSSIitgt,clean indicates the clean signal sent by the target and received by the ith reader.


## 3.1.1. Kalman Filter

The KF can filter noise caused by interference in signal transmission; therefore, readers can receive clean signals emitted by reference tags and the target without interference. Because all of the reference tags and targets used in this study were static, their states would not change during the system conversion from the true state to the observation state, except for being interfered with by noise. Therefore, the prediction and measurement models of the KF were simplified as equations (16) and (17):(16)sk+1=sk+wk,(17)zk=xk+vk,where(18)sk=RSSIkrefRSSIktgtT,wk∼N0,Q,where Sk is the true state of the system at time k, RSSIkref represents the signal strength of a reference tag at time k, RSSIktgt signifies the signal strength of the target at time k, wk indicates the noise in the true state of the system at time k, and Q is the variance of the true system state. However, because the variation of the system’s true state cannot be obtained easily, Q is typically excluded from the consideration.(19)zk=RSSIkref,measureRSSIktgt,measureT,vk∼N0,R,where Zk is the observation state of the system at time k; RSSIkref,measure is the observed signal of a reference tag at time k; RSSIktgt,measure represents the observed signal of a target at time k; vk indicates the noise in the observation state of the system at time k; and R denotes the variance of the observation state.The observation state of the system was used to predict the estimate of the true state of the system, and the correction was performed to reduce errors in the estimate and the actual value. The initial estimate (s^0) and error (P0) were given, and iteration calculation was performed, as shown in equations (20)–(24):(20)s^k=s^k−1,(21)Pk−=Pk−1,(22)Kk=Pk−Pk−+R−1,(23)s^k=s^k−+Kkzk−s^k−,(24)Pk=I−KkPk−,where s^k− is the a priori true state estimate of the system at time k, s^k− is the true state estimate of the system at time k, Pk− signifies the a priori estimation error of the system at time k, Pk indicates the estimation error of the system at time k, and Kk is the Kalman gain of the system at time k.


## 3.1.2. Friis Free-Space Model

The Friis free-space model is the propagation path loss model obtained in a free space based on the inverse square law, which assumes that RSSI is inversely square proportional to distance (RSSI∝1/d2). However, the real environment is subject to the influence of the multipath effect; in other words, the signals received by readers frequently interfere. Therefore, the relationship between signal values and distance is not inversely square proportional. Thus, the Friis free-space model was modified to be(25)RSSI=RSSId^0dd^0dn,where RSSId^0 and dd^0 are Pr (d0) and d0 in equation (25); and n is the environment parameter, which varies according to the change in environment and distance.Moreover, when the environment and distance between the transmitter and receiver are the same, the receiver signal strength is influenced by various levels of interference in signal transmission, causing changes in the value ofn. Thus, this study employed reference tags to determine the possible value of n in the environment. The approach is as follows:Assume thatI readers (i = 1, 2, …, I) and J reference tags (j = 1, 2, …, J) were deployed in an indoor environment for localization. The value of n was calculated as follows:(26)RSSIijref,clean=RSSIclosedclosedijnijref,⇒RSSIijref,cleanRSSIclose=dclosedijnijref,⇒logRSSIijref,cleanRSSIclose=nijreflogdclosedij,⇒nijref=logRSSIijref,clean−logRSSIcloselogdclose−logdij,where RSSIijref,clean represents the clean signal sent by the jth reference tag and received by the ith reader, dij indicates the distance between the ith reader and the jth reference tag, and nijref is the value of n for the ith reader corresponding to the jth reference tag.


## 3.1.3. Adaptive-Network-Based Fuzzy Inference System

This study applied the ANFIS to obtain the value ofn for the target connected to various readers. The ANFIS model involves three input data, one output data, and five layers. The input data represented as RSSIiclean (i = 1, 2, 3) were clean signals received by the ith reader. The output data were the values of n for readers corresponding to reference tags and the target.(1) Input Layer. Each input involved three MFs, which can be expressed as follows:(27)Ol1=μRSSIilcleanx,where μRSSIilcleanx indicates the first MF of the clean signal received by the ith reader. The MF was a bell-shaped distribution with values ranging from 0 to 1, as shown in (28), where x is the input signal, and al, bl, and cl are MF parameters.(28)μRSSIcleanx=11+x−cl/al2bl.(2) Rule Layer. The firing strength of the fuzzy rules was calculated as follows:(29)Om2=wm=μRSSI1acleanx×μRSSI2bcleany×μRSSI2ccleanz,where m is the mth rule; a, b, and c are the semantic tags for the first, second, and third readers, respectively; and a = b = c = 1, 2, 3.(3) Normalization Layer. The firing strength of all rules was normalized using (30).(30)Om3=w¯m=wm∑wm.(4) Inference Layer. The output of the normalization layer was multiplied with the fuzzy rules to calculate the result of each rule.(31)Om4=w¯mfm=w¯mpmx+qmy+rmz+sm,where fm is the mth rule, and pm, qm, rm, and sm are parameters for the mth rule.(5) Output Layer. The results yielded in the inference layer were summed to be the output value of the ANFIS.(32)O15=∑w¯mfm=∑wmfm∑wm.The clean signal of reference tags (RSSIijref,clean) and the n values for reference tags corresponding to various readers (nijref) were used as the input and output of training data in the hybrid learning algorithm. Consequently, the optimal ANFIS in the environment was employed to determine the value of n (nitgt) for the target corresponding to various readers.


## 3.1.4. Calculation of the Target Location

Then (nitgt) obtained using the ANFIS was incorporated in the modified WCG as follows:(33)xt=∑xi/RSSIitgt,cleannitgt∑1/RSSIitgt,cleannitgt,yt=∑yi/RSSIitgt,cleannitgt∑1/RSSIitgt,cleannitgt,where (xt, yt) is the coordinate of the target; (xi, yi) is the coordinate of the ith reader; and RSSIitgt,clean indicates the clean signal sent by the target and received by the ith reader.


## 4. Experiment Evaluation

This study aims to evaluate whether the proposed algorithm meets the future operational requirements of the smart factory through three practical experimental operations. First, the proposed localization algorithm was verified to be capable of generating a more accurate and stable localization result. Second, the number of reference tags was adjusted to examine whether the localization accuracy was influenced by the number of reference tags used. Finally, the localization environment was interfered with to demonstrate that the proposed localization algorithm can generate the same localization results regardless of the interference.


### 4.1. Experimental Operation 1

The first experiment was conducted in a 20 m × 10 m smart factory environment, in which three readers, six reference tags, and one target was deployed, as shown in Figure3. The first experiment comprised two parts. In the first part, the type and number of MFs in the ANFIS in the proposed localization algorithm were altered to determine the parameters that can generate satisfactory localization outcomes. The quality of the localization outcomes depended on the distance difference between the actual location and the estimated location of the target given in equation (34) as well as the level of distance difference.(34)E=x−xt2+y−yt2,where x and y denote the actual x-axis and y-axis coordinate values for the target, and xt and yt are the estimated x-axis and y-axis coordinate values for the target, respectively.Figure 3
The experiment 1environment.The initial state of the system (s^0) is zero, and the initial covariance (P0) is 100. By setting the system observation state and initial parameters, the Kalman gain during the calculation process was adjusted and further used to identify the true state of the system, enabling covariance convergence.The localization algorithm proposed in this study categorized the MFs of the ANFIS into three types, namely, triangular-shaped, bell-shaped, and Gauss curves. Two and three MFs were adopted from each type for analysis. Through various combinations of the MFs, the environment parameters that generated superior localization results and were suitable for the target were calculated by employing the MATLAB toolbox for the ANFIS. The experimental results are presented in Table1.Table 1
The average error in the combination of ANFIS parameters (cm).
Membership function typeNumber of membership functions23AverageStd.AverageStd.Triangular-shaped62.7625112.7484667.290131.973175Bell-shaped77.6217432.3248167.026781.448937Gaussian curve64.0582824.1049666.978182.119094The standard deviations shown in Table1 revealed that the results generated using three MFs were more stable compared with those generated using two MFs. Moreover, among the three MF types, the average error produced by the Gauss curve MF was the smallest, and the bell-shaped MF produced optimal stability. Because the Gauss curve and bell-shaped MFs had similar average errors, this study adopted three bell-shaped MFs for the ANFIS parameter setting. The proposed localization algorithm was compared with other frequently used algorithms, such as the LANDMARC [23], WCG [24], ANFIS, and DV-Hop [25] algorithms, and the comparison results are shown in Table 2.Table 2
The comparison of localization algorithms in operational experiment 1 (cm).
Localization algorithmTest 1Test 2Test 3Test 4Test 5Test 6Test 7Ave.Std.KF + ANFIS66.2767.3864.4166.8368.7467.0868.4767.031.45LANDMARC183.15190.987.94156.2499.36137.83210.44140.8569.26WCG110.03114.57111.58123.78118.89107.53115.65114.585.53ANFIS457.39992.63944.561005.2451.21107.75438.15628.12351.78DV-hop150.86145.85146.85146.86152.86152.86146.861493.08Figure4 shows that the proposed localization algorithm that combined the KF and ANFIS produced minimal localization errors, compared with other algorithms. The comparison presented in Table 2 revealed that the proposed localization algorithm demonstrated optimal localization stability.Figure 4
The comparison of algorithms in experiment 1.The localization results using LANDMARC, WCG, and ANFIS algorithms contained a high number of errors and lacked stability because these algorithms did not consider possible interference in the signal propagation process or the consequent signal distortion. This study applied the concept of reference tag and eliminated noise in the signal transmission process by employing the KF. The propagation path loss model was then used to generate environment parameters, and the environment parameter that was most suitable for the target was obtained using the ANFIS. The weighting method was finally adopted to determine the location of the target. The experimental results indicated that the proposed localization algorithm that combined the KF and ANFIS can be applied to indoor localization.


### 4.2. Experimental Operation 2

By changing the number of reference tags, the experiment in this experiment aimed to verify whether the number of reference tags influenced the localization results produced by the proposed localization algorithm. Thus, the number of reference tags was set as three and six. The experiment was conducted in a 5 m × 6 m smart factory environment (Figures5 and 6).Figure 5
The second experimental smart factory environment in which three reference tags were used.Figure 6
The second experimental smart factory environment in which six reference tags were used.Table3 indicates that the proposed localization algorithm produced stable localization results regardless of using three or six reference tags; however, the result obtained using six reference tags was superior. This can be explained as follows: The proposed localization algorithm applied the ANFIS to calculate possible environment parameters. In the calculation, the data of the reference tags were used as the training data to identify the inference system suitable for the environment. Therefore, using a high number of reference tags, the possible environment parameters can be identified easily, and accurate localization results can be obtained.Table 3
Comparison of results produced by using different numbers of reference tags in the second experiment (cm).
Number of reference tagsTest 1Test 2Test 3Ave.Std.3381.8165380.849381.6782381.44790.5232366311.3723311.1209312.0504311.51450.480825


### 4.3. Experimental Operation 3

The experimental results obtained in the second experiment were used in experiment 3. An interference experiment was conducted in a 9 m × 10 m smart factory environment. Specifically, in a localization environment, the transmission of signals was interfered with by human walking. Subsequently, data were analyzed to verify whether the proposed localization algorithm can generate a localization result at a high level of accuracy and stability. The third experimental environment is shown in Figure7.Figure 7
The third experimental smart factory environment.Because the proposed localization algorithm applied the KF to eliminate noise during the signal transmission process, the interference of human walking did not cause the localization results to change significantly. Table4 and Figure 8 show that the tests with and without interference produced similar average errors and stable localization results.Table 4
Comparison of results produced in the smart factory environment with and without interference in the third experiment (cm).
InterferenceTest 1Test 2Test 3Test 4Test 5Ave.Std.With interference69.692873.590772.437972.405771.158171.85711.4846Without interference69.04672.42368.20669.968469.919369.91251.5786Figure 8
Comparison of errors produced in the smart factory environment with and without interference in the third experiment.In this study, we compared the proposed method with the current common localization algorithms (LANDMARC, WCG, ANFIS, and DV-Hop) operated in the smart factory environment through experimental operation 1; the results confirm that the proposed algorithm has significantly improved the localization error and is relatively stable (lowest value of standard deviation). Furthermore, experimental operation 2 was used to verify whether the larger the number of reference tags, the more it interferes with the accuracy of localization in the smart factory environment; as a result, in the smart factory environment, the more the number of reference tags is in the proposed algorithm, the more likely it is to find the possible interference parameters and to obtain more accurate localization results. However, in the real-life application, it is not possible to completely exclude the interference of the movement of people on the positioning. Therefore, in experimental operation 3, we verified whether the interference of human movement on the signal transmission affects the accuracy and stability of localization in the smart factory environment. Overall, we conclude that regardless of the interference of signal transmission caused by the movement of people, there is no effect on the positioning results in terms of average positioning error or stability.


## 4.1. Experimental Operation 1

The first experiment was conducted in a 20 m × 10 m smart factory environment, in which three readers, six reference tags, and one target was deployed, as shown in Figure3. The first experiment comprised two parts. In the first part, the type and number of MFs in the ANFIS in the proposed localization algorithm were altered to determine the parameters that can generate satisfactory localization outcomes. The quality of the localization outcomes depended on the distance difference between the actual location and the estimated location of the target given in equation (34) as well as the level of distance difference.(34)E=x−xt2+y−yt2,where x and y denote the actual x-axis and y-axis coordinate values for the target, and xt and yt are the estimated x-axis and y-axis coordinate values for the target, respectively.Figure 3
The experiment 1environment.The initial state of the system (s^0) is zero, and the initial covariance (P0) is 100. By setting the system observation state and initial parameters, the Kalman gain during the calculation process was adjusted and further used to identify the true state of the system, enabling covariance convergence.The localization algorithm proposed in this study categorized the MFs of the ANFIS into three types, namely, triangular-shaped, bell-shaped, and Gauss curves. Two and three MFs were adopted from each type for analysis. Through various combinations of the MFs, the environment parameters that generated superior localization results and were suitable for the target were calculated by employing the MATLAB toolbox for the ANFIS. The experimental results are presented in Table1.Table 1
The average error in the combination of ANFIS parameters (cm).
Membership function typeNumber of membership functions23AverageStd.AverageStd.Triangular-shaped62.7625112.7484667.290131.973175Bell-shaped77.6217432.3248167.026781.448937Gaussian curve64.0582824.1049666.978182.119094The standard deviations shown in Table1 revealed that the results generated using three MFs were more stable compared with those generated using two MFs. Moreover, among the three MF types, the average error produced by the Gauss curve MF was the smallest, and the bell-shaped MF produced optimal stability. Because the Gauss curve and bell-shaped MFs had similar average errors, this study adopted three bell-shaped MFs for the ANFIS parameter setting. The proposed localization algorithm was compared with other frequently used algorithms, such as the LANDMARC [23], WCG [24], ANFIS, and DV-Hop [25] algorithms, and the comparison results are shown in Table 2.Table 2
The comparison of localization algorithms in operational experiment 1 (cm).
Localization algorithmTest 1Test 2Test 3Test 4Test 5Test 6Test 7Ave.Std.KF + ANFIS66.2767.3864.4166.8368.7467.0868.4767.031.45LANDMARC183.15190.987.94156.2499.36137.83210.44140.8569.26WCG110.03114.57111.58123.78118.89107.53115.65114.585.53ANFIS457.39992.63944.561005.2451.21107.75438.15628.12351.78DV-hop150.86145.85146.85146.86152.86152.86146.861493.08Figure4 shows that the proposed localization algorithm that combined the KF and ANFIS produced minimal localization errors, compared with other algorithms. The comparison presented in Table 2 revealed that the proposed localization algorithm demonstrated optimal localization stability.Figure 4
The comparison of algorithms in experiment 1.The localization results using LANDMARC, WCG, and ANFIS algorithms contained a high number of errors and lacked stability because these algorithms did not consider possible interference in the signal propagation process or the consequent signal distortion. This study applied the concept of reference tag and eliminated noise in the signal transmission process by employing the KF. The propagation path loss model was then used to generate environment parameters, and the environment parameter that was most suitable for the target was obtained using the ANFIS. The weighting method was finally adopted to determine the location of the target. The experimental results indicated that the proposed localization algorithm that combined the KF and ANFIS can be applied to indoor localization.


## 4.2. Experimental Operation 2

By changing the number of reference tags, the experiment in this experiment aimed to verify whether the number of reference tags influenced the localization results produced by the proposed localization algorithm. Thus, the number of reference tags was set as three and six. The experiment was conducted in a 5 m × 6 m smart factory environment (Figures5 and 6).Figure 5
The second experimental smart factory environment in which three reference tags were used.Figure 6
The second experimental smart factory environment in which six reference tags were used.Table3 indicates that the proposed localization algorithm produced stable localization results regardless of using three or six reference tags; however, the result obtained using six reference tags was superior. This can be explained as follows: The proposed localization algorithm applied the ANFIS to calculate possible environment parameters. In the calculation, the data of the reference tags were used as the training data to identify the inference system suitable for the environment. Therefore, using a high number of reference tags, the possible environment parameters can be identified easily, and accurate localization results can be obtained.Table 3
Comparison of results produced by using different numbers of reference tags in the second experiment (cm).
Number of reference tagsTest 1Test 2Test 3Ave.Std.3381.8165380.849381.6782381.44790.5232366311.3723311.1209312.0504311.51450.480825


## 4.3. Experimental Operation 3

The experimental results obtained in the second experiment were used in experiment 3. An interference experiment was conducted in a 9 m × 10 m smart factory environment. Specifically, in a localization environment, the transmission of signals was interfered with by human walking. Subsequently, data were analyzed to verify whether the proposed localization algorithm can generate a localization result at a high level of accuracy and stability. The third experimental environment is shown in Figure7.Figure 7
The third experimental smart factory environment.Because the proposed localization algorithm applied the KF to eliminate noise during the signal transmission process, the interference of human walking did not cause the localization results to change significantly. Table4 and Figure 8 show that the tests with and without interference produced similar average errors and stable localization results.Table 4
Comparison of results produced in the smart factory environment with and without interference in the third experiment (cm).
InterferenceTest 1Test 2Test 3Test 4Test 5Ave.Std.With interference69.692873.590772.437972.405771.158171.85711.4846Without interference69.04672.42368.20669.968469.919369.91251.5786Figure 8
Comparison of errors produced in the smart factory environment with and without interference in the third experiment.In this study, we compared the proposed method with the current common localization algorithms (LANDMARC, WCG, ANFIS, and DV-Hop) operated in the smart factory environment through experimental operation 1; the results confirm that the proposed algorithm has significantly improved the localization error and is relatively stable (lowest value of standard deviation). Furthermore, experimental operation 2 was used to verify whether the larger the number of reference tags, the more it interferes with the accuracy of localization in the smart factory environment; as a result, in the smart factory environment, the more the number of reference tags is in the proposed algorithm, the more likely it is to find the possible interference parameters and to obtain more accurate localization results. However, in the real-life application, it is not possible to completely exclude the interference of the movement of people on the positioning. Therefore, in experimental operation 3, we verified whether the interference of human movement on the signal transmission affects the accuracy and stability of localization in the smart factory environment. Overall, we conclude that regardless of the interference of signal transmission caused by the movement of people, there is no effect on the positioning results in terms of average positioning error or stability.


## 5. Conclusion

Traditional localization algorithms based on signal strength cannot produce accurate localization results because of the multipath effect. This study provides a practical contribution by offering an adaptive tracking system with improved tracking algorithms. The system combines KF and ANFIS and applies the concept of reference tags to a smart factory environment. Compared with the positioning error derived from the conventional ANFIS algorithm, the hybrid positioning algorithm (KF + ANFIS) provided in this study reduces the positioning error by up to 89% (=(628.12–67.03)/628.12). Compared with other common localization algorithms, including LANDMARC, WCG, and DV-Hop, the localization error is also reduced by at least 50%. Specifically, the KF was employed to eliminate noise in signal transmission, and a propagation path loss model was adopted to obtain the environment parameters in signal transmission. Through the learning of the ANFIS, the environment parameter most suitable for the target was generated and was subsequently used in the weighting method to determine the location of the target. This technology can be applied not only in smart factories but also in the marketing field. In recent years, it has been proposed to provide local advertising with the user’s location information. This helps to market products and services. The contribution of this study can improve the accuracy of indoor positioning and reduce the provision of misinformation.Moreover, this study involved experimenting in a real environment for parameter setting, and the proposed localization algorithm was compared with other commonly used localization algorithms. The data analysis revealed that the proposed localization algorithm can produce an accurate and stable localization result superior to that produced by others. In addition, experiments regarding the number of reference tags and interference in a localization environment were conducted in this study. The experimental result revealed that an increase in the number of reference tags can cause an increase in localization accuracy. The proposed localization algorithm can produce stable localization results with similar errors regardless of interference in the localization environment.Although the results produced by the localization algorithm proposed in this study still involved errors, a certain level of stability was achieved. Future studies can identify the stability errors in an environment to obtain an accurate localization result. The combination of various types and numbers of MFs in the ANFIS can be used to improve the accuracy of the localization result for self-propelled inspection robots, thereby effectively reducing the related costs. This location-based service technology can effectively provide accurate equipment information that widely applies in warehouse management, transportation, personnel tracking, and medical care.



---

*Source: 4325708-2021-10-18.xml*