# Lora RTT Ranging Characterization and Indoor Positioning System

Authors: Qiang Liu; XiuJun Bai; Xingli Gan; Shan Yang
Journal: Wireless Communications and Mobile Computing
 (2021)

---

## Abstract

In recent years, indoor positioning systems (IPS) are increasingly very important for a smart factory, and the Lora positioning system based on round-trip time (RTT) has been developed. This paper introduces the ranging characterization, RTT measurement, and position estimation method. In particular, a particle filter localization method-aided Lora pseudorange fitting correction is designed to solve the problem of indoor positioning; the cumulative distribution function (CDF) criteria are used to measure the quality of the estimated location in comparison to the ground truth location; when the positioning error on thex-axis threshold is 0.2 m and 0.6 m, the CDF with pseudorange correction is 61% and 99%, which are higher than the 32% and 85% without pseudorange correction. When the positioning error on the y-axis threshold is 0.2 m and 0.6 m, the CDF with pseudorange correction is 71% and 99.9%, which are higher than the 52% and 94.8% without pseudorange correction.


---

## Body

## 1. Introduction

Indoor positioning systems are increasingly very important for a smart factory, such as finding the location of workers, goods, or vehicles [1–4]. However, the Global Positioning System (GPS) is unable to provide the indoor positioning service, which is commonly used for outdoor positioning. The research on indoor positioning technologies has been conducted for more than three decades, such as Radio Frequency Identification (RFID) [5, 6], WiFi [7, 8], Ultra Wide Band (UWB) [9–11], Pseudolite [12–14], Bluetooth [15], and Inertial Navigation System (INS), but they may not be suitable for Internet of Things (IoT) applications in terms of cost, application mode, and terminal power consumption.With the continuous progress of sensor and Internet of Things [16, 17] technologies, increasing attention has been paid to IPS using Lora WAN. Semtech has developed a Lora positioning system based on round-trip time [18], which is called the SX1280 transceiver. The SX1280 transceiver family provides ultra-long-range communication in the 2.4 GHz band with a time-of-flight functionality; its radio is fully compliant with all worldwide 2.4 GHz radio regulations including EN 300440, FCC CFR 47 Part 15 [19], and the Japanese ARIB STD-T66 [20]. Very small wearable products to track and localize assets in logistic chains and people for safety can easily be designed thanks to the high level of integration and the ultralow current consumption which allows the use of miniaturized batteries.But the most difficult challenge for Lora indoor positioning is the ranging error caused by multipath in the indoor environment. Liang et al. carry out the study focused on the indoor propagation of the Lora signal, and the main contribution of this work is to measure the round-trip time and packet delivery ratio by changing send power, payload length, and air rate in a multilevel building from the 1st floor to the 12th floor [21]. Huynh and Brennan verify the UWB transmission characteristics of an indoor RTT signal by generating synthetic received signals using ray tracing plus Rayleigh distributed random multipath clusters as well as random amplitude and delay factors [22]. Staniec and Kowal describe outcomes of measurement campaigns during which the Lora performance was tested against a heavy multipath propagation and a controlled [23], Lora configurational space is divided into three distinct sensitivity regions: in the white region, it is immune to both interference and multipath propagation; in the light-grey region, it is only immune to the multipath phenomenon but sensitive to interference; and in the dark grey region, Lora is vulnerable to both phenomena.On the other hand, location based on a filtering algorithm is the only effective solution currently known, and the Bayesian filtering algorithm occupies an important role. In the early days, the Kalman filter positioning algorithm is mainly used to solve the problem achieving efficient state estimation for linear Gaussian systems [24]. Moreover, to deal with unwanted errors and nonlinear distortions, particle filter (PF) is applied as a nonparametric filter to location, which is recursive implementations of Monte Carlo-based statistical processing [25–27] and performs well in localization efficiency, stability, and accuracy.In the following sections, a Lora indoor positioning system is introduced, which overcomes the problem of long distance, low power consumption, and low cost. The main contributions and research content of this paper are as follows: Firstly, a Lora-aided particle filter localization method is designed to solve the problem of indoor positioning. Secondly, numerous experiments were carried out with real Lora RTT measurement data to evaluate the performance of the proposed approach; we used the CDF criteria to measure the quality of the estimated location in comparison to the ground truth location. The results show that the indoor positioning accuracy is improved obviously with the help of the piecewise fitting correction method. At the same time, the Lora indoor positioning system can achieve a positioning accuracy of 1 m under the condition of LOS.


## 2. Background and Related Work

### 2.1. Lora RTT Measurement

In this paper, we focus on one of the latest techniques called the RTT scheme-based ranging and localization [28–30], which can give accurate measurements by the time stamp from the initiator (Lora_A) to the responder (Lora_B) with nanosecond resolution. Figure 1 shows the RTT measurement illustration; the pseudorange measurement can be built as
(1)ρAB=RAB+tr_A−ts_B,(2)ρBA=RBA+tr_B−ts_A,where ρAB or ρBA is the pseudorange measurement between Lora_A and Lora_B, RAB or RBA is the geometric range between Lora_A and Lora_B, tr_A is the clock offset of Lora_A at the receiving time, ts_A is the clock offset of Lora_A at the transmitting time, tr_B is the clock offset of Lora_B at the receiving time, and ts_B is the clock offset of Lora_B at the transmitting time.Figure 1
RTT measurement illustration.If the clock characteristics of Lora_A and Lora_B are stable, tr_A=ts_A and tr_B=ts_B at the adjacent time of receiving and transmitting. The time-of-flight (ToF) measurements can be written as
(3)Tround=ρAB+Treply+ρBA=RAB+RBA+tr_B−ts_A+tr_A−ts_B+Treply=RAB+RBA+Treply,where Tround is the time-of-flight (ToF) measurements of Lora_A from Tx_A to Rx_A, Treply is the time difference of Lora_B between Rx_B and Tx_B.The geometric distance can be calculated by(4)RAB=Tround‐Treply2.The pseudorange measurement can be built as(5)RAB=Tround‐Treply2=xA−xB2+yA−yB2+zA−zB2+ε,where xA, yA, and zA are the transmitting antenna coordinates of Lora_A; xB, yB, and zB are the transmitting antenna coordinates of Lora_B; and ε is measurement error.


### 2.2. Position Estimation

Four distance measurements of Lora transceivers whose positions are known are used to determine the three-dimensional coordinates of an unknown position [31], as shown in Figure 2. The position of user (xu,yu,zu) can be calculated by
(6)R1u=x1−xu2+y1−yu2+z1−zu2+ε1u,R2u=x2−xu2+y2−yu2+z2−zu2+ε2u,R3u=x3−xu2+y3−yu2+z3−zu2+ε3u,R4u=x4−xu2+y4−yu2+z4−zu2+ε4u,where Riu is the pseudorange measurement of APi, i is the AP index, and u is the user index, (xi,yi,zi) are the locations of APi, and εiu is the measurement error of APi.Figure 2
Position estimation by four distance measurements.The geometric distance can be calculated by(7)Riu=xu−xixu+yu−yiyu+zu−zizuxi−xu2+yi−yu2+zi−zu2+εiu=exi,eyi,ezixuyuzu+εiu,where exi,eyi,ezi is called a geometry matrix.The observation equations of Lora RTT can be expressed as the following matrix form:(8)R1uR2u⋮R4u=ex1ex2ex3ex4ey1ey2ey3ey4ez1ez2ez3ez4xuyuzu+ε1uε2u⋮ε4u.The matrix on the right-hand side of Equation (8) is defined as A and ε, and the two-column vectors on the left-hand side are defined as b. Equation (8) can be written as
(9)b=AX+ε.If an initial valueX0 is used for the solution-updating process, the Newton-Raphson method is described asX0=xu,0,yu,0,zu,0. The least-squares updated solution can be represented as
(10)ΔX=ATA−1ATb+ε.Then, the positionX1 can be updated iteratively according to
(11)X1=X0+ΔX.It should be noted that the measurement error is considered Gaussian white noise, when using the least-squares method.


## 2.1. Lora RTT Measurement

In this paper, we focus on one of the latest techniques called the RTT scheme-based ranging and localization [28–30], which can give accurate measurements by the time stamp from the initiator (Lora_A) to the responder (Lora_B) with nanosecond resolution. Figure 1 shows the RTT measurement illustration; the pseudorange measurement can be built as
(1)ρAB=RAB+tr_A−ts_B,(2)ρBA=RBA+tr_B−ts_A,where ρAB or ρBA is the pseudorange measurement between Lora_A and Lora_B, RAB or RBA is the geometric range between Lora_A and Lora_B, tr_A is the clock offset of Lora_A at the receiving time, ts_A is the clock offset of Lora_A at the transmitting time, tr_B is the clock offset of Lora_B at the receiving time, and ts_B is the clock offset of Lora_B at the transmitting time.Figure 1
RTT measurement illustration.If the clock characteristics of Lora_A and Lora_B are stable, tr_A=ts_A and tr_B=ts_B at the adjacent time of receiving and transmitting. The time-of-flight (ToF) measurements can be written as
(3)Tround=ρAB+Treply+ρBA=RAB+RBA+tr_B−ts_A+tr_A−ts_B+Treply=RAB+RBA+Treply,where Tround is the time-of-flight (ToF) measurements of Lora_A from Tx_A to Rx_A, Treply is the time difference of Lora_B between Rx_B and Tx_B.The geometric distance can be calculated by(4)RAB=Tround‐Treply2.The pseudorange measurement can be built as(5)RAB=Tround‐Treply2=xA−xB2+yA−yB2+zA−zB2+ε,where xA, yA, and zA are the transmitting antenna coordinates of Lora_A; xB, yB, and zB are the transmitting antenna coordinates of Lora_B; and ε is measurement error.


## 2.2. Position Estimation

Four distance measurements of Lora transceivers whose positions are known are used to determine the three-dimensional coordinates of an unknown position [31], as shown in Figure 2. The position of user (xu,yu,zu) can be calculated by
(6)R1u=x1−xu2+y1−yu2+z1−zu2+ε1u,R2u=x2−xu2+y2−yu2+z2−zu2+ε2u,R3u=x3−xu2+y3−yu2+z3−zu2+ε3u,R4u=x4−xu2+y4−yu2+z4−zu2+ε4u,where Riu is the pseudorange measurement of APi, i is the AP index, and u is the user index, (xi,yi,zi) are the locations of APi, and εiu is the measurement error of APi.Figure 2
Position estimation by four distance measurements.The geometric distance can be calculated by(7)Riu=xu−xixu+yu−yiyu+zu−zizuxi−xu2+yi−yu2+zi−zu2+εiu=exi,eyi,ezixuyuzu+εiu,where exi,eyi,ezi is called a geometry matrix.The observation equations of Lora RTT can be expressed as the following matrix form:(8)R1uR2u⋮R4u=ex1ex2ex3ex4ey1ey2ey3ey4ez1ez2ez3ez4xuyuzu+ε1uε2u⋮ε4u.The matrix on the right-hand side of Equation (8) is defined as A and ε, and the two-column vectors on the left-hand side are defined as b. Equation (8) can be written as
(9)b=AX+ε.If an initial valueX0 is used for the solution-updating process, the Newton-Raphson method is described asX0=xu,0,yu,0,zu,0. The least-squares updated solution can be represented as
(10)ΔX=ATA−1ATb+ε.Then, the positionX1 can be updated iteratively according to
(11)X1=X0+ΔX.It should be noted that the measurement error is considered Gaussian white noise, when using the least-squares method.


## 3. Ranging Characterization of Lora

### 3.1. Clock Error

It is supposed that the clock offsets of devices Lora_A and Lora_B are εA and εB; therefore, the ranging error will increase with the increase of flight time. The equation of ranging error is as follows:
(12)εt=εA−εB2×Treply+RAB,where εt is ranging error caused by the clock offsets.If the clock error of Lora_A and Lora_B is the same, Equation (12) can be written as
(13)εt=εA×Treply+RAB.It is supposed that the distance between the two Lora nodes is between 10 meters and 5000 meters; then,RAB is from 3 ns to 1500 ns. The clock error of packaged crystal oscillator (PCO) is generally more than 25 ppm, the temperature compensated crystal oscillator (TCXO) is from 0.5 ppm to 5 ppm, and the oven-controlled crystal oscillator (OCXO) may be less than 0.1 ppm. According to the above parameters, we estimate the influence of clock error on Lora ranging accuracy, as shown in Table 1. It can be found that TCXO and OCXO are best used as the clock of the Lora positioning system.Table 1
Relationship between ranging error, clock error, and flight time.
Clock errorTreply+RAB0.1 ppm0.5 ppm5 ppm25 ppm1.5μs1.5×10−4ns7.5×10−4ns7.5×10−3ns3.75×10−2ns10μs1.5×10−3ns7.5×10−3ns7.5×10−2ns3.75×10−1ns100μs1.5×10−2ns7.5×10−2ns7.5×10−1ns3.75ns1000μs1.5×10−1ns7.5×10−1ns7.5ns37.5ns10000μs1.5ns7.5ns75ns375ns


### 3.2. Ranging Accuracy and Characterization

The reflection of the indoor environment to the Lora positioning signal is very serious, for example, irregular room structure, walking people, tables and chairs, and glass. Because of signal interference and multipath effect, Lora’s ranging error may be non-Gaussian distribution. We collect the ranging data of Lora under different conditions such as line-of-sight (LOS), non-line-of-sight (NLOS), and human occlusion, which is compared with the real distance to analyze the ranging characterization.Three sets of ranging data are collected under the LOS condition; the ranging error of Lora is shown in Figure3. The average error is -0.61 m, the maximum error is 1.2 m, and the minimum error is -5.24 m. It can be found that the ranging error of LOS has a linear trend, which can be corrected by the polynomial fitting method.Figure 3
Ranging error under LOS.Similarly, three sets of ranging data are collected under the NLOS condition, such as using people’s bodies to block Lora’s antenna; the ranging error of Lora is shown in Figure4. The average error is -0.01 m, the maximum error is 8.6 m, and the minimum error is -3.32 m. It can be found that the ranging error of NLOS is much worse than that of LOS; therefore, it is better to use the Lora indoor positioning system under the condition of LOS.Figure 4
Ranging error under NLOS.In order to analyze the distribution characteristics of Lora ranging error, the six groups of data collected above are combined, as shown in Figure5. Figure 5(a) shows the histogram with a distribution fit, and Figure 5(b) is the normal probability plot. It can be concluded that the probability distribution of Lora ranging error is non-Gaussian white noise. Therefore, it is necessary to use nonlinear filter to solve the location problem.Figure 5
Probability characterization: (a) histogram with a distribution fit and (b) normal probability plot.
(a)(b)The piecewise fitting correction method of LOS is used to correct the Lora ranging value, as shown in Figure6. The formula of the piecewise fitting correction method can be expressed as
(14)R⌢=R+fR,(15)fR=a10+a11×R,0≤R≤r1,a20+a21×R,r1<R≤r2,⋮am0+am1×R,rm−1<R≤rm,where R is the pseudorange measurement of Lora, R⌢ is the corrected pseudorange, fR is the correction function, a10 and a11 are the linear correction factors, and rm−1 and rm are the stages; the above data of LOS are divided into three sections; that is, m=3.Figure 6
Piecewise linear fitting correction.


### 3.3. Geometry Factor

The dilution of geometry precision (GDOP) [32, 33] can be expressed as
(16)covΔX=σε2⋅ATA−1.IfATA−1 is defined as H, the diagonal elements of H are as follows:
(17)H=xDOP2yDOP2zDOP2.HDOP and GDOP can be defined as
(18)HDOP=xDOP2+yDOP2,(19)GDOP=xDOP2+yDOP2+zDOP2,where xDOP2 means the dilution of precision (DOP) for the x-coordinate and yDOP2 means the DOP for the y-coordinate.In order to analyze the influence of the geometry factor on Lora positioning performance, a simulation of geometry distribution is designed, which is composed of four Lora transceivers. Suppose the length and width of the room are 40 meters and the height is 3 meters, as shown in Figure7. The HDOP of the indoor positioning system is given in Figures 8(a) and 9(a); the GDOP of the indoor positioning system is given in Figures 8(b) and 9(b). The results show that four Lora transceivers can obtain the suitable geometric distribution in their projection area, whoseHDOP and GDOP are less than 1.2. However, outside the projection area, the geometric distribution will deteriorate; HDOP and GDOP will be greater than 2, which will make the positioning error more than twice of the ranging error.Figure 7
Simulation conditions of geometry distribution.Figure 8
Indoor positioning system composed of four Lora transceivers: (a)HDOP and (b) GDOP in the projection area.
(a)(b)Figure 9
Indoor positioning system composed of four Lora transceivers: (a)HDOP and (b) GDOP outside the projection area.
(a)(b)


## 3.1. Clock Error

It is supposed that the clock offsets of devices Lora_A and Lora_B are εA and εB; therefore, the ranging error will increase with the increase of flight time. The equation of ranging error is as follows:
(12)εt=εA−εB2×Treply+RAB,where εt is ranging error caused by the clock offsets.If the clock error of Lora_A and Lora_B is the same, Equation (12) can be written as
(13)εt=εA×Treply+RAB.It is supposed that the distance between the two Lora nodes is between 10 meters and 5000 meters; then,RAB is from 3 ns to 1500 ns. The clock error of packaged crystal oscillator (PCO) is generally more than 25 ppm, the temperature compensated crystal oscillator (TCXO) is from 0.5 ppm to 5 ppm, and the oven-controlled crystal oscillator (OCXO) may be less than 0.1 ppm. According to the above parameters, we estimate the influence of clock error on Lora ranging accuracy, as shown in Table 1. It can be found that TCXO and OCXO are best used as the clock of the Lora positioning system.Table 1
Relationship between ranging error, clock error, and flight time.
Clock errorTreply+RAB0.1 ppm0.5 ppm5 ppm25 ppm1.5μs1.5×10−4ns7.5×10−4ns7.5×10−3ns3.75×10−2ns10μs1.5×10−3ns7.5×10−3ns7.5×10−2ns3.75×10−1ns100μs1.5×10−2ns7.5×10−2ns7.5×10−1ns3.75ns1000μs1.5×10−1ns7.5×10−1ns7.5ns37.5ns10000μs1.5ns7.5ns75ns375ns


## 3.2. Ranging Accuracy and Characterization

The reflection of the indoor environment to the Lora positioning signal is very serious, for example, irregular room structure, walking people, tables and chairs, and glass. Because of signal interference and multipath effect, Lora’s ranging error may be non-Gaussian distribution. We collect the ranging data of Lora under different conditions such as line-of-sight (LOS), non-line-of-sight (NLOS), and human occlusion, which is compared with the real distance to analyze the ranging characterization.Three sets of ranging data are collected under the LOS condition; the ranging error of Lora is shown in Figure3. The average error is -0.61 m, the maximum error is 1.2 m, and the minimum error is -5.24 m. It can be found that the ranging error of LOS has a linear trend, which can be corrected by the polynomial fitting method.Figure 3
Ranging error under LOS.Similarly, three sets of ranging data are collected under the NLOS condition, such as using people’s bodies to block Lora’s antenna; the ranging error of Lora is shown in Figure4. The average error is -0.01 m, the maximum error is 8.6 m, and the minimum error is -3.32 m. It can be found that the ranging error of NLOS is much worse than that of LOS; therefore, it is better to use the Lora indoor positioning system under the condition of LOS.Figure 4
Ranging error under NLOS.In order to analyze the distribution characteristics of Lora ranging error, the six groups of data collected above are combined, as shown in Figure5. Figure 5(a) shows the histogram with a distribution fit, and Figure 5(b) is the normal probability plot. It can be concluded that the probability distribution of Lora ranging error is non-Gaussian white noise. Therefore, it is necessary to use nonlinear filter to solve the location problem.Figure 5
Probability characterization: (a) histogram with a distribution fit and (b) normal probability plot.
(a)(b)The piecewise fitting correction method of LOS is used to correct the Lora ranging value, as shown in Figure6. The formula of the piecewise fitting correction method can be expressed as
(14)R⌢=R+fR,(15)fR=a10+a11×R,0≤R≤r1,a20+a21×R,r1<R≤r2,⋮am0+am1×R,rm−1<R≤rm,where R is the pseudorange measurement of Lora, R⌢ is the corrected pseudorange, fR is the correction function, a10 and a11 are the linear correction factors, and rm−1 and rm are the stages; the above data of LOS are divided into three sections; that is, m=3.Figure 6
Piecewise linear fitting correction.


## 3.3. Geometry Factor

The dilution of geometry precision (GDOP) [32, 33] can be expressed as
(16)covΔX=σε2⋅ATA−1.IfATA−1 is defined as H, the diagonal elements of H are as follows:
(17)H=xDOP2yDOP2zDOP2.HDOP and GDOP can be defined as
(18)HDOP=xDOP2+yDOP2,(19)GDOP=xDOP2+yDOP2+zDOP2,where xDOP2 means the dilution of precision (DOP) for the x-coordinate and yDOP2 means the DOP for the y-coordinate.In order to analyze the influence of the geometry factor on Lora positioning performance, a simulation of geometry distribution is designed, which is composed of four Lora transceivers. Suppose the length and width of the room are 40 meters and the height is 3 meters, as shown in Figure7. The HDOP of the indoor positioning system is given in Figures 8(a) and 9(a); the GDOP of the indoor positioning system is given in Figures 8(b) and 9(b). The results show that four Lora transceivers can obtain the suitable geometric distribution in their projection area, whoseHDOP and GDOP are less than 1.2. However, outside the projection area, the geometric distribution will deteriorate; HDOP and GDOP will be greater than 2, which will make the positioning error more than twice of the ranging error.Figure 7
Simulation conditions of geometry distribution.Figure 8
Indoor positioning system composed of four Lora transceivers: (a)HDOP and (b) GDOP in the projection area.
(a)(b)Figure 9
Indoor positioning system composed of four Lora transceivers: (a)HDOP and (b) GDOP outside the projection area.
(a)(b)


## 4. Methodology Based on Particle Filter

### 4.1. Recursive Bayesian Estimation

Applied nonlinear filtering is based on discrete-time nonlinear state-space models relating a hidden stateXt to the observations Yt, denote the observations at time t by Yt=y0,⋯,yt, the Bayesian solution to compute the posterior distribution is given by
(20)pXtYt−1=∫pXtXt−1pXt−1Yt−1dXt−1,pXtYt=pyt/XtpXt/Yt−1pyt/Yt−1,where t is the time stamp, xt is the state variable, pXt‐1/Yt‐1 is the posterior probability distribution of the last moment, pXt/Xt‐1 is the state transition probability, pXt/Yt‐1 is the prior probability distribution, pyt/Xt is the likelihood function, and pyt/Yt−1 is the normalization function.


### 4.2. Particle Filter

Supposed thatN particles Xti,wtii=1N from the posterior probability pXt/Yt of the state can be extracted, where Xti is the state of the particle, wti is the weight of the particle; then,
(21)pXtYt≈∑i=1NwtiδXt−Xti,where δ is the Dirac delta function and N is the number of particles.The Sequential Importance Sampling (SIS) method is used to calculate the weight of particles, which is written as(22)wti=wt−1ipYt/XtipXti/Xt−1iqXti/Xt−1i,Yt.The prior probability distribution is used as the importance density function:(23)qXtiXt−1i,Yt=pXtiXt−1i.Then, the formula for calculating the weight of particles is(24)wti=wt−1ipYtXti,where t is time stamp, i is the number of particles, and w is the weight of particles.


### 4.3. Particle Filter Implementation

The particle filter algorithm is summarized in Table2. Firstly, the state parameters and weights of particles are initialized; secondly, the iterative process of the particle filter algorithm is divided into four steps, which includes measurement update, estimation, resampling, and time update.Table 2
Particle filter algorithm.
ProcessContentInitializationLetX1i~pX0,i=1,⋯,N, and w0i=1/NIteration(1) Measurement updateFori=1,⋯,N, wti=1/ctwt−1ipYt/Xti, where the normalization weight is given by ct=∑t=1Nwt−1ipYt/Xti(2) EstimationThe filtering density is approximated bypXt/Yt≈∑i=1NwtiδXt−Xti,Xt≈∑i=1NwtiXti(3) ResamplingOptionally at each time, takeN samples with replacement from the set Xti,wtii=1N, where the probability to take sample i is wti and let wti=1/N(4) Time updateGenerate predictions according to the proposal distribution:Xt+1i~qXt+1/Xti,Yt+1, and compensate for the importance weight wt+1i=wtipXt+1i/Xti/qXt+1i/Xti,Yt+1


## 4.1. Recursive Bayesian Estimation

Applied nonlinear filtering is based on discrete-time nonlinear state-space models relating a hidden stateXt to the observations Yt, denote the observations at time t by Yt=y0,⋯,yt, the Bayesian solution to compute the posterior distribution is given by
(20)pXtYt−1=∫pXtXt−1pXt−1Yt−1dXt−1,pXtYt=pyt/XtpXt/Yt−1pyt/Yt−1,where t is the time stamp, xt is the state variable, pXt‐1/Yt‐1 is the posterior probability distribution of the last moment, pXt/Xt‐1 is the state transition probability, pXt/Yt‐1 is the prior probability distribution, pyt/Xt is the likelihood function, and pyt/Yt−1 is the normalization function.


## 4.2. Particle Filter

Supposed thatN particles Xti,wtii=1N from the posterior probability pXt/Yt of the state can be extracted, where Xti is the state of the particle, wti is the weight of the particle; then,
(21)pXtYt≈∑i=1NwtiδXt−Xti,where δ is the Dirac delta function and N is the number of particles.The Sequential Importance Sampling (SIS) method is used to calculate the weight of particles, which is written as(22)wti=wt−1ipYt/XtipXti/Xt−1iqXti/Xt−1i,Yt.The prior probability distribution is used as the importance density function:(23)qXtiXt−1i,Yt=pXtiXt−1i.Then, the formula for calculating the weight of particles is(24)wti=wt−1ipYtXti,where t is time stamp, i is the number of particles, and w is the weight of particles.


## 4.3. Particle Filter Implementation

The particle filter algorithm is summarized in Table2. Firstly, the state parameters and weights of particles are initialized; secondly, the iterative process of the particle filter algorithm is divided into four steps, which includes measurement update, estimation, resampling, and time update.Table 2
Particle filter algorithm.
ProcessContentInitializationLetX1i~pX0,i=1,⋯,N, and w0i=1/NIteration(1) Measurement updateFori=1,⋯,N, wti=1/ctwt−1ipYt/Xti, where the normalization weight is given by ct=∑t=1Nwt−1ipYt/Xti(2) EstimationThe filtering density is approximated bypXt/Yt≈∑i=1NwtiδXt−Xti,Xt≈∑i=1NwtiXti(3) ResamplingOptionally at each time, takeN samples with replacement from the set Xti,wtii=1N, where the probability to take sample i is wti and let wti=1/N(4) Time updateGenerate predictions according to the proposal distribution:Xt+1i~qXt+1/Xti,Yt+1, and compensate for the importance weight wt+1i=wtipXt+1i/Xti/qXt+1i/Xti,Yt+1


## 5. Experimental Results and Analysis

### 5.1. Experimental Setup

The performance of the Lora positioning system is evaluated in a room as shown in Figure10; the size of the room is about 25 meters long, 4 meters wide, and 2.5 meters high; and the antenna coordinates of Lora are surveyed precisely with a total station.Figure 10
Experimental environment of Lora indoor positioning system.


### 5.2. Experimental Results

Figure11 shows the static test without pseudorange correction for the Lora positioning system, Figure 11(a) is the positioning results, Figure 11(b) is the x-axis positioning error, and Figure 11(c) is the y-axis positioning error. The average positioning error is 0.11 m in the x-axis and 0.07 m in the y-axis, the maximum positioning error is 1.25 m in the x-axis and 0.59 m in the y-axis, and the standard deviation of the x-axis and y-axis errors is 0.42 m and 0.18 m, respectively.Figure 11
Static test without pseudorange correction: (a) positioning results, (b)x-axis positioning error, and (c) y-axis positioning error.
(a)(b)(c)Figure12 shows the static test without pseudorange correction (the piecewise fitting correction method) for the Lora positioning system, Figure 12(a) is the positioning results, Figure 12(b) is the x-axis positioning error, and Figure 12(c) is the y-axis positioning error. The average positioning error is 0.01 m in the x-axis and 0.07 m in the y-axis, the maximum positioning error is 0.72 m in the x-axis and 0.70 m in the y-axis, and the standard deviation of the x-axis and y-axis errors is 0.22 m and 0.12 m, respectively.Figure 12
Static test with pseudorange correction: (a) positioning results, (b)x-axis positioning error, and (c) y-axis positioning error.
(a)(b)(c)The positioning error in terms of the cumulative distribution function on the databases with and without pseudorange correction is shown in Figure13. When the positioning error on the x-axis threshold is 0.2 m and 0.6 m, the CDF with pseudorange correction is 61% and 99%, which are higher than the 32% and 85% without pseudorange correction. When the positioning error on the y-axis threshold is 0.2 m and 0.6 m, the CDF with pseudorange correction is 71% and 99.9%, which are higher than the 52% and 94.8% without pseudorange correction.Figure 13
Comparison of CDF positioning errors: (a)x-axis and (b) y-axis.
(a)(b)


## 5.1. Experimental Setup

The performance of the Lora positioning system is evaluated in a room as shown in Figure10; the size of the room is about 25 meters long, 4 meters wide, and 2.5 meters high; and the antenna coordinates of Lora are surveyed precisely with a total station.Figure 10
Experimental environment of Lora indoor positioning system.


## 5.2. Experimental Results

Figure11 shows the static test without pseudorange correction for the Lora positioning system, Figure 11(a) is the positioning results, Figure 11(b) is the x-axis positioning error, and Figure 11(c) is the y-axis positioning error. The average positioning error is 0.11 m in the x-axis and 0.07 m in the y-axis, the maximum positioning error is 1.25 m in the x-axis and 0.59 m in the y-axis, and the standard deviation of the x-axis and y-axis errors is 0.42 m and 0.18 m, respectively.Figure 11
Static test without pseudorange correction: (a) positioning results, (b)x-axis positioning error, and (c) y-axis positioning error.
(a)(b)(c)Figure12 shows the static test without pseudorange correction (the piecewise fitting correction method) for the Lora positioning system, Figure 12(a) is the positioning results, Figure 12(b) is the x-axis positioning error, and Figure 12(c) is the y-axis positioning error. The average positioning error is 0.01 m in the x-axis and 0.07 m in the y-axis, the maximum positioning error is 0.72 m in the x-axis and 0.70 m in the y-axis, and the standard deviation of the x-axis and y-axis errors is 0.22 m and 0.12 m, respectively.Figure 12
Static test with pseudorange correction: (a) positioning results, (b)x-axis positioning error, and (c) y-axis positioning error.
(a)(b)(c)The positioning error in terms of the cumulative distribution function on the databases with and without pseudorange correction is shown in Figure13. When the positioning error on the x-axis threshold is 0.2 m and 0.6 m, the CDF with pseudorange correction is 61% and 99%, which are higher than the 32% and 85% without pseudorange correction. When the positioning error on the y-axis threshold is 0.2 m and 0.6 m, the CDF with pseudorange correction is 71% and 99.9%, which are higher than the 52% and 94.8% without pseudorange correction.Figure 13
Comparison of CDF positioning errors: (a)x-axis and (b) y-axis.
(a)(b)


## 6. Conclusions

The long-distance transmission of Lora wireless technology makes it possible to be widely used in the smart factory; this paper proposes Lora RTT measurement for indoor positioning, which has two key aspects of innovations: Firstly, a Lora-aided particle filter localization method is designed to solve the problem for indoor positioning. Secondly, numerous experiments were carried out with Lora RTT measurement data to evaluate the performance of the proposed approach; we used the CDF criteria to measure the quality of the estimated location in comparison to the truth location. The results show that the indoor positioning accuracy is improved obviously with the help of the piecewise fitting correction method. At the same time, the Lora indoor positioning system can achieve a positioning accuracy of 1 m under the condition of LOS. In the future, we will focus on Lora indoor positioning and pseudorange correction under the condition of NLOS.



---

*Source: 5529329-2021-03-03.xml*