PX4 / PX4-Autopilot

PX4 Autopilot Software
https://px4.io
BSD 3-Clause "New" or "Revised" License
8.23k stars 13.39k forks source link

Airspeed sensor calibration only checks the piping polarity #17576

Open roman-dvorak opened 3 years ago

roman-dvorak commented 3 years ago

Describe the bug I tried to use our TFSLOT sensor with PX4 at our TF-G2/4s and we encountered several problems. The TFASPDIMU sensor board has a fixed SDP33 diff pressure sensor. And a positive speed value causes negative pressure in the pressure sensor. And because of that, I was not able to do a normal calibration.

After examining the callibration code, I found that the calibration only detects the correct connection of the sensor. In case of negative pressure it will end.

Subsequently, I compared Airspeed via TFSLOT and from GPS. There I obtained this measurements: 184701903_463658914868377_3073502775184222893_n

It is necessary to add a constant into the calculation of airspeed, which will depend on the TFSLOT profile.

Expected behavior Expected behavior is that the autopilot remembers the measured polarity and this will multiply the pressure obtained form pressure sensor. For example, in the form of a parameter.

Additional context

  1. Calibration i have solved with blowing from behind of TFSLOT (TFSLOT it allows against pittot tube). The autopilot thinks it's OK.
  2. And for calculation of airspeed I have created this modifications of FW: https://github.com/ThunderFly-aerospace/PX4Firmware/commit/c6d93979bf7ab55e949f5726aaf129ea280d32a9

I created a new profile for calculation of airspeed from TFSLOT, which is turned on by a new value in the parameter CAL_AIR_CMODEL This profile is almost same as profile for pitot tube. But diff pressure is negated.

Questions

dagar commented 3 years ago

What if we simply expose the differential scale factor calibration and allow it to be negative?

roman-dvorak commented 3 years ago

Hi, yes, it sounds good. I saw this parameter. But I wasn't sure if it would affect (break) something else.

Do you mean that this parameter well be automatically negated during the calibration with a negative pressure? Should I do it?