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;