修改了风速计算公式
This commit is contained in:
parent
4387a506e8
commit
9d53c5dae7
|
@ -42,6 +42,7 @@
|
||||||
// 传播距离 风速计算公式中的L参数
|
// 传播距离 风速计算公式中的L参数
|
||||||
//探头表面距离115.12mm(57.56mm*2),换能器探头到探头表面距离暂定2mm(1mm*2)
|
//探头表面距离115.12mm(57.56mm*2),换能器探头到探头表面距离暂定2mm(1mm*2)
|
||||||
//#define DISTANCE ((float32_t)115120.0 + (float32_t)2000.0)
|
//#define DISTANCE ((float32_t)115120.0 + (float32_t)2000.0)
|
||||||
|
//探头表面距离115.12mm(57.56mm*2),换能器内部2mm速度2000,时间算2us减在tof上
|
||||||
#define DISTANCE ((float32_t)115120.0)
|
#define DISTANCE ((float32_t)115120.0)
|
||||||
// 传播距离 风速计算公式中的L参数
|
// 传播距离 风速计算公式中的L参数
|
||||||
//#define DISTANCE ((float32_t)120000.0)
|
//#define DISTANCE ((float32_t)120000.0)
|
||||||
|
|
|
@ -434,13 +434,15 @@ void wind_task(void const * argument)
|
||||||
tof_error_log_NS = 0;
|
tof_error_log_NS = 0;
|
||||||
g_error_log.tof_error_NS = 0;
|
g_error_log.tof_error_NS = 0;
|
||||||
// 计算成us
|
// 计算成us
|
||||||
tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.0001f - 2.0;
|
tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.0001f - 2.0f;
|
||||||
tofy = ((tofy-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.0f;
|
||||||
// 通过各通道渡越时间求时间差
|
// 通过各通道渡越时间求时间差
|
||||||
dtof = tofx-tofy;
|
dtof = tofx-tofy;
|
||||||
|
|
||||||
weather_info.wind_c = DISTANCE/2.0f*(1.0f/tofx+1.0f/tofy);
|
weather_info.wind_c = DISTANCE/2.0f*(1.0f/tofx+1.0f/tofy);
|
||||||
weather_info.wind_velocity_x = 0-DISTANCE*dtof/1.41422f/tofx/tofx;
|
// weather_info.wind_velocity_x = 0-DISTANCE*dtof/1.41422f/tofx/tofx;
|
||||||
|
// 修正公式
|
||||||
|
weather_info.wind_velocity_x = 0-DISTANCE*dtof/1.41422f/tofx/tofy;
|
||||||
}
|
}
|
||||||
|
|
||||||
// 通道3 通道4 测试东西风速
|
// 通道3 通道4 测试东西风速
|
||||||
|
@ -492,13 +494,15 @@ void wind_task(void const * argument)
|
||||||
tof_error_log_WE = 0;
|
tof_error_log_WE = 0;
|
||||||
g_error_log.tof_error_WE = 0;
|
g_error_log.tof_error_WE = 0;
|
||||||
// 计算成us
|
// 计算成us
|
||||||
tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.000001f - 2.0;
|
tofx = ((tofx-FIR_PHASE_DELAY)/ADC_SAMP_RATE_MHz)+REV_MUTE_DELAY_US-1.0f/DRIVE_FREQ_MHz+0.000001f - 2.0f;
|
||||||
tofy = ((tofy-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.0f;
|
||||||
// 通过各通道渡越时间求时间差
|
// 通过各通道渡越时间求时间差
|
||||||
dtof = tofx-tofy;
|
dtof = tofx-tofy;
|
||||||
|
|
||||||
weather_info.wind_c = DISTANCE/2.0f*(1.0f/tofx+1.0f/tofy);
|
weather_info.wind_c = DISTANCE/2.0f*(1.0f/tofx+1.0f/tofy);
|
||||||
weather_info.wind_velocity_y = DISTANCE*dtof/1.41422f/tofx/tofx;
|
// weather_info.wind_velocity_y = DISTANCE*dtof/1.41422f/tofx/tofx;
|
||||||
|
// 修正公式
|
||||||
|
weather_info.wind_velocity_y = DISTANCE*dtof/1.41422f/tofx/tofy;
|
||||||
}
|
}
|
||||||
|
|
||||||
weather_info.wind_velocity = sqrtf(weather_info.wind_velocity_x*weather_info.wind_velocity_x + weather_info.wind_velocity_y*weather_info.wind_velocity_y);
|
weather_info.wind_velocity = sqrtf(weather_info.wind_velocity_x*weather_info.wind_velocity_x + weather_info.wind_velocity_y*weather_info.wind_velocity_y);
|
||||||
|
|
|
@ -701,7 +701,7 @@
|
||||||
<data>
|
<data>
|
||||||
<extensions></extensions>
|
<extensions></extensions>
|
||||||
<cmdline></cmdline>
|
<cmdline></cmdline>
|
||||||
<hasPrio>1</hasPrio>
|
<hasPrio>232</hasPrio>
|
||||||
<buildSequence>inputOutputBased</buildSequence>
|
<buildSequence>inputOutputBased</buildSequence>
|
||||||
</data>
|
</data>
|
||||||
</settings>
|
</settings>
|
||||||
|
|
Loading…
Reference in New Issue