Design of Indoor Positioning System Based on Ultrasonic
In the information age, with the rapid development of the Internet of Things and mobile communication technology, indoor positioning plays an important role in some common application scenarios, such as large factories, large shopping centers and other places with high requirements for location services. In this paper, an indoor positioning system is designed with STM32 as the main controller chip, loaded with ultrasonic ranging, TPS5430, DS18B20, OLED screen and other modules, which is able to measure the bearing and distance of the target to be located, and automatically receive, collect, process and display the signals. Measurement results show that the distance detection error is less than 2% at the same temperature. Some of the ultrasonic indoor positioning systems fix the three ultrasonic receivers in three different orientations, which cannot be changed at will and the communication interference is greater when they are far away from each other, which requires high hardware and can only be applied in a large and unobstructed site. This system integrates the three ultrasonic receivers into one device, which is convenient to be mounted on indoor robots, delivery trolleys, and other equipment, and can be arbitrarily changed for positioning.
Ultrasonic
在当今人们的生活中,定位技术无处不在。在室外,人们通过GPS、北斗等室外定位技术来获得准确位置信息,实现汽车、人员导航。而近几年,随着物联网产业的发展,室内定位也逐渐成为刚需,尤其对于室内机器人应用来讲,首要解决的问题就是机器人的定位问题。目前常见的室内移动机器人定位技术有光跟踪定位技术、蓝牙定位技术、RFID定位技术、WiFi定位技术等。其中光跟踪技术要求探测器和跟踪目标之间可视,故而光跟踪技术的应用受限;蓝牙技术所需的设备体积小,易于集成在PDA、PC以及手机中,但它在复杂的环境中稳定性差,覆盖范围小;RFID定位技术即射频识别技术,是一种无需直接接触的识别技术,具有非视距传输、识别速度快等特点,但是其通信能力较弱,定位误差大,系统部署复杂,容易受到环境影响等;WiFi定位可以实现复杂的大范围定位,方便组网,很容易架设在现有的无线WiFi网络,但WiFi定位存在同频干扰问题,系统会相互影响
本系统的测量原理:搭载超声波发射端的待定位目标发射超声波时,安装在半圆形板的三个超声波接收端接收到这个超声波信号,测出三个接收端接收到同一信号的时间差,通过计算就可得出本系统与待定位目标的距离与方位角。
室内定位原理图如
设超声波在空气中的传播速度为c,角度θ = α + β,搭载超声波发射端的待定位目标发射一个超声波脉冲,同时接收端STM32启动定时,每个超声波接收端的接收时间为ti(i超声波接收端的编号)。其信号时序图如
利用STM32单个定时器捕获多个通道测出三个接收端接收到同一信号的时间差可得待定位目标与超声波模块之间的距离差为
(1)
在三角形OMN2中假设三条边已知,则
(2)
在三角形MN2N3中假设三条边已知,则
(3)
联立方程(1)~(3)即可求得d1、d2、d3和θ
所以,α和β表示为
(4)
(5)
因此可求得目标基站与中心点O间的距离L和方位角γ
(6)
(7)
本系统的总体设计如下,
在
如
本系统的程序流程如
如
序号 |
温度(℃) |
距离(m) |
实际距离(m) |
方位角(˚) |
实际方位角(˚) |
1 |
16.0 |
1.00 |
1.00 |
60.0 |
60.0 |
2 |
16.0 |
1.01 |
1.00 |
120.6 |
120.0 |
3 |
16.0 |
1.99 |
2.00 |
59.3 |
60.0 |
4 |
16.0 |
2.00 |
2.00 |
120.0 |
120.0 |
5 |
16.0 |
4.99 |
5.00 |
59.4 |
60.0 |
6 |
16.0 |
4.99 |
5.00 |
119.3 |
120.0 |
7 |
20.2 |
1.01 |
1.00 |
60.5 |
60.0 |
8 |
20.2 |
0.99 |
1.00 |
119.2 |
120.0 |
9 |
20.2 |
1.99 |
2.00 |
59.3 |
60.0 |
10 |
20.2 |
1.98 |
2.00 |
118.1 |
120.0 |
11 |
20.2 |
4.98 |
5.00 |
58.2 |
60.0 |
12 |
20.2 |
4.98 |
5.00 |
118.4 |
120.0 |
13 |
24.5 |
0.97 |
1.00 |
57.6 |
60.0 |
14 |
24.5 |
0.98 |
1.00 |
118.5 |
120.0 |
15 |
24.5 |
1.98 |
2.00 |
58.4 |
60.0 |
16 |
24.5 |
1.97 |
2.00 |
117.3 |
120.0 |
17 |
24.5 |
4.97 |
5.00 |
56.9 |
60.0 |
18 |
24.5 |
4.97 |
5.00 |
117.4 |
120.0 |
本文设计了一种基于超声波的室内定位系统,以STM32F103C8T6单片机为控制核心,通过半圆形板的三个超声波接收端来检测中心点O与待测目标的距离与方位。整个设计方案的原理在文中做了详细地介绍,并说明了超声波室内定位的优势,在室内环境下对该系统进行了测试,测试结果表明在方圆5 m的室内定位距离的精度为3 cm,目标方位角的测量角误差小于4˚,也验证了该算法进行室内定位的有效性和精确性。与部分超声波室内定位系统相比,本系统的优势在于将所有模块集成在一个装置上,使其能搭载在室内机器人、小车等设备上,可以随意移动至任何室内环境的位置进行检测和定位,使用灵活方便。
*通讯作者。