mirror of
https://github.com/iNavFlight/inav.git
synced 2025-07-23 16:25:26 +03:00
Debug mode for pitot meter
This commit is contained in:
parent
127542c4d3
commit
c12163930d
3 changed files with 8 additions and 1 deletions
|
@ -52,5 +52,6 @@ typedef enum {
|
||||||
DEBUG_FW_CLIMB_RATE_TO_ALTITUDE,
|
DEBUG_FW_CLIMB_RATE_TO_ALTITUDE,
|
||||||
DEBUG_RANGEFINDER,
|
DEBUG_RANGEFINDER,
|
||||||
DEBUG_RANGEFINDER_QUALITY,
|
DEBUG_RANGEFINDER_QUALITY,
|
||||||
|
DEBUG_PITOT,
|
||||||
DEBUG_COUNT
|
DEBUG_COUNT
|
||||||
} debugType_e;
|
} debugType_e;
|
||||||
|
|
|
@ -331,7 +331,8 @@ static const char * const lookupTableDebug[DEBUG_COUNT] = {
|
||||||
"NAV_LANDING",
|
"NAV_LANDING",
|
||||||
"FW_ALTITUDE",
|
"FW_ALTITUDE",
|
||||||
"RFIND",
|
"RFIND",
|
||||||
"RFIND_Q"
|
"RFIND_Q",
|
||||||
|
"PITOT"
|
||||||
};
|
};
|
||||||
|
|
||||||
#ifdef TELEMETRY_LTM
|
#ifdef TELEMETRY_LTM
|
||||||
|
|
|
@ -203,9 +203,11 @@ uint32_t pitotUpdate(void)
|
||||||
case PITOTMETER_NEEDS_CALCULATION:
|
case PITOTMETER_NEEDS_CALCULATION:
|
||||||
pitot.dev.get();
|
pitot.dev.get();
|
||||||
pitot.dev.calculate(&pitotPressure, &pitotTemperature);
|
pitot.dev.calculate(&pitotPressure, &pitotTemperature);
|
||||||
|
DEBUG_SET(DEBUG_PITOT, 0, pitotPressure);
|
||||||
if (pitotmeterConfig()->use_median_filtering) {
|
if (pitotmeterConfig()->use_median_filtering) {
|
||||||
pitotPressure = applyPitotmeterMedianFilter(pitotPressure);
|
pitotPressure = applyPitotmeterMedianFilter(pitotPressure);
|
||||||
}
|
}
|
||||||
|
DEBUG_SET(DEBUG_PITOT, 1, pitotPressure);
|
||||||
state = PITOTMETER_NEEDS_SAMPLES;
|
state = PITOTMETER_NEEDS_SAMPLES;
|
||||||
return pitot.dev.delay;
|
return pitot.dev.delay;
|
||||||
break;
|
break;
|
||||||
|
@ -245,6 +247,9 @@ int32_t pitotCalculateAirSpeed(void)
|
||||||
const float indicatedAirspeed_tmp = pitotmeterConfig()->pitot_scale * sqrtf(2.0f * fabsf(pitotPressure - pitotPressureZero) / AIR_DENSITY_SEA_LEVEL_15C);
|
const float indicatedAirspeed_tmp = pitotmeterConfig()->pitot_scale * sqrtf(2.0f * fabsf(pitotPressure - pitotPressureZero) / AIR_DENSITY_SEA_LEVEL_15C);
|
||||||
indicatedAirspeed += pitotmeterConfig()->pitot_noise_lpf * (indicatedAirspeed_tmp - indicatedAirspeed);
|
indicatedAirspeed += pitotmeterConfig()->pitot_noise_lpf * (indicatedAirspeed_tmp - indicatedAirspeed);
|
||||||
|
|
||||||
|
DEBUG_SET(DEBUG_PITOT, 2, indicatedAirspeed_tmp);
|
||||||
|
DEBUG_SET(DEBUG_PITOT, 3, indicatedAirspeed);
|
||||||
|
|
||||||
pitot.airSpeed = indicatedAirspeed * 100;
|
pitot.airSpeed = indicatedAirspeed * 100;
|
||||||
} else {
|
} else {
|
||||||
performPitotCalibrationCycle();
|
performPitotCalibrationCycle();
|
||||||
|
|
Loading…
Add table
Add a link
Reference in a new issue