ardupilot icon indicating copy to clipboard operation
ardupilot copied to clipboard

AUAV Airspeed Sensor Driver

Open Tdogb opened this issue 1 year ago • 9 comments

Drivers for the Amphenol AUAV airspeed sensor. This is a relatively new UAV specific airspeed sensor. I don't know why Amphenol didn't write their own Ardupilot drivers, but I did it for them since this looks like a really awesome sensor.

https://www.mouser.com/new/amphenol/amphenol-auav-air-speed-altitude-sensors/

Tdogb avatar Aug 10 '24 02:08 Tdogb

These actually provide absolute pressure measurement too.

MallikarjunSE avatar Aug 10 '24 03:08 MallikarjunSE

These actually provide absolute pressure measurement too.

Nice! Although I'm going to leave that to someone else to implement if they want :)

Tdogb avatar Aug 10 '24 04:08 Tdogb

Ping @Tdogb - also needs to pass CI :-)

peterbarker avatar Aug 20 '24 20:08 peterbarker

Hey guys, I think it would be super cool to implement the absolute pressure sensing capability. Does anyone have strong opinions on how this is implemented? I don't want someone to unknowingly have it override their baro

Tdogb avatar Aug 20 '24 21:08 Tdogb

Hey guys, I think it would be super cool to implement the absolute pressure sensing capability. Does anyone have strong opinions on how this is implemented? I don't want someone to unknowingly have it override their baro

Maybe do that as a second stage?

I'll mark this for DevCallEU so we think about your question anyway. We do have some precendents for detecting something as two different sensor types.

peterbarker avatar Aug 21 '24 03:08 peterbarker

just as an airspeed sensor initially is the way to go

tridge avatar Aug 21 '24 09:08 tridge

@Tdogb did you need assistance on this one, or still plugging away at it?

peterbarker avatar Sep 11 '24 11:09 peterbarker

@peterbarker i tried this pr. Was able to get differential pressure output. But temperature didn't work for me.

MallikarjunSE avatar Sep 11 '24 12:09 MallikarjunSE

@peterbarker i tried this pr. Was able to get differential pressure output. But temperature didn't work for me.

Temperature is compensated for but the real temperature value isn't read because there isn't documentation on it.

I had accidentally pushed some other dev code I have to this branch so I removed it.

Tdogb avatar Sep 22 '24 20:09 Tdogb

@MallikarjunSE @Tdogb I've force pushed some fixes:

  • temperature now works
  • supports 3 pressure ranges
  • removed the absolute code
  • use 8x sampling for lower noise

I've bench tested buy not flight tested. Please test!

tridge avatar Jan 30 '25 08:01 tridge

@MallikarjunSE @Tdogb I've force pushed some fixes:

  • temperature now works
  • supports 3 pressure ranges
  • removed the absolute code
  • use 8x sampling for lower noise

I've bench tested buy not flight tested. Please test!

Hey @tridge Tested L10D on DroneCAN periph device. Works! Will test L30D in sometime. Thank you! image

MallikarjunSE avatar Jan 30 '25 09:01 MallikarjunSE

@tridge tested on L30D. Works! image

MallikarjunSE avatar Jan 30 '25 12:01 MallikarjunSE

Hey @tridge below is temperature comparison between DroneCAN periph vs I2C directly plugged in. Temperature update rate seems to be too low on DroneCAN? Or it's sufficient?

image

MallikarjunSE avatar Jan 30 '25 19:01 MallikarjunSE

Temperature update rate seems to be too low on DroneCAN? Or it's sufficient?

the reason the graph looks weird is the DroneCAN RawAirData message uses a float16 for temperature, which means it doesn't have much resolution. It is sufficient for how it is used though

tridge avatar Jan 30 '25 19:01 tridge

Thanks for helping push this across the finish line guys!

I have some code on my personal branch for absolute pressure, however, I've been running into issues with the sensor not acking some of the calibration coefficients. Looking at it on the scope makes it seem like an issue with the sensor itself.

Tdogb avatar Jan 30 '25 20:01 Tdogb

@Tdogb @MallikarjunSE I've changed it to require ARSPD_BUS to be set correctly, which is how other drivers work except for the MS4525 (which was a legacy compatibility hack) I've also added status checking so the probe is more reliable, and ensures that we don't use invalid data

tridge avatar Feb 03 '25 03:02 tridge

@Tdogb @MallikarjunSE I've changed it to require ARSPD_BUS to be set correctly, which is how other drivers work except for the MS4525 (which was a legacy compatibility hack) I've also added status checking so the probe is more reliable, and ensures that we don't use invalid data

Tested with CubeOrange and Periph device and works. I2C bus selection works as expected. Previously it used to probe without setting bus number. Now works with bus number set correctly. image

MallikarjunSE avatar Feb 03 '25 10:02 MallikarjunSE

tested it with L05D on the bench with Pix32 v6 and Matek L431-Cannode. Seems to work very good. Comparisons with DLVR sensor and with a reference pressure system planned in the near future.

I did my own driver integration of this airspeed sensor to learn how to do that. I was not that far off, so thanks a lot for the code to compare, correct and learn!

I would love to participate in the barometer integration as much as i can. (limited) As far as i understand, the barometer option of the board are as of now hardcoded in the hwdef file. So there would be a easy way to implement this sensor for an AP_Periph device that ships with this sensors, but this does notwork for flexible selection of sensors in the Autopilot Parameter list.

I hope to be more present in the upcoming devtalks.

criegit avatar Feb 26 '25 16:02 criegit

I have done a PR to add a baro driver. https://github.com/ArduPilot/ardupilot/pull/29535

However, my sensor always fails to read the extended calibration coefficients for that channel despite working fine on the differential channel. I can do builds if anyone else wants to give it a try.

IamPete1 avatar Mar 15 '25 21:03 IamPete1

I have done a PR to add a baro driver. https://github.com/ArduPilot/ardupilot/pull/29535

However, my sensor always fails to read the extended calibration coefficients for that channel despite working fine on the differential channel. I can do builds if anyone else wants to give it a try.

I have independently written a driver for abs pressure and have ran into the exact issue. Putting it on the scope the fc is outputting the correct command but the sensor just doesn't respond, it seems like an issue with the sensor itself.

Tdogb avatar Mar 15 '25 21:03 Tdogb

I have independently written a driver for abs pressure and have ran into the exact issue. Putting it on the scope the fc is outputting the correct command but the sensor just doesn't respond, it seems like an issue with the sensor itself.

I'm not going crazy then! I did find that it works fine if we just don't bother with the extended calibration. Maybe that is a solution, but it is certainly strange.

I did notice the other team has a driver, I wonder if it works there. https://github.com/PX4/PX4-Autopilot/blob/main/src/drivers/differential_pressure/auav/AUAV.cpp

IamPete1 avatar Mar 15 '25 21:03 IamPete1

@Tdogb I now have the baro driver working. It turns out its very sensitive to timings because its clocked much slower than the differential channel for some reason. https://github.com/ArduPilot/ardupilot/pull/29535

IamPete1 avatar Apr 20 '25 22:04 IamPete1