为了减少传统的相位差超声动态测距的复杂性,提出了一种基于直接数字解调的信号处理方法。运用STM32内部两路A/D同步采集超声测量信号与参考信号,对这两组信号数据通过最小二乘椭圆拟合方法,计算[??;]单周期范围内的实时相位差。在此基础上,对实时相位差进行解包裹运算,得到绝对相位差。最后,通过绝对相位差的变化量与距离变化量成正比的关系,计算出实时的动态变化距离值。实验结果表明:当目标速度不超过2.5m/s时,该方法能够准确地将距离值直接解调出来,满足动态变化条件下跟踪测距要求。
In order to simplify the traditional dynamic ultrasonic distance measurement system by phase difference, a signal-processing method based on direct digital demodulation is proposed in this article. Specifically,two internal A/D of the STM32 are used to collect the ultrasonic metrical signal and reference signal synchronously. Then the two sets of signal data are fitted using the least square ellipse fitting method in order to calculate the real-time phase difference in one-period([??; ]). Based on the real-time phase difference, the absolute phase difference can be calculated, using the unwrapping algorithm. Finally, the real time dynamic changing of distance is obtained base on the proportion relationship between the change of phase difference and the change of distance. The results of the experiment indicate that when the speed of the target is less than 2.5 m/s, the method proposed in this article can accurately track the change of distance, which meets the requirement of dynamic distance tracking and calculating.