舰船科学技术  2017, Vol. 39 Issue (1A): 94-96   PDF    
卡尔曼滤波在船舶无线传感网络节点定位中的应用
许磊     
重庆电子工程职业学院, 重庆 401331
摘要: 基于无线传感网络的信号传输在海航及海上开发中的应用越来越广,无线节点定位精度对网络的通信性能有较大的影响,无线传感网络中的节点定位技术是海上通信领域研究的重要方向。RSSI是一种利用传感器节点信号强度的定位测量方法,但由于海上的噪声干扰及地形影响,其定位精确度较低,已经越来越不能适应无线传感网络节点定位精度要求。本文将卡尔曼滤波算法应用到以信号强度为观测值的节点定位中,极大地提高了定位精度。
关键词: 无源定位     无线传感网络     卡尔曼滤波    
Application of Calman filter in the node localization of wireless sensor network
XU Lei     
Chongqing College of Electronic Engineering, Chongqing 401331, China
Abstract: The application of signal transmission in offshore development is more and more extensive based on Wireless Sensor Network. Wireless sensor network localization accuracy has a great impact on the communication performance of the network, so the node localization technology in wireless sensor networks is an important direction in the field of Maritime Communications. RSSI is a kind of node localization method, which is located in the signal strength of the sensor node, but its location accuracy is low due to the noise interference of the sea and the influence of the terrain, has become increasingly unable to adapt to the wireless sensor network node positioning accuracy requirements. In this paper, the Calman filter algorithm is applied to the node location of the observation value, which greatly improves the positioning accuracy.
Key words: passive location     wireless sensor networks     Kalman filtering    
0 引言

随着传感器及RFID应用的普及,无线传感网络WSN在海上信号传输中应用更加广泛。WSN自身为一自适应反馈网络,由部署在不同地理位置的传感器及RFID组成,根据业务逻辑或位置可划分为不同的节点,节点定位是信号传输首要解决的问题。现有的节点定位方法主要有无源定位与有源定位,其中无源定位利用信号的强弱进行计算,有源定位则利用物理测距进行测量。

RSSI是无源节点定位算法,利用信号强度来测量传感节点的三边距离,其算法复杂度低,较易实现[1]。但由于信号在传输过程中受到海上噪声及信道衰减等因素影响,最终接收的信号强度损耗较大,导致定位结果出现偏差。卡尔曼滤波器是一种非线性滤波器,通过对输入输出信号进行评估从而改变系统状态,与RSSI算法相结合可以有效提高定位精度。

本文在分析了无线传感网络节点定位模型基础上,设计了一种卡尔曼滤波节点定位算法,提高了定位精度。

1 RSSI无线传感网络节点定位

RSSI算法利用节点发射及接收信号强度的不同与观测描节点进行对比来得到节点的距离,信号强度损耗与路径距离之间关系满足自由损耗及正态分布公式:

${P_r}(d) = {P_t}{(\frac{\lambda }{{4{\rm{\pi }}d}})^n}{G_r}{G_t},$ (1)
$P_r(d) = P_r(d_0) - 10\alpha \lg (\frac{d}{{d_0}}) + v。$ (2)

式(1)对应自由损耗模型,式(2)对应正态分布模型,式中$P_t$$P_r$分别为信号的发射功率与接收功率;d为发射与接收节点路径大小;$G_t$$G_r$为两端天线的射频增益;d0为描节点与未知节点的路径;a表示信号在特定信道中的损耗,v表示海洋信号噪声均值,在此用高斯白噪声代替[2]

通过上述方法,可以得到传感网络各节点与描节点信号传输路径大小,则根据描节点的坐标位置可以计算出目标节点坐标,在未知节点周围设置3个描节点,其位置坐标分别为$(x_a,y_a)^{\text{T}}$$(x_b,y_b)^{\text{T}}$$(x_c,y_c)^{\text{T}}$,且利用公式(1)或(2)得到位置节点与3个描节点信号路径大小为$d_a$$d_b$$d_c$,则最终可以通过公式(3)得到未知节点初始坐标:

$\sqrt {\begin{array}{*{20}{c}} {(x - x_a)^2 + (y - y_a)^2 = d_a}\\ {(x - x_b)^2 + (y - y_b)^2 = d_b}\\ {(x - x_c)^2 + (y - y_c)^2 = d_c} \end{array}}。 $ (3)
2 基于卡尔曼滤波的节点定位 2.1 卡尔曼滤波模型

式(3)得到未知节点初始坐标后,可以利用卡尔曼滤波对节点进行跟踪[3]

卡尔曼滤波本质是对离散非线性系统进行预测,系统方程为:

$x_{k + 1} = f_k(x_k) + w_k,$ (4)
$z_k = h_k(x_k) + v_k。$ (5)

式中:k为离散时刻点,$x_k \in R^n$$z_k \in R^m$为非线性离散系统在此时刻状态量及观测量,$f_k \in R^n$$h_k \in R^m$为离散系统的冲激响应值,$w_k \in R^n$$v_k \in R^m$在此用均值为0的高斯白噪声模拟,且互不相关[4]

卡尔曼滤波利用$X = [x_1,x_2, \cdots x_n]$的特性,设计$2n + 1$$\delta $点对$X$进行模拟,$\delta $分布如下:

$\left\{ {\begin{aligned} & {\xi _0 = \bar x},\\ & {\xi _i = \bar x + \sqrt {(n + \lambda )P_x} _i,i = 1,2, \cdots n},\\ & {\xi _{i + 1} = \bar x - \sqrt {(n + \lambda )P_x} _i,i = 1 + n,2 + n, \cdots 2n}。 \end{aligned}} \right.$ (6)

其中,卡尔曼滤波可以推导出k -1时刻的$\xi _{k - 1|k - 1}^i$,由离散系统的公式(4)(5)进一步得到当前时刻的$\xi _{k|k - 1}^i$,从而推导出卡尔曼离散系统的状态量及观测量$\mathord{\buildrel{\lower3pt\hbox{$\scriptscriptstyle\frown$}} \over x} _{k|k - 1}$$\mathord{\buildrel{\lower3pt\hbox{$\scriptscriptstyle\frown$}} \over z} _{k|k - 1}$

卡尔曼离散滤波中的预测模型如图 1所示。

图 1 卡尔曼滤波预测模型 Fig. 1 Calman filter prediction model
2.2 基于卡尔曼预测模型的节点精确定位

设传感网络节点初始坐标为$(x,y)^{\text{T}}$$(x_k,y_k)^{\text{T}}$为此节点在k时刻的坐标值,坐标值可利用卡尔曼滤波模型通过k次迭代得到,设描节点为静止,则离散模型简化为:

$x_{k + 1} = f_k(x_k) + w_k = Ax_k + w_k。$ (7)

这里,二维坐标用$x_k$代替,系统状态矩阵用A代替,${\boldsymbol{A}} = \left[ {\begin{array}{*{20}{c}} 1&0\\ 0&1 \end{array}} \right]$

对未知节点的位置测量与其扫描点选择有关,传统的方法是直接以节点与描点之间的实测距离为参考量[5],其模型描述如下:

采用三维坐标法,选择3个描节点,与未知节点的路径大小分别为$d = [d_1,d_2,d_3]^{\text{T}},(n = 1,2,3)$,则时刻k的路径$d_k = [d_{k1},d_{k2},d_{k3}]^{\text{T}},(n = 1,2,3)$是经过k次迭代后的路径大小,为

$\left\{ {\begin{array}{*{20}{c}} {z_k = d_k = h_k(X_k) + v_k = H_kX_k + v_k},\\[8pt] {d_k = \left( {\begin{array}{*{20}{c}} {d_{k1}}\\[8pt] {d_{k2}}\\[8pt] {d_{k3}} \end{array}} \right) = \left( {\begin{array}{*{20}{c}} {\sqrt {(x_k - x_{n1})^2 + (y_k - y_{n1})^2} }\\[8pt] {\sqrt {(x_k - x_{n2})^2 + (y_k - y_{n2})^2} }\\[8pt] {\sqrt {(x_k - x_{n3})^2 + (y_k - y_{n3})^2} } \end{array}} \right)}。 \end{array}} \right.$ (8)

式中:参考3个描节点的位置坐标分别为$X_{n1} = (x_{n1},y_{n1})$$X_{n2} = (x_{n2},y_{n2})$$X_{n3} = (x_{n3},y_{n3})$$d_{k1}$$d_{k2}$$d_{k3}$为未知节点与3个描节点的直线距离,$v_k$为对应的未知节点与3个描节点路径中的噪声向量

$H_k = \frac{{\partial d_k}}{{\partial (x_k,y_k)}} = \left( {\begin{array}{*{20}{c}} {\displaystyle\frac{{x_k - x_{n1}}}{{d_{k1}}}{\rm{ }}\frac{{y_k - y_{n1}}}{{d_{k1}}}}\\[8pt] {\displaystyle\frac{{x_k - x_{n2}}}{{d_{k2}}}{\rm{ }}\frac{{y_k - y_{n2}}}{{d_{k2}}}}\\[8pt] {\displaystyle\frac{{x_k - x_{n3}}}{{d_{k3}}}{\rm{ }}\frac{{y_k - y_{n3}}}{{d_{k3}}}} \end{array}} \right)。$ (9)

由于海上地形及测量环境的复杂性,以实测距离为参考量的节点定位难度较大,本文以接收到信号的强度对比其功率损耗模型(如式(2))为观测值,可以有效抑制海上信号损耗,提高定位精度,基于此方法的系统状态方程为:

$\left\{ {\begin{array}{*{20}{c}} {z_k = P_r(d_k) = h_k(X_k) + v_k},\\[8pt] {P_r(d_k) \!\!= \!\!\left( \!\!{\begin{array}{*{20}{c}} {P_r(d_{k1})}\\[8pt] {P_r(d_{k2})}\\[8pt] {P_r(d_{k3})} \end{array}}\!\! \right) \!\!= \!\!\left(\!\! {\begin{array}{*{20}{c}} {P_r(d_0) \!-\! 10a\lg (\displaystyle\frac{{d_{k1}}}{{d_0}}) \!+\! v}\\[8pt] {P_r(d_0) \!-\! 10a\lg (\displaystyle\frac{{d_{k2}}}{{d_0}}) \!+\! v}\\[8pt] {P_r(d_0)\! -\! 10a\lg (\displaystyle\frac{{d_{k3}}}{{d_0}}) \!+\! v} \end{array}}\!\! \right)。} \end{array}} \right.$ (10)

式中:$P_r( \cdot )$为对应路径接收信号的强度,如$P_r(d_{k1})$k时刻节点与第1个描节点路径中接收信号的强度

$H_k = \frac{{\partial P_r(d_k)}}{{\partial (x_k,y_k)}} = \frac{{ - 10a}}{{\ln 10}}\left( {\begin{aligned} {\frac{{x_k - x_{n1}}}{{d_{k1}^2}}{\rm{ }}\frac{{y_k - y_{n1}}}{{d_{k1}^2}}}\\ {\frac{{x_k - x_{n2}}}{{d_{k2}^2}}{\rm{ }}\frac{{y_k - y_{n2}}}{{d_{k2}^2}}}\\ {\frac{{x_k - x_{n3}}}{{d_{k3}^2}}{\rm{ }}\frac{{y_k - y_{n3}}}{{d_{k3}^2}}} \end{aligned}} \right)。$ (11)
3 算法仿真

本文最后对传统的基于RSSI的无线传感网络节点定位与基于卡尔曼滤波的算法进行了仿真,误差公式为:

$error = \sqrt {(x - x_k)^2 + (y - y_k)^2}。 $ (12)

其中, $(x,y),(x_k,y_k)$ 分别表示其实际值与计算值。

最后给出2种算法的平均误差结果与描点个数选择的关系,如表 1所示。

表 1 仿真结果 Tab.1 simulation result
4 结语

本文重点分析了以信号强度观测量的传感网络节点定位模型,并结合卡尔曼滤波器对定位结果进行迭代,有效提高了计算精度。

参考文献
[1] 王焱, 单欣欣, 姜伟. 无线传感网络中移动节点定位技术研究[J]. 传感技术学报, 2011 (9): 42–45.
[2] 赵青杉, 胡玉兰. 基于PSO的无线传感网络节点定位算法[J]. 舰船科学技术, 2012 (5): 21–24.
[3] JULIER S J. A new approach for filtering nonlinear system[C]//The Proceedings of the American Conference. Piscataway:IEEE Press, 1995:1628-1632.
[4] KIM K H, KIM D Y. Group storage methods at container port terminals[J]. MH-2. The Materials Handling Engineering Division, 75th Anniversary Commemorative Volume, 1994 : 15–20.
[5] RAPPAPORT T S. Wireless communications principles and practice[M].2nd ed. New Jersey: Prentice Hall, 1996.