## 3 Sensor Positioning Principle
### Principle of Indoor Pseudosatellite Positioning  
A pseudolite is usually fixed at a known position, and the position of the receiver can be obtained by using the pseudorange observation measurement. In theory, the position of the receiver can be obtained by using the simultaneous equations of the coordinates of three pseudolites and the receiver. However, in the process of practical application, the time between the pseudolite system and the receiver cannot be fully synchronized, and there is usually a certain clock deviation. Therefore, in order to calculate the coordinate position of the receiver, the clock difference needs to be taken into account as an unknown quantity. At least four pseudolites are needed to achieve positioning.  
We assume that the pseudocode ranging and positioning equations of a pseudosatellite at time \(k\) are as follows:  
\[\left\{\begin{aligned} r_{1k}=ct_{1k}+\delta t_{1k}+n_{1k}& =\sqrt{(x_{k}-x_{s1})+(y_{k}-y_{s1})+(z_{k}-z_{s1})}+\delta  
Formula (1) is a nonlinear equation. The Taylor expansion of Formula (1) at position \((x_{k},y_{k},z_{k})\) is as follows:  
\[\begin{pmatrix}r_{1k}-n_{1k}\\ \vdots\\ r_{ik}-n_{ik}\\ \vdots\\ r_{Nk}-n_{Nk}\end{pmatrix}=\begin{bmatrix}\frac{x_{k}-x_{k}}{r_{1k}}&\frac{y_{k }-y_{k}}{r_{1k}}&\frac{z_{1k}-z_{k}}{r_{1k}}&1\\ \vdots&\vdots&\vdots&\vdots\\ \frac{x_{k}-x_{k}}{r_{ik}}&\frac{y_{i}-y_{k}}{r_{i,k}}&\frac{x_{i}-y_{k}}{r_{ i,k}}&1\\ \vdots&\vdots&\vdots&\vdots\\ \frac{x_{k}-x_{k}}{r_{Nk}}&\frac{y_{i}-y_{k}}{r_{Nk}}&\frac{z_{N}-z_{k}}{r_{ Nk}}&1\end{bmatrix}\begin{bmatrix}\Delta x_{k}\\ \Delta y_{k}\\ \Delta z_{k}\\ \Delta t\end{bmatrix} \tag{2}\]  
where \(\Delta x_{k}=x_{k+1}-x_{k}\), \(\Delta y_{k}=y_{k+1}-y_{k}\), \(\Delta z_{k}=z_{k+1}-z_{k}\).  
\[R=\begin{pmatrix}r_{1k}-n_{1k}\\ \vdots\\ r_{ik}-n_{ik}\\ \vdots\\ r_{Nk}-n_{Nk}\end{pmatrix} \tag{3}\]  
\[G=\begin{bmatrix}\frac{x_{k-1}-x_{k}}{r_{1k}}&\frac{y_{3}-y_{k}}{r_{1k}}&\frac {z_{4}-z_{k}}{r_{1k}}&1\\ \vdots&\vdots&\vdots&\vdots\\ \frac{x_{i}-x_{k}}{r_{i,k}}&\frac{y_{i}-y_{k}}{r_{i,k}}&\frac{x_{i}-y_{k}}{r_{ i,k}}&1\\ \vdots&\vdots&\vdots&\vdots\\ \frac{x_{i}-x_{k}}{r_{Nk}}&\frac{y_{i}-y_{k}}{r_{Nk}}&\frac{z_{N}-z_{k}}{r_{ N,k}}&1\end{bmatrix} \tag{4}\]  
\[b=\begin{bmatrix}\Delta x_{k}\\ \Delta y_{k}\\ \Delta z_{k}\\ \Delta t\end{bmatrix} \tag{5}\]  
Formula (2) can be written as:  
\[R=Gb \tag{6}\]  
The data of each pseudosatellite base station of the least square algorithm can be solved. That is:  
\[b=\left(G^{\mathsf{T}}G\right)^{-1}\!G^{\mathsf{T}}R \tag{7}\]  
The pseudosatellite receiver can receive the pseudorange and carrier phase from the pseudosatellite to the receiver. However, due to the complex indoor environment, serious multipaths and occlusion, the pseudorange and carrier noise ratio jump greatly in the indoor environment, so it is not suitable for indoor use. However, the carrier phase change rate of pseudolites arriving at the receiver is relatively stable, which can be used as the observation of indoor positioning.  
In the \(r_{ik+1}\) calculation, the pseudorange is not calculated directly but recursively through the carrier phase change, that is:  
\[r_{i(k+1)}=\lambda\Big{(}N_{ik|i(k+1)}+\phi_{ik|i(k+1)}\Big{)}+r_{ik} \tag{8}\]  
where \(\lambda\) is the wavelength of the carrier, \(N_{ik|i(k+1)}\) is the whole cycle number of the carrier phase change in the \(i\)th pseudolite from \(k\) to \(k+1\) and \(\phi_{ik|i(k+1)}\) is the less-than-full-cycle part of the carrier phase change in the \(i\)th pseudolite from \(k\) to \(k+1\).  
In the indoor complex environment, the pseudorange can be directly used according to the actual environment or calculated through the carrier phase change rate so as to improve the navigation and positioning performance in the complex environment.