RPM to Airspeed sensor

Hi, I’m building a plane which will fly at 7m/s. Because of this, I need a very sensitive airspeed sensor. I made my own RPM sensor based on the TFRPM01 RPM sensor.

https://docs.px4.io/master/en/sensor/thunderfly_tachometer.html

Now, i would like to write my own Airspeed driver based on this sensor by merging the RPM-driver and Airspeed-driver. I still want to have a RPM sensor left. The used IC has 2 addresses, but I was wondering what would happen if i accidently put both the RPM and the Airspeed sensor on the same adres in the settings (having both drivers directing to the same RPM sensor board).

Also, could anyone help me on implementing messaging multiple RPM sensors(no coding, just how the drivers interract)

Thnx,
RR

Just wondering how RPM will map to airspeed. If there is any wind all bets are off.

Hi, currently driver does not support multiple instances (respectively it can be run on multiple instances but it will send data into the same message - and in will be chaos). You are right that IC allows having two I2C addresses. But it can be connected into more i2c busses.
I think that there are two ways to solve your problem (support multiple RPM sensors). Second is less correct but easier to implement. The 1st is better related to PX4 standards :slight_smile:

First way

The first way is better for PX4 (it corresponds more to recent PX4 standards). PX4 supprots multi-instance messages. A brief description of this access is here: uORB Messaging | PX4 User Guide

It is also related to the support of multi-instance parameters or allow set I2C address (and other parameters) directly from command line input. This would allow have configuration saved in your own config (start-up) script.

Second way

Add instance parameter into rpm msg. And update PCF8583 driver to count instance number and send it in msg.

Mavlink message RAW_RPM is designed to support carrying instance number. But currently, it is always 0.

If possible, I would not go that way.
Your updates are welcomed. If you have any other questions, ask :slight_smile:

Other solution

We have a solution for measuring airspeed on low-speed vehicles. It is based on the venturi effect (venturi pipe) that results in better accuracy at low speed (compared to pitot). GitHub - ThunderFly-aerospace/TFSLOT01: Airspeed sensor for UAV based on venturi effect.

I’m also very worried about the exact conversion from RPM to airspeed.

i’m using a horizontal axis fixed direction fan based anemometer. the fan’s axis is parrallel with the direction of flight. As such, the airspeed can be calculated from the RMP of the anemometer.

Thnx, im gonna look into the first and second way. The venturi pipe probably won’t work either as the plane would be flying at 7m/s.

The anemometer has a start up speed of around 1.5m/s and is optimised for operation around 7m/s. It measures 4 pulses/rotation using a hall sensor. It would turn at 600RPM(40Hz) at 7m/s.

So, i ended up copying the code of the PCF8583 driver and place it inside the driver/differential_pressure and customize it to send a RPM as differential pressure, which in turn i will edit the lib/airspeed/airspeed.cpp to convert the “differenctial pressure”(rpm) of my sensor to IAS. However, i named everything PCF8583a and now i get this error upon compiling:

In file included from ../../platforms/common/include/px4_platform_common/module_params.h:44,
                 from ../../src/drivers/differential_pressure/PCF8583/PCF8583a.hpp:46,
                 from ../../src/drivers/differential_pressure/PCF8583/PCF8583a.cpp:34:
../../platforms/common/include/px4_platform_common/param.h:67:7: error: 'void PCF8583a::updateParamsImpl()' marked 'final', but is not virtual
   67 |  void updateParamsImpl() final { \
      |       ^~~~~~~~~~~~~~~~
../../platforms/common/include/px4_platform_common/param.h:80:2: note: in expansion of macro '_DEFINE_PARAMETER_UPDATE_METHOD'
   80 |  _DEFINE_PARAMETER_UPDATE_METHOD(__VA_ARGS__)
      |  ^~~~~~~~~~~~~~~~~~~~~~~~~~~~~~~
../../src/drivers/differential_pressure/PCF8583/PCF8583a.hpp:85:2: note: in expansion of macro 'DEFINE_PARAMETERS'
   85 |  DEFINE_PARAMETERS(
      |  ^~~~~~~~~~~~~~~~~
compilation terminated due to -Wfatal-errors.

i don’t know what this means and how i can fix it saidly

The CPP error means you are implementing a function that isn’t meant to be overridden on a subclass, it’s hard to help you w/o actually looking at the code, my recommendation is that you check the sdp3x driver, and try to implement it the same way