A low-cost indoor localization system based on received signal strength indicator by modifying trilateration for harsh environments

Indoor localization systems using received signal strength indicator are very popular for their low power and low complexity, but some drawbacks limit their accuracy, especially in harsh environments, such as multipath and fluctuation. Most existing approaches solve the problem by “fingerprinting.” However, “fingerprinting” based algorithms are unsuitable for changeable environments like construction, since they all demand prior knowledge of the environment. This article studies a novel localization system to achieve an acceptable accuracy position using received signal strength indicator for harsh environments like construction. Based on analysis of the targets’ behavior pattern, we first use curve fitting to filter the distance derived from received signal strength indicator. And then, we propose a distance ratio location algorithm to estimate the targets’ positions. Furthermore, Kalman filter is considered to smooth the position results. This method has been applied in the “Monitoring and Control System for Underground Tunneling Based on Cyber Physical System” Project in Wuhan for tracking workers and vehicles. Practice results show that our system has an acceptable accuracy.


Introduction
With the rapid development of Internet of things (IoT), the demand for positioning and navigation is becoming more and more popular.Some mature solutions for outdoor localization, such as Global Positioning System (GPS) and BeiDou Navigation Satellite System (BDS), are unsuitable for indoor localization because of the poor penetration of the satellite signal.Accordingly, a number of commercial systems and research prototypes have been proposed for indoor localization.
The time-based indoor localization system, using ultra wideband (UWB) radio, is the most accurate method.But high costs and complexity limit its spread.Another solution is based on the geomagnetic field.By utilizing a magnetic sensor, building's anomalies in the Earth's magnetic field can be detected to track a person's location indoors.This technology is mainly used in the smart phone.The drawback is that it must collect the magnetic field of the building before locating.Some other solutions aim at mobile wireless sensor networks (MWSNs), 1 which has focused on outdoor localization with low-cost and low-power consumption partly based on GPS.
RSSI-based algorithm is a promising approach when the IoT application demands low cost and low complexity.In an ideal situation, the log-normal distance path loss (LDPL) model 2 can exactly describe the relationship between distance and RSSI, then trilateration algorithm can calculate coordinates.However, LDPL model has poor performance in real environments.Because RSSI would be easily affected by many interferences like multipath or obstacles attenuation, it makes the RSSI unreliable and leads to low position accuracy.As a result, most RSSI-based research works have focused on the idea of ''fingerprinting'' to improve the accuracy in recent years, which has been getting many valuable results.However, it demands prior knowledge of environments, which means a limitation for application in changeable environments like construction.In this case, trilateration and LDPL model should have been more suitable.Nevertheless, few studies have paid attention in this direction for the unreliable relationship between RSSI and distance, especially in harsh environments.To address the problem, this article proposes a novel filter for distance from LDPL model, and modifies the trilateration algorithm to calculate coordinates.
The main points are as follows.First, we calculate the distances between beacon nodes (BNs) and target nodes through LDPL model.Second, based on analyzing targets behavior, we use curve fitting (CF) technique to smooth raw data in a series of overlapping time slices (CFOTS).Based on the characteristics of CF, smoothed data will become a series continuous curve.We fused them to one distance curve using the weighted average algorithm on the overlapping area.And then, an algorithm, modified trilateration named distance ratio location (DRL), is proposed to estimate targets approximate location based on these distance curves.Finally, the locations will be smoothed by Kalman filter (KF).This method has been applied in WuHan Metro construction.It is an extremely harsh environment.Large equipment and construction operations can lead to a very complex multipath, electromagnetic interference, data-packet loss sometimes.Moreover, the environment will change with the construction schedule.Compared with other localization algorithms, the method can achieve acceptable results.
The contributions of this work can be summarized as follows: Traditional filter has always tried to smooth the noise from raw RSSI data, but it is too difficult for the weak relationship between distance and RSSI.Therefore, we start analyzing in targets' behaviors and summarize them into three movement modes.
Based on the analysis, we propose a filter using polynomial CF to smooth the distance between target node (TN) and BN.With the characteristic of CF, discrete distance points can be smoothed into a continuous curve.We modify trilateration to a new algorithm and name it as DRL.Instead of calculating the absolute accurate coordinates, DRL tries to estimate the approximate location.We applied the system in metro construction, and the results have shown a significant improvement compared to other existing works.
The rest of this article is organized as follows.Section ''Related work'' gives a short summary of the related work for indoor localization.We describe their drawbacks and present the advantages of the method proposed in this article.Section ''System model'' describes the system model used in this article.In section ''Localization method design,'' we first give a high level description on the problem studied.Then, the distance filter and DRL algorithm are introduced in detail.Section ''Practice results and evaluation'' presents the evaluation results and section ''Conclusion'' concludes the article.

Related work
The physical measurements used in most indoor localization approaches can be classified into three categories: 3 time, angle, and power features.Some other hydra indoor location systems, using ancillary features, need the extra hardware, which means increasing cost and implementation difficulty.
Time features employed in ranging are usually in two forms: time of arrival (TOA) and time difference of arrival (TDOA).The accuracy of time-based ranging depends on the bandwidth of communication.The best resolution of wireless communication physical layer for time feature is the UWB.5][6][7] On the other hand, some mature commercial localizations have emerged, such as PLUS and Ubisense.They are both based on UWB and have a very high precision (approximately 10-15 cm).The Ubisense system uses both TDOA and AOA to estimate the location of specific tags, and the PLUS system uses the TDOA mechanism.Their main drawback is the very high cost, 8 Ubisense and PLUS's costs all exceed US$7000 for just four BNs.Furthermore, obstacles, especially metal, will seriously interfere with the PLUS system after running our tests.
Angle features are mainly used in angle of arrival (AOA) or direction of arrival (DOA) algorithms.
According to the difference in signal forms, they can be further divided into two subclasses: (1) using the antennas amplitude response and (2) using the receiver antennas phase response.The first category is named beam forming and the other is phase interferometry.Directional antennas can be used to estimate both angle and distance, and then the location of target can be located. 9,10Single access point-based indoor localization (SAIL) 9 combines physical layer (PHY) information and human motion to compute the propagation delay of the direct path by itself, eliminating the adverse effect of multipath and yielding submeter distance estimation accuracy.Each BN, equipped with a switched-beam antenna, can estimate both the azimuth and the elevation of the incoming signals to locate the target. 10][14][15] Actually, obtaining the angle features generally requires RSSI.A drawback of this kind of localization method is that multiple antennas are required, which makes the localization system more complicated and difficult to implement.Therefore, using off-the-shelf platforms like Yang et al., 16 apparently, is not suitable for construction environment.
Power features in indoor localization systems are generally divided into two forms: Channel State Information (CSI) and RSSI.First, CSI can leverage the finer grained power feature and channel response to discriminate multipath characteristics. 17CSI works in the PHY layer.Accordingly, professional equipment is necessary. 18Although channel response can be partially extracted from off-the-shelf frequency division multiplexing (OFDM) receivers in the format of CSI since 802.11a/g/n standard, 19 CSI is also difficult to use on other platforms.Second, although some articles 20 question RSSI's accuracy, it is still widely used in many indoor localization systems for its low cost and simplicity to implement.RSSI can be used in both geometric mapping and ''fingerprinting'' algorithm, but the ''fingerprinting''-based approach is more popular 21,22 for its higher accuracy.RADAR is probably one of the first examples of an indoor localization system using signal strength. 23RADAR employs an empirical model to resolve the errors caused by multipath, metal reflection, and other noises.It can achieve an accuracy of 2-3 m.But there will be a sharp decline in accuracy when significant changes in the environment occur, 23 and this is also a major drawback for all ''fingerprinting''-based localization algorithm.Some approaches try to solve this problem.For instance, Wang et al. 24 use a particle swarm optimization (PSO)based back propagation (BP) neural network (PSO-BP) method to determine the relationship between RSSI and distance.But they need plenty of reference tags deployed as equilateral triangles, which is impossible in some harsh environments.Blumrosen et al., 25 using the channel path-loss model, performs a set of offline tests of the system that attempt to match system parameters to the experiment's environment using different RSSI measurements at predetermined locations.But it improves little in the metro construction environment.Researches 26 on geometric mapping generally focus on smoothing RSSI and position results in order to obtain improved location information.However, geometric algorithm-based localization system still cannot obtain an acceptable accuracy in harsh environments.Some other approaches tried to solve the problem by fusing multisensors.For example, Chen et al. 27 present a weight loss path of WiFi with pedestrian dead reckoning (PDR) to achieve high accuracy.But some sensors, like accelerometer, magnetometer, and gyroscope, have a large power consumption.
High accuracy and low cost are the two main goals in designing localization systems.Unfortunately, we cannot take them both in most cases.

System model
A target can be a person, a vehicle, or other mobile object, and we consider it as a TN in this article.Accordingly, we consider the nodes with known coordinates as BNs.
Each TN wears an electronic tag.The tag transmits signals periodically, and each BN records the RSSI when receiving the signal.Localization algorithm will run in a central server.Accordingly, necessary information for algorithm, including the BN network topology, LDPL model, and so on is stored in the server.
The LDPL mode describes the relationship between RSSI and distance as logarithmic, which means that the more the distance between TN and BN, the lower the sensitivity of RSSI is.In other words, the RSSI error, recorded by hardware, will be too large to be acceptable when the distance is beyond a certain extent, even if the environment is ideal.Therefore, we should deploy the BNs closely as possible.CC1101 is the radio frequency chip used in the application.According to its measurement accuracy, the distance between the adjacent BN should be less than 50 m, which is illustrated in Figure 1; x and y are the distance between the adjacent nodes, they are all less than 50 m.
DRL algorithm, calculating the position from the distance curve, demands that the quadrilateral made by four adjacent nodes must be a parallelogram, and a rectangle will be better.In other words, in Figure 1, distance y 1 , y 2 , and y 3 are equal, and x 1 , x 2 is equal.The angle between x and y will 90 degrees.

LDPL model
The distance between TN and BN can be calculated by LDPL through RSSI, and then TN's coordinate will be calculated by localization algorithm based on BN network topology.
The LDPL model is the theoretical basis in this algorithm.It is illustrated as equation ( 1), and then equation (2) can be deduced, which indicates the intuitive relationship between RSSI and distance as 2 In equation (1), where d means the distance and PL(d) denotes the path loss of RSSI at d. PL(d 0 ) is the average path loss at reference point d 0 and n is the path-loss exponent.X s is a zero-mean normal random variable reflecting the attenuation in decibel caused by shadowing. 17In equation ( 2), d means distance, R means RSSI, a and n are constant.From equation ( 2), distance can be obtained by RSSI.

Behavior analysis
Theoretically, in the ideal state, there is only one factor--distance--can influence RSSI, and the relationship between distance and RSSI is positive correlated.Therefore, three basic patterns of TN behavior will influence the RSSI from one single BN: (1) approaching the BN means the distance decreasing, (2) being away from the BN means distance decreasing and (3) keeping a constant distance.
Through experimental observation, a TN will be of uniform motion or stationary in most cases.The speed can change, but it only occurs in a very short period of time in most cases.For example, we illustrate some typical cases of a TN movement in Figure 2 and Figure 3 shows the distance variation curves between the TN and BN.It is easy to find out that the TN movement consists of three modes mentioned above: Pattern (1) means rising, Pattern (2) means decline, and Pattern (3) means a straight line.We subdivide the time into a series of small time slices, and then the distance curve will be divided into a series of small fragments.In Figure 3, the distance curves are divided by longitudinal dotted lines to fragments in every 5 s.In each fragment, we can find that the changing behavior mode occurs at once, all curves are similar to parts of a parabola curve or a straight line.
Based on the analysis above, we can divide the distance variation curves by time slot for easy filtering.

Filter using CF in overlapping time slices for distance
The distance, calculated from RSSI by LDPL, is unreliable for interference.A filter algorithm is proposed as follows.
We subdivided the time into a series of slices of the same length.According to the analysis of TN behavior above, distance points in each time slices are similar to parts of a parabola curve or a straight line.Generally, the time slices are short and harsh environment leads to packet loss, which causes a small number of distance points.Therefore, there will be over fitting using high-order polynomial.Quadratic polynomial of equation ( 3) is considered as the aim of CF method in this article.We fit the discrete distance points using the least squares principle.Raw distance points, captured from WuHan metro construction, are illustrated in Figure 4, and it is very hard to find out the TN trajectory.After CF in each time slice, the distance points become a continuous curve and have better performance.
But there is a limitation for properties of polynomial curve fitting: central region of the curve will have a higher similarity with real data than the edge regions.To address this problem, we use a weighted fusion algorithm in multiple time slices overlapping area.Details are described as follows.
We define a basic time unit t (usually 1 s) and the length of a time slice is n Ã t, where n is a constant number.Each time slice starts from each basic time unit, which means that a period of time, with length of m Ã t, will involve m piece of time slices.Therefore, there will be overlapping areas between adjacent time slices.For example, in Figure 5, we suppose n = 3, so that three time slices will overlap in each basic time unit, except for the first two and the last two.In each time slice, we calculate a quadratic polynomial f j (x) for distance points by CF, and equation ( 3) is the aim function.The details of the algorithm are described as follows.
where f (x) is the distance curve from CF, a, b, c are quadratic polynomial constants, and x is the time.In equation ( 4), F(a, b, c) is the cost function of least squares method, we need to minimize it to where n means the number of distance points in the time slice.Partial derivative of a, b, c in the F(a, b, c) will be Gaussian elimination method can be used to solve a, b, c, and then we can obtain the distance curve in each time slice.In order to distinguish the different time slices, we add subscript j for a, b, c and f (x) in equation ( 6).
where j means the jth time slice.There will be an overlapping area in basic time units among the adjacent time slices.Which means that different distance curves can be obtained from adjacent time slices in the same time unit.We fuse them by the weighted mean method x 2 (i*t, (i + 1)*t In the ith basic time unit, where F i (x) means the distance curve after weighted average fusion, j means the jth time slice and the number of time slices overlapping are n.The weight v depends on the position of the time slice in the basic time unit.In other words, the closer the position is to the center, the higher the v.In this article, we use a parabola to describe it in equation ( 8) as where n is the number of overlapping time slices and m is a constant value.This algorithm can smooth the discrete distance points and make them to be continuous curves.Furthermore, it can fill some missed RSSI data caused by packet loss.

DRL algorithm
Distance curve, smoothed by CFOTS, is still not enough to achieve acceptable accuracy by the traditional localization algorithm.To address this problem, instead of trying to calculate the exact location with trilateration, the DRL algorithm estimates a series of approximate locations with the ratio of distances.
According to the description in section ''System model,'' we deploy the four adjacent BNs as a regular rectangle; in other words, any two adjacent BNs will have the same x coordinate or y coordinate.An example is illustrated in Figure 6.The steps of the algorithm are described as follows.
First, we calculate the X coordinate of TN, and there will be an equation (9) in two adjacent BNs with the same y coordinate as where (X , Y ) means the TN coordinate, (x i , y i ) is the coordinate of BN i, and d i , d j are distance from B i , B j .It will be m pairs of BNs, which have the same y coordinates.X is the x coordinate of TN, and c means that the coordinate is calculated from the cth pair of BNs.k c is an undetermined coefficient.Equation 9describes the trigonometry function between TN and BNs.Now if we assume that k c is determined, then (x c À x i ) can be calculated from equation ( 9), and we refer to it as D c , and then x c can be obtained.Fusion of these x c coordinates will estimate the real x coordinate, so that where j c means the weight.They mainly depend on experience.But in general, the closer the value of X c is to the center, the greater the value of the weight.The y coordinate estimation will be in the same way Estimating k c , e c is the key to obtain the coordinate.The real k c , e c should be a ratio of two particular trigonometrics.
Requirement (2) of the algorithm makes real coordinates of TN to not exceed the rectangular.From the equation above, we know that k c and e c are in the range of À'; + '.But because the real coordinate of TN will be limited in the shape by BNs, the maximum offset of location from k c and e c will be just jx i À x j j and jy i À y u j.The parameters k c and e c are important, but unreliable RSSI will make a huge error on them, which will lead to unacceptable accuracy.Therefore, we ignore k c and e c temporarily, and equation ( 13) can be made.Next we will discuss the offset caused by ignoring these two parameters as Now we analyze the influence for ignoring k c and e c , which will be a reference for the KF in the next step.A typical location situation is illustrated in Figure 6, and actually, it is a very small possibility for other cases.According to Figure 6, a TN is in the interior of a rectangular shape, and the four BNs receiving location signals are the four vertices, so that Figure 6.A typical plan of deployed BN.
There are four equations in (14), and each of them can calculate an X coordinate or Y coordinate.We suppose the (x, y) is the real location and (X , Y ) is the calculated location from the fusion.Then, the vector O c (x À Y c , y À Y c ) means the offset of real location.Figure 7 shows the distributions in a rectangular shape.In Figure 7, we suppose the distance between B4 and B3 is 50 m, and the distance between B1 and B4 is 25 m.The O c will be considered as a system input in the KF.

KF
The location curve obtained from the DRL algorithm is rough and serrate.KF provides an optimal estimation for a linear state space.KF requires a discretization of the continuous location curve.We make a series of discrete points in every 0.1 s from the curve.
The state of a TN is described as (x, y) T .And at time k, it is evolved from the state at (k À 1) according to where F k is the state transition model which is applied to the previous state X k1 , and it is T k is the control-input model and V k is control vector, they mean the interval of time and velocity and be described as 17; w k is the Gaussian noise with mean vector (0, 0) T and covariance matrix The observation model is defined as where n k is the observation noise, which is assumed to be Gaussian noise with zero mean and standard R, H k is the observation matrix The filter smooth location points by a recursion, which operate on 15 and 18.They are written as follows.
First, we make a prediction of time k + 1 through the state in time k as In time k + 1, 20 predict a priori state estimate X k + 1jk from the state X kjk and V k in time k.21 predict a priori estimate covariance P k + 1jk from the covariance P kjk in time k.
Second, we calculate the optimal Kalman gain as Finally, we update the states in time k + 1 as where z k is the observation state.Main states have been updated above from equations (25) and (26).The control vector V k + 1 is considered as velocity of TN, and it is changeable.We update it from two parameters: (1) new velocity calculated from distance moved and (2) offset at state X k from DRL algorithm.The equations are described as where a and b are weighting coefficients and O is the offset at coordinate Xk + 1jk + 1.What we should notice is that the interference occasionally might make the signals unreceived, which leads the interval time between k and k + 1 to be too long.We set a threshold L, and b to be 0 when the interval is beyond L.

Practice results and evaluation
We have applied the algorithm in WuHan metro construction for tracking workers and vehicles.The whole project consists of two parts in localization: (1) onedimensional localization in the tunnel and ( 2) twodimensional localization in the station.We just test the two-dimensional part in this article.TN and BN adopts the TI CC1101 as radio frequency (RF) chip, which work on the frequency of 433 MHz. Figure 8 shows some examples.The real localization environments are illustrated in Figure 9. Considering the low power and location accuracy, the TNs transmitted a signal per 0.8 s.In order to further extend the battery life of TNs, micro controller unit (MCU) uses internal digitally controlled oscillator (DCO) as the main clock, and RF unit will periodically wake up from sleep and listen for incoming packets without MCU interaction.Furthermore, DCO has a very low precision.This means that we cannot apply most of the anti-collision protocol.Therefore, packet loss may happen for collision occasionally.Instead of trying to smooth the noise from raw RSSI data completely like traditional filter, CFOTS start by analyzing target's movements and trying to obtain an approximation of the distance curve.As a comparison, mean filter (MF) is used to smooth raw data.In Figure 10(a), it can be seen that MF can improve the RSSI to a certain extent.Then we calculate the distance.The results, in Figure 10(b), show that it is worse than the distance curve filtered by CFOTS.Furthermore, after filtering the distance by CFOTS, we also tried to smooth it by MF.But the results improve very little.
We extracted some data from the project to test other localization algorithms.As a comparison, traditional maximum likelihood estimation (MLE) localization method based on trilateration is used.MLE is a very popular ''geometric mapping''-based algorithm, but it has poor performance based on the data.The main reason is that MLE was trying to calculate coordinates accurately on extreme unreliable RSSI data.As a comparison, Figure 11 shows the results by the MLE and DRL algorithm; in addition, KF is applied in both.Table 1 shows some key performance indicators.Obviously, the accuracy of track from the DRL is far higher than MLE.According to our statistics, the maximum error of DRL was limited to about 3:5 m, and the maximum error of MLE was beyond 17 m.Figure 11 also shows that the KF can smooth the track from rough and serrate parts.

Conclusion
At low power consumption and low cost, a new RSSIbased indoor localization and tracking algorithm has been proposed for harsh environments like construction.Although the popular fingerprints-based algorithm can obtain more accuracy, it cannot be applied for changeable environments.So we exploited geometric mapping-based algorithm by modifying trilateration.CFOTS is used to smooth the discrete distance points to a continuous curve.Moreover, it can make up the lost points from packet loss.DRL algorithm can estimate the continuous location curve.Then, the curve will be filtered by KF.The practice results prove that the accuracy can be limited to 3:5 m.It is acceptable for most construction environments.A major drawback of our localization system is that it will reduce the real time, which is caused by CFOTS.Although we can reduce its impact by increasing the RSSI sampling rate, it will shorten the lifetime of TNs' battery.Fortunately, the time delay can be accepted in the subway construction.CF is the main reason for reducing real time.
Therefore, future research will be focused on improving the CF algorithm or designing another real-time distance filter.

Declaration of conflicting interests
The author(s) declared no potential conflicts of interest with respect to the research, authorship, and/or publication of this article.

Figure 1 .Figure 2 .
Figure 1.BN deployed in part floor plan of the construction field.

Figure 3 .
Figure 3. Four curves of typical TN movement cases.

Figure 4 .
Figure 4. Comparison of real distance curve with raw distance curve and smoothed distance curve.

Figure 7 .
Figure 7. Coordinate offset distribution from DRL.(a) X-coordinate offset distribution from fusion, (b) Y-coordinate offset distribution from fusion, and (c) distance offset distribution from DRL.
Figure 9(a) shows part of the construction plan.The BNs are implemented in the station like Figure 9(b), and the distance between neighbor BNs was 25 m, errors were limited to within 2 m.

Figure 8 .
Figure 8. Product of TN and BN.(a) PCB of TN, (b) TN, and (c) BN.

Figure 9 .
Figure 9. Localization environment of metro construction in WuHan ChangQing Station.(a) System working on ChangQing Station in Wuhan metro construction, (b) station construction environment, and (c) tunnel construction environment.

Figure 10 .
Figure 10.MF and CFOTS algorithms are compared in the results of filtering raw RSSI and distance.(a) Raw RSSI data and smoothed by mean filter and (b) smoothed by CFOTS and mean filter.

Figure 11 .
Figure 11.The results of three localization in a real subway construction environment.

Table 1 .
The comparison of algorithms.
MLE: maximum likelihood estimation; CFOTS: curve fitting in a series of overlapping time slices; KF: Kalman filter; DRL: distance ratio location.