Low-Cost Indoor Localization System Combining Multilateration and Kalman Filter

Indoor localization systems play an important role to track objects during their life-cycle in indoor environments, e.g., related to retail, logistics and mobile robotics. These positioning systems use several techniques and technologies to estimate the position of each object, and face several requirements such as position accuracy, security, range of coverage, energy consumption and cost. This paper describes a practical implementation of a BLE (Bluetooth Low Energy) based localization system that combines multilateration and Kalman filter techniques to achieve a low cost solution, maintaining a good position accuracy. The proposed approach was experimentally tested in an indoor environment, with the achieved results showing a clear low cost system presenting an increase of the estimated position accuracy by 10% for an average error of 2.33 meters.


I. INTRODUCTION
Nowadays, the value of the data assumes a crucial role in the digital transition era, being noticed a huge amount of devices connected to Internet, aiming to exchange, share and store data, using Internet of Things (IoT) technologies. In fact, as estimated by Cisco, the number of connected objects to Internet exceeds 50 billion in 2020 [1]. The data collection is performed using a significant plethora of sensors that can make measurements in different types of variables, and uses IoT technologies to transmit data to Internet applications, usually forming wireless sensor networks (WSN) [2]. The collected data may be analysed through the use of Artificial Intelligence algorithms to extract knowledge, e.g., related to monitoring, diagnosis, prediction, optimization and planning, contributing to improve the systems' performance, decision-making tasks and people's life quality.
Several applications, e.g., logistics, retail and mobile robotics, require the access to information related to the localization of objects, e.g., materials, products, devices and people, demanding an association of the object position in the environment [3]. This localization process should consider the use of a variety of sensors to track the position of the objects and IoT technologies to transmit the acquired information to other devices and applications. In such systems, the localization accuracy depends on the application requirements, ranging from centimeters on game apps to meters for indoor geolocation [4]. The indoor positioning system (IPS) is a particular localization system where the aim is to localize objects or living beings inside an indoor environment. In such environments, the use of Global Positioning System (GPS) techniques can not be applied [5] since the satellites signal has a strong attenuation when crossing obstacles like walls, which are common in indoor environments. Additionally, these solutions present a high energy consumption and economic cost, as well as a weak accuracy, (usually presenting a position accuracy over 5 meters) [6].
An IPS consists in tracking an object inside a building by applying techniques for estimating its localization, mainly using Trilateration, Triangulation, Scene Analysis and Proximity methods [7], [8], providing a faster calculation of the position and intending to get a better accuracy. The implementation of an IPS faces some requirements and challenges, e.g., accuracy, range of coverage, security, availability, energy consumption and cost [7], [8]. However, indoor positioning systems are dependent of the application context and it is not mandatory to satisfy all of these requirements [8].
Having in mind to develop a low cost IPS solution while presenting low power consumption and good accuracy, this paper describes a Bluetooth Low Energy (BLE) based approach that combines Multilateration (MLT) and Kalman filter (KF) techniques to smooth the statistical noise and reduce the position error. This approach was experimentally implemented and tested in a laboratory facility consisting of an environment containing several obstacles such as walls, office desks, workbenches, partitions and robot stations. The obtained results are promising, with the low cost and low power consumption approach presenting a position error of less than 2.33 meters.
The rest of the paper is organized as follows: Section II presents the related works and Section III describes the proposed indoor positioning system model that combines Multilateration and Kalman Filter techniques. Section IV presents the experimental implementation and Section V discusses the achieved experimental results. Finally, Section VI rounds up the paper with the conclusions and points out the future work.

II. RELATED WORKS
The indoor positioning goal is to locate objects in an indoor environment, e.g., objects in a warehouse or people in a hospital. The environment is usually complex, being characterized by the existence of obstacles, floor layouts and reflections, etc, that can affect the transmission of the signal used to measure the object's position [9]. In these indoor environments, the traditional GPS systems do not have a good performance, e.g., due to existence of walls that strongly attenuates the signal [7], [10].
There are several techniques and models to estimate the location through information obtained from wireless communication technologies signals transmitted and received between the objects and the Access Points (APs). In such systems, several techniques can be used to calculate the distance of an object to an AP, namely the Angle of Arrival (AoA), Time of Arrival (ToA), Time Difference of Arrival (TDoA) and Received Signal Strength Indicator (RSSI) [9].
Systems that employ the AoA technique need to have an antenna array that detects the angle of arrival, and the receiver's position is estimated by using the triangulation method. However, the AoA method needs to have a complex hardware with a high accuracy in order to obtain a good estimation [7]. ToA is one of the most precise models and uses the time synchronism between the transmitter and the receiver. Using the transmission time, it is possible to calculate the distance [10], but the need to employ synchronism increases the implementation costs. TDoA is similar to ToA since it also requires a synchronous behavior between devices, but searches the absolute signal propagation time among multiple receiver's, being the distance computed through the time difference in each receiver [8]. The distance of an object to an AP can also be calculated according to the RSSI value, which is an indication of the power level being received by the antenna, being the most popular method since it does not require extra hardware or need to synchronize the devices [11]. This method is susceptible to environment's noise that affects the accuracy in the positioning system [6].
In order to locate a target inside the environment, several positioning methods can be used, namely Trilateration, Triangulation, Scene Analysis and Proximity [8]. These positioning methods are employed in combination with the distance calculation techniques, for example in the Scene Analysis method it is necessary to build a database containing a specific information (called fingerprint) about the environment, so the RSSI value can be used as information to build a signal map of the scenario.
In terms of connection between the objects and APs, several wireless technologies can be used such as WiFi, Radio Frequency Identification (RFID), Ultra Wide Band (UWB) and Bluetooth Low Energy (BLE) [9]. Nevertheless, each technology has advantages and drawbacks in the localization process, e.g., WiFi is the simplest option since it does not need an extra hardware for the localization system due to wide availability of APs inside buildings. However, the WiFi's APs are employed to maximize the signal transmission and not for indoor location [6]. Moreover, it presents a higher energy consumption which is not recommended in localization systems [12]. Among the wireless technologies, BLE is a suitable and attractive approach for positioning applications due to its beaconing mechanism, low power consumption and affordability [10].
Aiming at a wide adoption, it is desirable that a localization system is available to the users, cost efficient, little energy consumption, wide reception range, high accuracy, low delay and good scalability [8]. Nevertheless, a system can have a good acceptance while not satisfying all of these factors, depending on the application context.
In order to improve the system accuracy some alternatives can be employed such as Probabilistics Methods (e.g., Kalman Filtering and Bayesian Filtering), Artificial Neural Network (ANN) and Machine Learning (e.g., Support Vector Machine and Particle Swarm Optimization). As example, an indoor localization simulation based on BLE using a hybrid approach that combines the Fingerprint (FP) and MLT techniques was proposed in [13]. An uniform motion is assumed and the lowest error achieved is 2.46 m when considering 5 APs in an environment of (60 × 40) m [13].
A BLE approach that weights the Trilateration with a Kalman filter combined with Channel Diversity is proposed in [14]. The lowest achieved error is 1.82 m for a moving device and 0.7 m for static devices in a room of approximately (6.2 × 8.7) m [14]. Other example is related to an adaptive multilateration BLE-based method that presented an error of 3.02 m in a (32.5 × 19.2) m environment [15]. In [10] the fingerprinting technique is employed using WiFi, which leaded to an error of 8.5 m whilst with BLE the error was decreased to 2.6 m in 95% of the time in a (45 × 12) m environment [10]. In [16] BLE and WiFi were aggregated, and the error is lower than 3.58 m in 90% of the time for a (40 × 8) m environment [16].
These solutions are based on commercial beacons device and the majority of them used a high density of devices in the environment to improve the precision, which increases the implementation costs. Furthermore, the implementations based on WiFi have a high power consumption due to the high scan time of this technology decreasing the battery lifetime. The majority of the proposals are based on the RSSI technique and even though investing on good devices, the signal will be affected by environment interference and phenomena that compromises the precision, namely the fast fading, that sometimes causes missing of data packets that can be solved by using time based solutions like ToA. Moreover, it is required to calibrate correctly the system and choose the best configuration parameters when working with the signal strength. However, RSSI solutions do not need to deal with synchronism and extra hardware, which increase their availability and decrease the device cost.

III. POSITION ESTIMATION MODEL
The proposed model for a low-cost and low power consumption estimation of the object's localization in indoor environments, ensuring a low position error, is illustrated Figure 1.  The proposed model considers the presence of receivers, i.e. APs, and a transmitter, i.e. a target node (TN), that interact with each other using BLE. Aiming to estimate the position of the TN, the transmitter sends the signal to the APs in order to track its position.
The determination of the object localization uses a fusion of three methods: the path loss model that is responsible to calculate the distance through the RSSI values, the multilateration localization technique that estimates the position aiming to minimize the error between the real position and the estimation, and the Kalman filter that intends to improve the estimation accuracy, and consequently minimizing the position error.

A. Distance Calculation
Being the TN the transmitter that is being tracked, it periodically broadcasts a beacon signal, which is subjected to phenomena such as path-loss, shadowing and fading. After reading the signal values, a filter using the standard deviation was applied aiming to smooth the readings. To mitigate the fast fading effect, the considered RSSI is an average of 1000 readings [10]. The distance between each AP and the target node is calculated through the log-normal propagation model as [13]: where the d n is the distance between the AP n and the TN, the RSSI n,d0 is the RSSI value (in dBm) at AP n when the target is at a reference distance d 0 , and the parameter α is the path loss exponent. This parameter varies according to the scenario [17].

B. Position Estimation
The Multilateration is a technique that estimates the position based on the distance measurements when the number of the non-collinear APs is greater than or equal to three (i.e. N ≥ 3). The distance between the AP n and the TN, which has coordinates (x, y), is calculated through d n = (x − x n ) 2 + (y − y n ) 2 . From the equation (1), assumingd n d n , squaring and subtracting the AP N distance equation and the equation of a generic point n which 1 ≤ n ≤ N , obtained a function of x and y as illustrated in equation (2) [18]: where the N equations are represented via b = Ap, with p being the coordinate vector. As {d n } N n=1 is subject to errors because of the shadowing effect, a least-square estimate for p is obtained asp M LT =p = (A T A) −1 A T b [13]. The coordinates are the result of the minimization of The multilateration technique was selected since it does not require signal map and a database as the fingerprint technique. Furthermore, it does not need an external hardware or synchronism mechanism, reducing the cost and power consumption.

C. Improving Accuracy
The third step of the proposed model aims at reducing the noise in order to improve the position accuracy. The Kalman filter is a statistics method that was selected due to its ability to reduce the overall uncertainty. It employs a series of measurements observed over time, containing a statistical noise and produces estimations that tend to be more accurate by the fact of taking into account the past states and the covariance error. Furthermore, the Kalman filter is usually employed in navigation and trajectory optimization applications.
In this way, the estimated positionp from the multilateration stage is used as an input to the Kalman filter that considers an uniformly variable movement model to smooth the random behavior on the RSSI measures and consequently improves the accuracy. The uniformly variable movement model assumes that the TN moves in the environment with a constant acceleration in both axis, so the velocity varies linearly and the position has a quadratic pattern. Thus, the state vector x k is defined as a vector containing the true values of the state variables at the moment k, as represented in equation (3) [14]: where x(k), y(k),ẋ(k),ẏ(k),ẍ(k),ÿ(k) are respectively the location coordinates, velocity and acceleration in x and y directions. The measurement function is governed by the linear stochastic difference equation [19]: where H k ∈ R 2×6 is the measurement model that is related to the state with the estimation and v k ∈ R 2×1 ∼ N (0, R) represents the measurement noise, being R ∈ R 2×2 the covariance matrix. The Kalman filter estimates a process using the feedback control, where the filter estimates the process state in a moment, getting the feedback through the measurements [19]. The Kalman filter process can be separated in two groups, namely the time update (which is responsible for the prediction) and measurement update (i.e. related to the correction or maintenance) [20] as presented in Figure 2.

1) Time update:
The state variables from equation (3) are updated projecting forward the current state and estimating the error covariance to obtain the next state [19], [20]. In this model,x − k+1 is the a priori estimation at the moment k + 1, given the a posteriori estimation at the moment k, A k ∈ R 6×6 is the state transition model following the uniformly variable movement (relating to states k and k + 1), P − k+1 ∈ R 6×6 is a priori error covariance matrix that collects the deviation in the estimations at the instant k + 1 given the posteriori error covariance matrix at the instant k, Q k ∈ R 6×6 is the covariance matrix of the transition model.
2) Measurement update: This stage adjusts the prediction projected via the measurement at the current moment, that is a combination from the prediction and observation in order to refine the estimation [19], [20]. In this model, K k ∈ R 6×2 is the Kalman Gain that is responsible to adjust the balance between the prediction and the current measurement,x k represents a posteriori state estimation given the measurements up to time k, z k ∈ R 2×1 is the real measurement at moment k and P k is the a posteriori error covariance matrix at moment k.

IV. EXPERIMENTAL IMPLEMENTATION
The proposed indoor position system was implemented and experimentally tested in a laboratory facility that hosts the development of R&D activities, aiming at estimating the position of static objects. This environment, illustrated in Figure 3, comprises walls, tables, office desks, partitions, a high number of people circulating, workbenches and robot stations, making an environment with many obstacles and distinct objects that may interfere with the signal transmission. In this experimental testing system, the target is a transmitter which sends BLE advertisements acting as a BLE beacon device. Five APs were located in the environment, acting as receivers, each one implemented in a Raspberry Pi (RPi) that is listening the BLE advertisements sent by the TN.
The BLE device is an ESP32, that is a low cost and low power consumption computational platform. For this purpose, the board was configured in a non-connectable mode just to transmit the data packets. For each time interval (i.e., the configurable time between advertisements), this device transmits sequentially the beacon messages (non-connectable advertisements), originally through three channels (37, 38 and 39). In this implementation, the messages are posted using a single channel due to the BLE's characteristics that occupies the same bandwidth of WiFi (i.e. 2.4 GHz), which causes interference. Thus, the adopted solution sends the beacons through channel 39 since its central frequency is not affected by the WiFi channels [10] as presented in Figure 4.
Regarding the receivers, the APs are placed in positions that have the maximum signal comprehension inside the room environment and easy access to electrical outlets. Four APs were fixed in the bounds of the environment and one AP was fixed near the middle of the laboratory space (all of them placed approximately at the same height). The coordinates of these APs are illustrated in Table I.
Each RPi representing the receivers have been programmed using the Python language, mainly related to the scheduling scripts via CRON in order to evaluate the signal strength variation along the day. It was chosen to perform measurements at three different times of the day, namely 10:00 AM, 3:00 PM and 11:00 PM, being possible to analyze the variation of RSSI Figure 4: 40 BLE channels and the three commonly WiFi channels that cause interference. The BLE advertising only occurs on channels 37, 38 and 39. Adapted from [10]. values acquired from the target in several situations, such as when there were high people circulation in the laboratory and at the end of the day with a lower number of people, with each position being measured for three consecutive days.
In terms of the measurements, the APs scanned the ESP32 transmitter through the MAC address setting a window interval of 100 ms similar to the advertisement interval in order to avoid missing packets. In order to compute the distance between each AP and the TN through the RSSI read values, it is necessary to proceed initially with a calibration of the signal strength at 1 m from each AP. For this purpose, it was measured and calculated the average value, determining the RSSI n,d0 parameter used in the path loss model equation (1) as presented in Table II. For each static test position, after calibrating the RSSI n,d0 and collecting the target's position data, it was also calculated the average value from the 1, 000 packets to mitigate the effects of fast fading as described in [10]. In order to estimate the position, the system parameters presented in Table II were adopted following the literature [8], [17]. After collecting the RSSI values, a statistical filter is applied over these measurements, which filters 5% of them using two standard deviations to mitigate the fast fading, and allowing to estimate the positions through multilateration. From the calculated positions, it was obtained the covariance for both coordinates (x and y) and experimented some Q k and P k values aiming at tuning the Kalman filter resulting the best adjustment in all testing positions. This process contributes to improve the system accuracy and smoothing the statistical noise. Figure 5 shows an example of filtering the RSSI raw values, illustrating the signal strength (in dBm) by the number of samples. The filtered value affects the multilateration and Kalman filtering stages, consequently directly the estimation and the accuracy of the position.

V. ANALYSIS OF EXPERIMENTAL RESULTS
The experimental tests considered an offline framework containing five target points that allowed to test and evaluate the system performance (the coordinates of these points are illustrated in Table I). Although, the developed system can work with an online framework in a similar or in a different testbed. Table III summarizes the results for the position error comparing the MLT technique applied standalone and the proposed "MLT+KF" approach that considers the Kalman filter stage to improve the accuracy and smoothing the statistical noise of the measurements. In the Kalman filter tuning, the covariance on the both axis (x and y) are calculated resulting in R K and the parameters Q k = 0.1 × I, P k = 10 × I and dt = 0.1s are resorted, being these parameters the same for all of the test points. Briefly, the achieved results show that the proposed approach presents an improvement of approximately 10% in terms of position error. In terms of accuracy, when employed this approach, the maximum error is maintained below 3 m while using the multilateration standalone the maximum error can reach 3.27 m as presented in Table III. The proposed system obtained an average error value of 2.33 m.
In terms of power consumption, the use of BLE for the signal transmission ensures a power consumption of approximately 0.367 mW according to [6], which considered tested devices with a transmitted power of -10 dBm and a transmission interval of 0.5 s. Moreover, the developed IPS is a lowcost solution because it employs the ESP32 as beacons, that costs approximately 10 C while a commercial beacon device, e.g., the iBKS 105, costs approximately 20 C.
Comparing with the solutions described in [13], [14], the proposed approach was based on the [13] simulation results and reached a position accuracy that is 5.28% less than their solution. On the other hand, [13] proposed for a bigger environment. However, comparing with the approach described in [14], our results are approximately 70% greater than they reached, although [14] employed a solution in a smaller scenario than the environment considered in this work and has applied a method that considers the diversity of BLE channels.

VI. CONCLUSION AND FUTURE WORK
The IPS aims to locate an object inside a building, with the solutions being usually based on applying techniques to calculate the distance between the object and several APs, combined with optimization algorithms that allow a faster positioning estimation and improve the accurate system. The main challenges addressed in this field are related to combine low cost implementations with low energy consumption and good position accuracy. This paper describes a low cost and low power consumption indoor positioning system, that combines the use of multilateration RSSI based-technique and the Kalman filter in a BLE beaconing scenario. The proposed approach was implemented in an indoor environment comprising significant radio interferences due to the physical structure (walls, office desks and workbenches) and circulation of people.
The achieved experimental results showed an improvement of the position estimation accuracy combining the two methods when compared with the use of multilateration standalone, reaching an average error of 2.33 m (corresponding to an improvement of 10%). Moreover, the proposed IPS is a low-cost BLE-based solution, with the beacon device being performed with an ESP32.
Future work will be devoted to use other techniques, namely Fingerprinting, to implement a fusion with MLT through trackto-track fusion and Kalman Filtering, proposing a hybrid indoor positioning system which will get the estimation from both techniques and merge to produce a third estimation providing a better accuracy. Moreover, new test scenarios will be employed as tracking a moving target node, e.g., a mobile and autonomous robot, in order to evaluate the system performance in a dynamic situation.