CN208621076U - A moving target trajectory tracking system - Google Patents
A moving target trajectory tracking system Download PDFInfo
- Publication number
- CN208621076U CN208621076U CN201821174082.1U CN201821174082U CN208621076U CN 208621076 U CN208621076 U CN 208621076U CN 201821174082 U CN201821174082 U CN 201821174082U CN 208621076 U CN208621076 U CN 208621076U
- Authority
- CN
- China
- Prior art keywords
- pin
- msp430f169
- module
- moving target
- mpu6050
- Prior art date
- Legal status (The legal status is an assumption and is not a legal conclusion. Google has not performed a legal analysis and makes no representation as to the accuracy of the status listed.)
- Expired - Fee Related
Links
- 238000004891 communication Methods 0.000 claims description 10
- 238000012545 processing Methods 0.000 claims description 10
- 238000001514 detection method Methods 0.000 claims description 7
- 230000001133 acceleration Effects 0.000 abstract description 18
- 238000013461 design Methods 0.000 abstract description 4
- 230000003068 static effect Effects 0.000 abstract description 3
- 238000001914 filtration Methods 0.000 description 12
- 238000000034 method Methods 0.000 description 12
- 238000006073 displacement reaction Methods 0.000 description 10
- 238000005259 measurement Methods 0.000 description 9
- 238000010586 diagram Methods 0.000 description 8
- 238000004422 calculation algorithm Methods 0.000 description 6
- 230000006870 function Effects 0.000 description 6
- 230000008569 process Effects 0.000 description 6
- XEEYBQQBJWHFJM-UHFFFAOYSA-N Iron Chemical compound [Fe] XEEYBQQBJWHFJM-UHFFFAOYSA-N 0.000 description 4
- 230000002457 bidirectional effect Effects 0.000 description 4
- 238000005516 engineering process Methods 0.000 description 3
- 230000010354 integration Effects 0.000 description 3
- 239000011159 matrix material Substances 0.000 description 3
- 238000005070 sampling Methods 0.000 description 3
- NAWXUBYGYWOOIX-SFHVURJKSA-N (2s)-2-[[4-[2-(2,4-diaminoquinazolin-6-yl)ethyl]benzoyl]amino]-4-methylidenepentanedioic acid Chemical compound C1=CC2=NC(N)=NC(N)=C2C=C1CCC1=CC=C(C(=O)N[C@@H](CC(=C)C(O)=O)C(O)=O)C=C1 NAWXUBYGYWOOIX-SFHVURJKSA-N 0.000 description 2
- 230000004888 barrier function Effects 0.000 description 2
- 238000004364 calculation method Methods 0.000 description 2
- 230000008859 change Effects 0.000 description 2
- 238000009795 derivation Methods 0.000 description 2
- 230000000694 effects Effects 0.000 description 2
- 238000005286 illumination Methods 0.000 description 2
- 230000003993 interaction Effects 0.000 description 2
- 229910052742 iron Inorganic materials 0.000 description 2
- 238000007792 addition Methods 0.000 description 1
- 238000004458 analytical method Methods 0.000 description 1
- 230000009286 beneficial effect Effects 0.000 description 1
- 238000006243 chemical reaction Methods 0.000 description 1
- 239000013078 crystal Substances 0.000 description 1
- 230000007547 defect Effects 0.000 description 1
- 238000002474 experimental method Methods 0.000 description 1
- 238000013507 mapping Methods 0.000 description 1
- 230000005855 radiation Effects 0.000 description 1
- 238000012360 testing method Methods 0.000 description 1
Landscapes
- Navigation (AREA)
- Length Measuring Devices With Unspecified Measuring Means (AREA)
Abstract
Description
技术领域technical field
本实用新型涉及人机交互的目标轨迹测量与跟踪技术领域,尤其涉及一种运动目标轨迹追踪系统。The utility model relates to the technical field of target trajectory measurement and tracking of human-computer interaction, in particular to a moving target trajectory tracking system.
背景技术Background technique
物体运动是一个无处不在的现象。随着科技的进步,人类正运用各种技术监测与追踪物体运动轨迹。在人机交互领域,激光追踪系统、磁空间追踪系统和基于空间机器视觉的定位系统使用最广泛,具有较高的测量精度,也存在受外界参考系限定、系统开销大、设备运作复杂等缺陷。磁空间追踪系统经常受到场源限制,容易受各种外界环境影响,如铁制品的屏障作用、其他磁场的干扰;激光追踪系统会受到激光源光照范围的制约,且激光光源常会被损坏,造成不必要的损失;基于三维机器视觉的定位系统通常因为摄像头的放置地点和拍摄的场景范围的影响,具有一定的局限性,且数据计算过程繁杂、系统开销大。所以,上述轨迹追踪系统用于运动目标跟踪、定位时,各有优缺点。因此,设计一种测量精度高、应用范围广的轨迹追踪系统具有较强的现实意义和实用价值。Object motion is a ubiquitous phenomenon. With the advancement of technology, humans are using various technologies to monitor and track the movement of objects. In the field of human-computer interaction, laser tracking systems, magnetic space tracking systems and positioning systems based on space machine vision are the most widely used and have high measurement accuracy. . The magnetic space tracking system is often limited by the field source and is easily affected by various external environments, such as the barrier effect of iron products and the interference of other magnetic fields; the laser tracking system is limited by the illumination range of the laser source, and the laser light source is often damaged, causing Unnecessary losses; positioning systems based on 3D machine vision usually have certain limitations due to the location of the camera and the scope of the shooting scene, and the data calculation process is complicated and the system overhead is high. Therefore, each of the above-mentioned trajectory tracking systems has advantages and disadvantages when used for moving target tracking and positioning. Therefore, it has strong practical significance and practical value to design a trajectory tracking system with high measurement accuracy and wide application range.
实用新型内容Utility model content
实用新型目的:本实用新型的目的在于解决现有的激光追踪系统、磁空间追踪系统和基于空间机器视觉的定位系统受外界参考系限定、系统开销大、设备运作复杂等缺陷,磁空间追踪系统经常受到场源限制,容易受各种外界环境影响,如铁制品的屏障作用、其他磁场的干扰;激光追踪系统会受到激光源光照范围的制约,且激光光源常会被损坏,造成不必要的损失;基于三维机器视觉的定位系统通常因为摄像头的放置地点和拍摄的场景范围的影响,具有一定的局限性,且数据计算过程繁杂、系统开销大的问题。Purpose of the utility model: The purpose of the utility model is to solve the defects of the existing laser tracking system, the magnetic space tracking system and the positioning system based on space machine vision, which are limited by the external reference system, the system overhead is large, and the equipment operation is complicated. Often limited by the field source, it is easily affected by various external environments, such as the barrier effect of iron products and the interference of other magnetic fields; the laser tracking system is restricted by the illumination range of the laser source, and the laser light source is often damaged, causing unnecessary losses. ; The positioning system based on 3D machine vision usually has certain limitations due to the influence of the placement location of the camera and the scope of the shooting scene, and the data calculation process is complicated and the system overhead is high.
技术方案:为实现上述目的,本实用新型采用以下技术方案:Technical scheme: In order to realize the above-mentioned purpose, the utility model adopts the following technical scheme:
一种运动目标轨迹追踪系统,包括运动检测模块、控制模块、显示模块、串口通信模块和PC端处理模块,其中:A moving target trajectory tracking system includes a motion detection module, a control module, a display module, a serial communication module and a PC-side processing module, wherein:
运动检测模块:采用MPU6050六轴传感器,检测运动目标的加速度和角速度参数;Motion detection module: MPU6050 six-axis sensor is used to detect the acceleration and angular velocity parameters of moving targets;
控制模块:以MSP430F169为主控芯片,主要负责采集运动数据、控制串口通信和LCD显示,由程序对采集的加速度数据进行零偏校准,然后把校准数据传输给PC端处理;Control module: MSP430F169 is the main control chip, which is mainly responsible for collecting motion data, controlling serial communication and LCD display. The program performs zero offset calibration on the collected acceleration data, and then transmits the calibration data to the PC for processing;
显示模块:将MPU6050传感器的3轴加速度、角速度数据在LCD上显示;Display module: display the 3-axis acceleration and angular velocity data of the MPU6050 sensor on the LCD;
串口通信模块:采用PL2303HX芯片,将运动数据传输到PC端;Serial communication module: use PL2303HX chip to transmit motion data to PC;
PC端处理模块:在MATLAB环境中,对运动数据进行Kalman滤波,再对其进行两次积分,得到运动目标随时间移动的坐标点,连线绘出运动路径图。PC-side processing module: In the MATLAB environment, Kalman filtering is performed on the motion data, and then two integrations are performed to obtain the coordinate points of the moving target moving with time, and the motion path diagram is drawn by connecting lines.
进一步地,MPU6050的管脚XDA、XCL不与MSP430F169相连,管脚GND与MSP430F169共地,管脚VCC连接到MSP430F169的3.3V引脚,SDA引脚连接MSP430F169的P2.1口, SCL引脚连接MSP430F169的P2.0端。Further, the pins XDA and XCL of the MPU6050 are not connected to the MSP430F169, the pin GND shares the ground with the MSP430F169, the pin VCC is connected to the 3.3V pin of the MSP430F169, the SDA pin is connected to the P2.1 port of the MSP430F169, and the SCL pin is connected P2.0 side of MSP430F169.
进一步地,PL2303HX芯片的+5V连接到MSP430F169的+5V引脚,且共地;PL2303HX芯片的RXD引脚连接到MSP430F169的TXD即P3.4引脚,TXD引脚连接到MSP430F169 的RXD即P3.5引脚。Further, the +5V of the PL2303HX chip is connected to the +5V pin of the MSP430F169, and the ground is common; the RXD pin of the PL2303HX chip is connected to the TXD of the MSP430F169, that is, the P3.4 pin, and the TXD pin is connected to the RXD of the MSP430F169, that is, the P3.4 pin. 5 pins.
进一步地,MSP430F169通过IIC总线与MPU6050六轴传感器连接。Further, MSP430F169 is connected with MPU6050 six-axis sensor through IIC bus.
一种运动目标轨迹追踪方法,包括以下步骤:A method for tracking a moving target trajectory, comprising the following steps:
1)获得传输至PC端的各参数信息;1) Obtain each parameter information transmitted to the PC;
2)MPU6050传感器输出离散数据,所以曲线在采样时间间隔Δt足够小的情况下,能够简化为直线;这样就能把曲线拆分成无数个直角梯形,对v(t)进行积分也便是对拆分的直角梯形面积进行求解;2) The MPU6050 sensor outputs discrete data, so the curve can be simplified into a straight line when the sampling time interval Δt is small enough; in this way, the curve can be split into countless right-angled trapezoids, and the integration of v(t) is the same as The area of the split right-angled trapezoid is solved;
3)将v(n)、s(n)的推导结果运用到加速度传感器中,得到三维空间位移公式;3) Apply the derivation results of v(n) and s(n) to the acceleration sensor to obtain the three-dimensional spatial displacement formula;
4)计算一次运动轨迹需要进行2*3*n次积分运算,根据实际位移简化为2*3*n次加法演算。4) Calculating a motion trajectory requires 2*3*n integral operations, which is simplified to 2*3*n additions according to the actual displacement.
进一步地,所述步骤2)中,令初始条件s(t0)=0,即:Further, in the step 2), let the initial condition s(t 0 )=0, that is:
Δt=t1-t0=t2-t1=...=tn-tn-1,t0为起始时刻,t1、t2…tn为等间隔时间序列,令Δt为时间间隔;Δt=t 1 -t 0 =t 2 -t 1 =...=t n -t n-1 , t 0 is the starting time, t 1 , t 2 ... t n are time series at equal intervals, let Δt be time interval;
离散域中n>1时,When n>1 in the discrete domain,
由式2、式3可得:From Equation 2 and Equation 3, we can get:
由式4、式5可看出,求当前瞬时运动速度v(n)和运动位移s(n),可由s(n-1)、 v(n-1)、a(n-1)和当前a(n)计算出。It can be seen from Equation 4 and Equation 5 that to find the current instantaneous motion speed v(n) and motion displacement s(n), s(n-1), v(n-1), a(n-1) and the current a(n) is calculated.
进一步地,所述步骤3)中将式4、式5中v(n)、s(n)的推导结果运用到加速度传感器中,可以得到三维空间位移公式为:Further, in the step 3), the derivation results of v(n) and s(n) in formula 4 and formula 5 are applied to the acceleration sensor, and the three-dimensional space displacement formula can be obtained as:
Kalman滤波方法,包括以下步骤:The Kalman filtering method includes the following steps:
预测阶段为:假设此时为k时刻,首先根据状态系统模型,可以基于系统上一时刻的状况而预计出当下的状态方程:The prediction stage is: Assuming that it is time k, first, according to the state system model, the current state equation can be predicted based on the state of the system at the previous moment:
X(k|k-1)=AX(k-1|k-1)+BU(k) (9)X(k|k-1)=AX(k-1|k-1)+BU(k) (9)
式(9)中,X(k|k-1)是通过上一时刻的状态估计得到的当下状态,X(k-1|k-1) 是上一时刻最优的预计值,U(k)是此刻对系统的控制量。In formula (9), X(k|k-1) is the current state estimated by the state at the previous moment, X(k-1|k-1) is the optimal predicted value at the previous moment, U(k ) is the amount of control over the system at the moment.
预测阶段也对估计值精确程度进行预计。系统状态的协方差也就是预计值,如式(10)所示:The forecast stage also predicts how accurate the estimates will be. The covariance of the system state is also the expected value, as shown in equation (10):
P(k|k-1)=AP(k-1|k-1)AT+Q (10)P(k|k-1)=AP(k-1|k-1)A T +Q (10)
式(10)中,P(k-1|k-1)是X(k|k-1)的协方差,P(k-1|k-1)是X(k-1|k-1)的协方差。In formula (10), P(k-1|k-1) is the covariance of X(k|k-1), P(k-1|k-1) is X(k-1|k-1) covariance of .
更新阶段为:已知目前状况的估计值,再结合当前状况的观测值,可得当前状况的最优化估计值:The update stage is: the estimated value of the current situation is known, and then combined with the observed value of the current situation, the optimal estimated value of the current situation can be obtained:
X(k|k)=X(k|k-1)+Kg(k)[Z(k)-HX(k|k-1)] (11)X(k|k)=X(k|k-1)+Kg(k)[Z(k)-HX(k|k-1)] (11)
其中的Kg,就是Kalman增益(Kalman Gain),它可以因为不同的时刻而不断改变自身的值:Among them, Kg is the Kalman Gain, which can continuously change its own value due to different moments:
Kg(k)=P(k|k-1)HT/[HP(k|k-1)HT+R] (12)Kg(k)=P(k|k-1)H T /[HP(k|k-1)H T +R] (12)
虽然现在已经得到k时刻系统状态最优的预计值X(k|k),但是还需要更新 P(k|k)来保证Kalman滤波过程能循环工作到最终。Although the optimal predicted value X(k|k) of the system state at time k has been obtained, P(k|k) needs to be updated to ensure that the Kalman filtering process can work cyclically to the end.
P(k|k)=[I-Kg(k)H]P(k|k-1) (13)P(k|k)=[I-Kg(k)H]P(k|k-1) (13)
I为单位矩阵。随机线性离散系统Kalman滤波的基本步骤就是依靠以上5个公式完成的。I is the identity matrix. The basic steps of Kalman filtering of random linear discrete systems are completed by relying on the above five formulas.
有益效果:本实用新型与现有技术相比:Beneficial effect: The utility model is compared with the prior art:
系统以MSP430F169为主控芯片,通过MPU6050六轴传感器检测运动目标的加速度和角速度以及倾角等参数,进行静态误差校准后,通过串口传输到PC端。在PC端中对运动参数进行Kalman滤波消除随机噪声,再进行积分运算,从而得到目标在三维空间运动的轨迹坐标位置,最终绘制出运动轨迹线路并计算位移值。该系统实现了对运动轨迹的测量与追踪,具有较强的现实意义和实用价值。The system uses MSP430F169 as the main control chip, and detects the acceleration, angular velocity and inclination of the moving target through the MPU6050 six-axis sensor. After static error calibration, it is transmitted to the PC through the serial port. In the PC terminal, Kalman filtering is performed on the motion parameters to eliminate random noise, and then the integral operation is performed to obtain the trajectory coordinate position of the target moving in the three-dimensional space, and finally the motion trajectory line is drawn and the displacement value is calculated. The system realizes the measurement and tracking of the motion trajectory, and has strong practical significance and practical value.
附图说明Description of drawings
图1为本实用新型时间-速度曲线;Fig. 1 is the utility model time-speed curve;
图2为本实用新型系统框图;Fig. 2 is the system block diagram of the utility model;
图3为本实用新型MSP430F169单片机电路图;Fig. 3 is the circuit diagram of the utility model MSP430F169 single-chip microcomputer;
图4为本实用新型MPU6050传感器电路图;Fig. 4 is the circuit diagram of the utility model MPU6050 sensor;
图5为本实用新型LCD显示电路图;Fig. 5 is the LCD display circuit diagram of the utility model;
图6为本实用新型PL2303HX串口模块电路图;Fig. 6 is the utility model PL2303HX serial port module circuit diagram;
图7为本实用新型单片机主程序流程图;7 is a flow chart of the main program of the single-chip microcomputer of the present invention;
图8为本实用新型数据处理算法流程图;Fig. 8 is the data processing algorithm flow chart of the utility model;
图9为本实用新型加速度数据滤波前后对比图;9 is a comparison diagram of the utility model before and after the acceleration data filtering;
图10为本实用新型运动目标线路图。FIG. 10 is a circuit diagram of a moving target of the present invention.
具体实施方式Detailed ways
下面结合附图和实施例对本实用新型进行进一步的说明。The present utility model will be further described below in conjunction with the accompanying drawings and embodiments.
本实用新型为一种基于MPU6050的运动目标轨迹追踪方法及系统,具体实现方法如下:The utility model relates to a method and system for tracking the trajectory of a moving target based on MPU6050, and the specific implementation method is as follows:
硬件电路设计hardware circuit design
1.1单片机模块1.1 MCU module
系统采用TI公司生产的16位超低功耗与高强处理能力微控制器MSP430F169控制硬件系统。该芯片采用“冯诺依曼”结构,它的随机存储内存(RAM)、只读内存(ROM) 和所有外部模块都在相同的地址空间内,寻址范围和时钟频率分别可达到62KB与8MHz。而且它的内部包含2个定时器、12位ADC与2个UART口和48个I/O口等,所以能快速地完成对外部传感器的初始化与应用。The system adopts the 16-bit ultra-low power consumption and high processing capability microcontroller MSP430F169 produced by TI to control the hardware system. The chip adopts "von Neumann" structure, its random access memory (RAM), read only memory (ROM) and all external modules are in the same address space, the addressing range and clock frequency can reach 62KB and 8MHz respectively . And it contains 2 timers, 12-bit ADC, 2 UART ports and 48 I/O ports, etc., so it can quickly complete the initialization and application of external sensors.
本系统的传感器采集数据通过IIC总线传输,IIC总线是一种串行数据总线,它只有两根双向信号线,分别是双向的数据线SDA和双向时钟线SCL,数据线是用来传输数据,时钟线是用来传输时钟脉冲。微控制器是整个设计中的最核心的部分,是由晶振电路(本系统采用8MHZ)和复位电路组成。MSP430F169最小系统如图3所示。The data collected by the sensor of this system is transmitted through the IIC bus. The IIC bus is a serial data bus. It has only two bidirectional signal lines, which are the bidirectional data line SDA and the bidirectional clock line SCL. The data line is used to transmit data. The clock line is used to transmit clock pulses. Microcontroller is the core part of the whole design, which is composed of crystal oscillator circuit (this system adopts 8MHZ) and reset circuit. The MSP430F169 minimum system is shown in Figure 3.
1.2 MPU-6050检测模块1.2 MPU-6050 detection module
MPU6050作为全球第一例9轴运动处理传感器,具有高度集成化的特点,内部包含MEMS陀螺仪和加速度计,并且测得的运动数据直接以数字量输出。本传感器集成的陀螺仪测量范围为±250、±500、±1000、±2000°/秒(dps),加速度计测量范围为± 2、±4、±8、±16g,可根据实际需要选择测量范围。As the world's first 9-axis motion processing sensor, the MPU6050 is highly integrated. It contains a MEMS gyroscope and an accelerometer, and the measured motion data is directly output in digital form. The measurement range of the gyroscope integrated in this sensor is ±250, ±500, ±1000, ±2000°/second (dps), and the measurement range of the accelerometer is ±2, ±4, ±8, ±16g, which can be selected according to actual needs. scope.
MPU6050的管脚XDA、XCL不与单片机相连,管脚GND与单片机MSP430F169共地,管脚VCC连接到单片机的3.3V引脚,SDA引脚连接单片机P2.1口,SCL引脚连接单片机P2.0端。MSP430F169通过IIC总线与MPU-6050进行串行通信,将采集的运动数据传输到PC端。MPU6050传感器电路如图4所示,当MPU6050正常工作时,发光二极管会发出黄绿色的光。The pins XDA and XCL of MPU6050 are not connected to the microcontroller, the pin GND shares the ground with the microcontroller MSP430F169, the pin VCC is connected to the 3.3V pin of the microcontroller, the SDA pin is connected to the microcontroller P2.1 port, and the SCL pin is connected to the microcontroller P2. 0 terminal. MSP430F169 communicates with MPU-6050 serially through IIC bus, and transmits the collected motion data to PC. The sensor circuit of MPU6050 is shown in Figure 4. When the MPU6050 is working normally, the LED will emit yellow-green light.
1.3 LCD显示电路1.3 LCD display circuit
12864液晶屏是一种采用低功耗CMOS技术实现的点阵图形LCD模块,具有显示零辐射、低功耗、屏幕调节方便、画面稳定等特点。12864液晶屏内部含有KS0108B/HD61202 控制器,通过内部的128×64位映射DDRAM,完成128点、64点显示,内置国际化简体中文字库。系统工作时,12864液晶屏实时显示X、Y、Z方向加速度、角度信息。12864 液晶屏显示电路如图5所示。The 12864 LCD screen is a dot-matrix graphic LCD module realized by low-power CMOS technology. It has the characteristics of zero radiation display, low power consumption, convenient screen adjustment, and stable picture. The 12864 LCD screen contains the KS0108B/HD61202 controller, which can display 128 points and 64 points through the internal 128×64-bit mapping DDRAM, and has a built-in international simplified Chinese character library. When the system is working, the 12864 LCD screen displays X, Y, Z direction acceleration and angle information in real time. The 12864 LCD display circuit is shown in Figure 5.
1.4 PL2303串口模块1.4 PL2303 serial port module
串口通信模块采用PL2303HX芯片,即PL2303USB TO TTL模块,是一种RS232-USB接口转换器,能使RS232全双工异步串行通信设备方便地和USB功能接口连接。该模块内部包含USB功能控制器、收发器、振荡器,能够实现USB信号与RS232信号的转换。该器件作为USB/RS232双向转换器,对USB数据格式与RS232信息流格式进行互换。 PL2303的通讯波特率高达6Mb/s,具有强大的高兼容驱动能力,能在众多操作系统上模拟成传统COM端口,从而可简便地转换成USB接口应用。The serial communication module adopts PL2303HX chip, namely PL2303USB TO TTL module, which is a kind of RS232-USB interface converter, which enables RS232 full-duplex asynchronous serial communication equipment to be conveniently connected with the USB function interface. The module contains USB function controller, transceiver and oscillator, which can realize the conversion of USB signal and RS232 signal. As a USB/RS232 bidirectional converter, the device can exchange USB data format and RS232 information flow format. The communication baud rate of PL2303 is as high as 6Mb/s, and it has a powerful and highly compatible drive capability. It can be simulated as a traditional COM port on many operating systems, so that it can be easily converted into a USB interface application.
系统将PL2303HX芯片的+5V连接到单片机的+5V引脚,且共地。PL2303HX芯片的RXD引脚连接到MSP430F169的TXD即P3.4引脚,TXD引脚连接到MSP430F169的RXD 即P3.5引脚。系统传输数据时,采集的运动数据实时由PL2303串口传输到PC端的串口调试助手并保存。PL2303HX串口模块电路如图6所示。The system connects the +5V of the PL2303HX chip to the +5V pin of the single-chip microcomputer, and shares the ground. The RXD pin of the PL2303HX chip is connected to the TXD pin of the MSP430F169, that is, the P3.4 pin, and the TXD pin is connected to the RXD pin of the MSP430F169, that is, the P3.5 pin. When the system transmits data, the collected motion data is transmitted in real time by the PL2303 serial port to the serial port debugging assistant on the PC side and saved. The PL2303HX serial port module circuit is shown in Figure 6.
软件设计software design
系统的单片机运行程序是C语言编写,包括主程序、MPU6050初始化数据读取程序、零偏校准程序、LCD显示程序、串口通信程序等。而上位机执行算法是MATLAB程序,包括消除随机误差的Kalman算法、加速度积分算法、轨迹绘图。The operating program of the single-chip microcomputer of the system is written in C language, including the main program, the MPU6050 initialization data reading program, the zero offset calibration program, the LCD display program, and the serial port communication program. The execution algorithm of the host computer is a MATLAB program, including the Kalman algorithm to eliminate random errors, the acceleration integration algorithm, and the trajectory drawing.
根据MPU6050的寄存器读写函数,对传感器进行初始化,主要是参数配置,如采样率、滤波频率等,如无特殊要求使用典型值。在程序中,通过调用MPU6050_Get_Data() 函数获取运动数据信息,如MPU6050_Get_Data(GYRO_ZOUT_H)表示读取16位Z轴角速度数据。According to the register read and write function of MPU6050, initialize the sensor, mainly parameter configuration, such as sampling rate, filter frequency, etc. If there is no special requirement, use the typical value. In the program, the motion data information is obtained by calling the MPU6050_Get_Data() function. For example, MPU6050_Get_Data(GYRO_ZOUT_H) means reading 16-bit Z-axis angular velocity data.
为消除静态误差,读取200次加速度的值,取平均值对原始数据进行校正。然后,通过调用RS232_jiao()、RS232_jia()和Display10BitData()函数将运动数据显示到12864显示屏并传输到PC端。单片机主程序流程如图7所示。In order to eliminate static errors, the acceleration values were read 200 times, and the average value was taken to correct the original data. Then, by calling RS232_jiao(), RS232_jia() and Display10BitData() functions, the motion data is displayed on the 12864 display and transmitted to the PC. The main program flow of the single-chip microcomputer is shown in Figure 7.
PC端数据处理软件主要功能为:对接收到的运动数据进行Kalman滤波,通过对加速度值做两次积分运算来实时获得运动过程中的位置坐标点,用程序绘制运动轨迹。 PC端数据处理算法以MATLAB程序编写,数据处理算法流程如图8所示。The main functions of the PC-side data processing software are: perform Kalman filtering on the received motion data, obtain real-time position coordinate points during the motion process by integrating the acceleration value twice, and use the program to draw the motion trajectory. The PC-side data processing algorithm is written in MATLAB program, and the data processing algorithm flow is shown in Figure 8.
Kalman滤波方法,包括以下步骤:The Kalman filtering method includes the following steps:
预测阶段为:假设此时为k时刻,首先根据状态系统模型,可以基于系统上一时刻的状况而预计出当下的状态方程:The prediction stage is: Assuming that it is time k, first, according to the state system model, the current state equation can be predicted based on the state of the system at the previous moment:
X(k|k-1)=AX(k-1|k-1)+BU(k) (9)X(k|k-1)=AX(k-1|k-1)+BU(k) (9)
式(9)中,X(k|k-1)是通过上一时刻的状态估计得到的当下状态,X(k-1|k-1) 是上一时刻最优的预计值,U(k)是此刻对系统的控制量。In formula (9), X(k|k-1) is the current state estimated by the state at the previous moment, X(k-1|k-1) is the optimal predicted value at the previous moment, U(k ) is the amount of control over the system at the moment.
预测阶段也对估计值精确程度进行预计。系统状态的协方差也就是预计值,如式(10)所示:The forecast stage also predicts how accurate the estimates will be. The covariance of the system state is also the expected value, as shown in equation (10):
P(k|k-1)=AP(k-1|k-1)AT+Q (10)P(k|k-1)=AP(k-1|k-1)A T +Q (10)
式(10)中,P(k-1|k-1)是X(k|k-1)的协方差,P(k-1|k-1)是X(k-1|k-1)的协方差。In formula (10), P(k-1|k-1) is the covariance of X(k|k-1), P(k-1|k-1) is X(k-1|k-1) covariance of .
更新阶段为:已知目前状况的估计值,再结合当前状况的观测值,可得当前状况的最优化估计值:The update stage is: the estimated value of the current situation is known, and then combined with the observed value of the current situation, the optimal estimated value of the current situation can be obtained:
X(k|k)=X(k|k-1)+Kg(k)[Z(k)-HX(k|k-1)] (11)X(k|k)=X(k|k-1)+Kg(k)[Z(k)-HX(k|k-1)] (11)
其中的Kg,就是Kalman增益(Kalman Gain),它可以因为不同的时刻而不断改变自身的值:Among them, Kg is the Kalman Gain, which can continuously change its own value due to different moments:
Kg(k)=P(k|k-1)HT/[HP(k|k-1)HT+R] (12)Kg(k)=P(k|k-1)H T /[HP(k|k-1)H T +R] (12)
虽然现在已经得到k时刻系统状态最优的预计值X(k|k),但是还需要更新 P(k|k)来保证Kalman滤波过程能循环工作到最终。Although the optimal predicted value X(k|k) of the system state at time k has been obtained, P(k|k) needs to be updated to ensure that the Kalman filtering process can work cyclically to the end.
P(k|k)=[I-Kg(k)H]P(k|k-1) (13)P(k|k)=[I-Kg(k)H]P(k|k-1) (13)
I为单位矩阵。随机线性离散系统Kalman滤波的基本步骤就是依靠以上5个公式完成的。I is the identity matrix. The basic steps of Kalman filtering of random linear discrete systems are completed by relying on the above five formulas.
当检测模块完成对物体运动数据的采集后,采用串口模块传输数据给PC端的串口调试助手,获得实时测量的加速度与角速度参数,并保存为“AccDataok.txt”文件。 PC端即可执行MATLAB程序对数据进行处理,并绘出目标运动轨迹曲线。When the detection module completes the collection of object motion data, the serial port module is used to transmit the data to the serial port debugging assistant on the PC side to obtain the real-time measured acceleration and angular velocity parameters, and save them as "AccDataok.txt" file. The MATLAB program can be executed on the PC side to process the data and draw the target motion trajectory curve.
实验结果与分析Experimental results and analysis
测试实验时,将MPU6050传感器水平放置,Z轴方向垂直于水平面,X与Y轴与水平面平行。MSP430F169通过PL2303HX串口与PC端相连,打开串口调试助手,设置串口波特率为9600,串口选择与电脑设备管理器中的串口号一致。手持传感器在水平面 1m2范围内做曲线移动。系统以125Hz采样频率采集的13组运动数据如表1所示,第一、二、三列分别为X、Y、Z方向的加速度值,单位为g;第四、五、六列分别为X、Y、Z 方向的角速度值,单位为dps。During the test experiment, the MPU6050 sensor is placed horizontally, the Z axis is perpendicular to the horizontal plane, and the X and Y axes are parallel to the horizontal plane. MSP430F169 is connected to the PC through the PL2303HX serial port, open the serial port debugging assistant, set the serial port baud rate to 9600, and the serial port selection is consistent with the serial port number in the computer device manager. The hand-held sensor moves in a curve within 1m 2 of the horizontal plane. The 13 sets of motion data collected by the system with a sampling frequency of 125Hz are shown in Table 1. The first, second, and third columns are the acceleration values in the X, Y, and Z directions, and the unit is g; the fourth, fifth, and sixth columns are X, respectively. , Y, Z direction angular velocity value, the unit is dps.
表1Table 1
采集的运动数据存在一些噪声干扰,如传感器自身误差、系统随机误差等,降低了数据的准确性。因此,通过卡尔曼滤波消除加速度数据中的干扰,得到更加准确的数据,卡尔曼滤波前后的加速度数据对比如图9所示。There are some noise interferences in the collected motion data, such as sensor error, system random error, etc., which reduces the accuracy of the data. Therefore, the interference in the acceleration data is eliminated by Kalman filtering to obtain more accurate data. The comparison of acceleration data before and after Kalman filtering is shown in Figure 9.
对滤波后的加速度数据进行二次积分,得到三维空间目标的运动路径如图10所示,目标物在水平面做曲线运动,追踪轨迹和实际运动轨迹基本一致。The filtered acceleration data is integrated twice, and the motion path of the three-dimensional space target is obtained as shown in Figure 10. The target moves in a curve in the horizontal plane, and the tracking trajectory is basically the same as the actual motion trajectory.
为了检测系统对运动物体位移测量的精度,分别对20cm、50cm、80cm和110cm的位移进行运动测量,且每种距离测量15组,计算平均测量位移及误差如表2所示。In order to detect the accuracy of the displacement measurement of the moving object by the system, the displacements of 20cm, 50cm, 80cm and 110cm were measured respectively, and each distance was measured in 15 groups, and the average measurement displacement and error were calculated as shown in Table 2.
表2Table 2
由表2可知,在对20cm到110cm运动物体位移测量中,平均误差不超过7%,能够比较精确地实现对运动目标物位移的测量。It can be seen from Table 2 that in the measurement of the displacement of the moving object from 20cm to 110cm, the average error does not exceed 7%, and the displacement of the moving object can be measured more accurately.
Claims (5)
Priority Applications (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201821174082.1U CN208621076U (en) | 2018-07-24 | 2018-07-24 | A moving target trajectory tracking system |
Applications Claiming Priority (1)
Application Number | Priority Date | Filing Date | Title |
---|---|---|---|
CN201821174082.1U CN208621076U (en) | 2018-07-24 | 2018-07-24 | A moving target trajectory tracking system |
Publications (1)
Publication Number | Publication Date |
---|---|
CN208621076U true CN208621076U (en) | 2019-03-19 |
Family
ID=65706961
Family Applications (1)
Application Number | Title | Priority Date | Filing Date |
---|---|---|---|
CN201821174082.1U Expired - Fee Related CN208621076U (en) | 2018-07-24 | 2018-07-24 | A moving target trajectory tracking system |
Country Status (1)
Country | Link |
---|---|
CN (1) | CN208621076U (en) |
Cited By (1)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109029459A (en) * | 2018-07-24 | 2018-12-18 | 南京信息工程大学 | A kind of movement objective orbit tracing system and the calculation method based on the system |
-
2018
- 2018-07-24 CN CN201821174082.1U patent/CN208621076U/en not_active Expired - Fee Related
Cited By (2)
Publication number | Priority date | Publication date | Assignee | Title |
---|---|---|---|---|
CN109029459A (en) * | 2018-07-24 | 2018-12-18 | 南京信息工程大学 | A kind of movement objective orbit tracing system and the calculation method based on the system |
CN109029459B (en) * | 2018-07-24 | 2023-07-21 | 南京信息工程大学 | A moving target trajectory tracking system and a calculation method based on the system |
Similar Documents
Publication | Publication Date | Title |
---|---|---|
CN106445130B (en) | A kind of motion capture gloves and its calibration method for gesture identification | |
CN108268129B (en) | Method and apparatus for calibrating a plurality of sensors on a motion capture glove and motion capture glove | |
CN206709853U (en) | Drawing system is synchronously positioned and builds in a kind of multi-rotor unmanned aerial vehicle room | |
US12229991B2 (en) | Image display method and apparatus, computer device, and storage medium | |
CN102608351B (en) | Detection method and system of three-dimensional gesture of mechanical arm and system controlling mechanical arm to operate | |
CN107168515A (en) | The localization method and device of handle in a kind of VR all-in-ones | |
CN106125769A (en) | A kind of wireless head movement design of follow-up system method | |
JP2022008987A (en) | Tracking of position and orientation of virtual controller in virtual reality system | |
CN106873787A (en) | A kind of gesture interaction system and method for virtual teach-in teaching | |
Zhilenkov et al. | Based on MEMS sensors man-machine interface for mechatronic objects control | |
CN111899276A (en) | SLAM method and system based on binocular event camera | |
CN102156586A (en) | Electronic drawing board capable of displaying handwriting synchronously | |
CN103977539A (en) | Cervical vertebra rehabilitation and health care training aiding system | |
CN108759822B (en) | Mobile robot 3D positioning system | |
CN103278162A (en) | CPCI bus-based rotary strapdown system hardware platform and navigation calculation method therefor | |
CN109029459B (en) | A moving target trajectory tracking system and a calculation method based on the system | |
CN112720476A (en) | Mechanical arm control method, mechanical arm control device, medium and electronic equipment | |
CN104515532A (en) | Human motion simulation apparatus based on bluetooth | |
WO2018064634A1 (en) | Determination of cursor position on remote display screen based on bluetooth angle of arrival | |
CN208621076U (en) | A moving target trajectory tracking system | |
CN107478222A (en) | A kind of wireless wearable human attitude monitoring system based on MEMS technology | |
CN116443028A (en) | Head posture data acquisition system and method | |
CN106643601B (en) | The sextuple measurement method of parameters of industrial robot dynamic | |
CN114266876B (en) | Positioning method, visual map generation method and device | |
CN111782064A (en) | 6DOF tracking system for moving type wireless positioning |
Legal Events
Date | Code | Title | Description |
---|---|---|---|
GR01 | Patent grant | ||
GR01 | Patent grant | ||
CF01 | Termination of patent right due to non-payment of annual fee | ||
CF01 | Termination of patent right due to non-payment of annual fee |
Granted publication date: 20190319 Termination date: 20210724 |