From 4387a506e843776792602e6cbf9c11270671dafa Mon Sep 17 00:00:00 2001 From: 95384 <664090429@qq.com> Date: Fri, 22 Nov 2024 18:35:31 +0800 Subject: [PATCH] =?UTF-8?q?=E4=BF=AE=E6=94=B9=E6=8E=A2=E5=A4=B4=E9=97=B4?= =?UTF-8?q?=E5=A3=B0=E9=9F=B3=E4=BC=A0=E6=92=AD=E8=B7=9D=E7=A6=BB=E4=B8=BA?= =?UTF-8?q?115.12=EF=BC=8Ctof=E5=87=8F=E5=B0=8F2us?= MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit --- App/Inc/anemometer_dev.h | 7 ++++++- App/Src/anemometer_dev.c | 8 ++++---- 2 files changed, 10 insertions(+), 5 deletions(-) diff --git a/App/Inc/anemometer_dev.h b/App/Inc/anemometer_dev.h index 7039dec..8e17b96 100644 --- a/App/Inc/anemometer_dev.h +++ b/App/Inc/anemometer_dev.h @@ -38,8 +38,13 @@ #define DRIVE_NUM 2 + // 传播距离 风速计算公式中的L参数 -#define DISTANCE ((float32_t)120000.0) +//探头表面距离115.12mm(57.56mm*2),换能器探头到探头表面距离暂定2mm(1mm*2) +//#define DISTANCE ((float32_t)115120.0 + (float32_t)2000.0) +#define DISTANCE ((float32_t)115120.0) +// 传播距离 风速计算公式中的L参数 +//#define DISTANCE ((float32_t)120000.0) // 富奥通结构 L = 118946 // #define DISTANCE 118946 diff --git a/App/Src/anemometer_dev.c b/App/Src/anemometer_dev.c index 4c96eba..86df5c6 100644 --- a/App/Src/anemometer_dev.c +++ b/App/Src/anemometer_dev.c @@ -434,8 +434,8 @@ void wind_task(void const * argument) tof_error_log_NS = 0; g_error_log.tof_error_NS = 0; // 计算成us - tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.0001f; - tofy = ((tofy-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.0001f; + tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.0001f - 2.0; + tofy = ((tofy-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.0001f - 2.0; // 通过各通道渡越时间求时间差 dtof = tofx-tofy; @@ -492,8 +492,8 @@ void wind_task(void const * argument) tof_error_log_WE = 0; g_error_log.tof_error_WE = 0; // 计算成us - tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.000001f; - tofy = ((tofy-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.000001f; + tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.000001f - 2.0; + tofy = ((tofy-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.000001f - 2.0; // 通过各通道渡越时间求时间差 dtof = tofx-tofy;