Developer

Advances in airspeed handling

3689549422?profile=originalWith the release of the 2.74 version of APM:Plane and the introduction of TECS, the ability of APM to take full advantage of an airspeed sensor for fixed wing aircraft was greatly enhanced. A lot more people are now buying and installing airspeed sensors. APM has had support for airspeed sensors for a long time, but tuning for good airspeed control was somewhat difficult and error prone. Now it is much easier.

The next APM:Plane release will be 2.75, and will come out soon. In that release airspeed sensing will be improved even more, with three key changes.

New Digital Airspeed Sensor

The first change is to add support for a new digital airspeed sensor from Measurement Specialities, the MS4525DO. The PX4 dev team announced this sensor recently, and I've been test flying it to ensure it works well with APM. It does! This new sensor is a huge advance over the analog sensors we've been using up to now.

The key difference is how low the thermal drift is in the reported differential pressure. A long standing problem with airspeed sensors has been the drift in the reading as the sensor warms up. This doesn't matter very much if you only need accurate airspeed readings at high speed as the contribution of thermal drift to airspeed drops rapidly with speed (as airspeed is proportional to the square root of the measured differential pressure). At lower speeds, such as when landing, it can matter, and having a sensor with low thermal drift is very nice. The I2C based MS4525D0 has internal temperature calibration to cope with thermal drift, which really helps.

The difference can be seen in the following graph

3689549299?profile=originalthe green line in the graph shows the airspeed from an analog sensor, and the red line shows the airspeed from a MS4525D0 digital sensor. The readings were taken on two Pixhawk boards side by side, started at the same time. You can see that the analog sensor drifted quite quickly to above 2 m/s average, whereas the digital sensor settled at around 0.5 m/s.

Right now we only have a driver for the MS4525D0 on the PX4 and Pixhawk. It would be possible to write a driver for the APM2, and we'd welcome a contributed driver.

Before we settled on the MS4525D0 we also tried the EagleTree I2C airspeed sensor but we found it suffered from thermal drift just as badly (and in some cases more badly) than the analog sensor. We still have the EagleTree driver in the tree, so if you have an ETS airspeed sensor it will work, but we don't recommend it if you can get the MS4525D0.

Automatic Airspeed Calibration

The 2nd big airspeed change in the 2.75 release will be the introduction of automatic airspeed ratio calibration. The airspeed ratio is the ratio between the calibrated airspeed and the square root of the differential pressure measured by the sensor. This ratio is normally around 2, and is controlled with the ARSPD_RATIO parameter in APM:Plane.As is described in the documentation, it is common that this ratio needs to be calibrated for different airframes. There are several reasons why the ratio may be different from 2.0:

  • positional error, caused by how the sensor is installed in the aircraft
  • sensor error, caused by small leaks or differences in sensor construction
  • pressure altitude differences, caused by changes in airspeed measurement with altitude

For previous releases of APM:Plane users wanting the best possible airspeed measurement needed to calibrate the sensor themselves, by flying the aircraft and looking at the logged airspeed compared to groundspeed. That worked, but it was not convenient.

For the 2.75 release Paul Riseborough has contributed a small 3 state Kalman filter which can automatically calibrate the airspeed ratio while flying. To enable it you need to set ARSPD_AUTOCAL to 1 and then just fly normally. The ARSPD_RATIO is automatically updated while you are flying. The following graph shows it working on my AcroWot:

3689549371?profile=originalI had deliberately set ARSPD_RATIO to 1.2 on takeoff to give the autocalibration code something to do. As you can see, the groundspeed and airspeed don't match at all well while the ratio stays low. After a few minutes of flying the autocalibration has raised the ratio to the right value of 2.0, and the airspeed nicely matches the average groundspeed.

Compensation for pressure altitude

The final major change in airspeed handling for the 2.75 release is the introduction of the EAS2TAS ratio throughout the code. The EAS2TAS is the estimated to true airspeed ratio, and reflects the fact that airspeed measured by an airspeed sensor drops relative to the true airspeed as altitude increases. This change is due to the lower air pressure, which means less air molecules hitting the sensor.

We already had compensation for EAS2TAS in the core navigation code in the 2.74 release, but for 2.75 we have propagated this ratio throughout the code. In particular the ratio is now used to adjust tuning parameters in the servo control loops, adjust the navigation code and even adjust the loiter radius with altitude. The idea is to make APM tuning parameters for an airframe be the same at sea level as it is at the top of a mountain, which will make it easier for users to share parameters, and also be a big advantage for anyone who flies at a wide variety of altitudes.

We have tested this code using the excellent JSBSim flight dynamics simulator, which allowed us to take a simulated aircraft up to altitudes far beyond what we could go to with a real R/C model. The EAS2TAS compensation worked well up to altitudes of around 30km.

Overall the upcoming 2.75 release should be a big improvement for anyone using an airspeed sensor. We hope you enjoy flying it!

E-mail me when people leave their comments –

You need to be a member of diydrones to add comments!

Join diydrones

Comments

  • Thanks Tridge. Look forward to 2.75. Hope it has a disable throttle function with airspeed controlled solely by pitch/elevator.

  • Developer

    @MV Reddy,

    The ratio itself is not altitude dependent, so the same default is appropriate. What you need is all the other changes we've made for 2.75 to cope with high altitudes. I hope to get the release out soon!

    Cheers, Tridge

  • Good stuff Tridge. I'm in the Eastern Himalayas, valley airfield at 15,000 feet ASL. How about an option that allows of automatic selection of ARSPD_RATIO  based on barometer/altimeter readings? 

  • Developer

    @Mikko,

    The new sensor does have temperature, but we haven't started making any use of that yet. Paul and I discussed using that for the pressure altitude correction, but haven't implemented it yet.

    The new sensor doesn't give static pressure separately, just differential and temperature.

    Cheers, Tridge

  • @Tridge & @Paul,

    Thanks a lot for the clarifications.  I agree that there is no need to separate IAS, CAS And EAS in our case.  Also happy to see the separation of TAS and EAS - TAS for navigation and EAS for flying.

    BTW, does the new airspeed sensor board provide temperature and static pressure readings to the APM software as well? 

    In the older APM set-ups (more than 6mths... ;) the only tempereatue AFAIK is from the APM board itself and that may or may not be anywhere close to the Outside Air Temperature.  The OAT is the interesting one for determining air density and density altitude.  The Board - let lone the CPU temperature should not be part of these calculations... 

    @Gisela & Joe Noci,

    +1 fan ... for your excellent advise about getting proper static pressure sensing arranged.  Also need to get that static pressure fed into an absolute pressure sensor, which is impossible on the APM2.5 style sensor.

    cheers

    -m

  • Thanks tridge, so i'll give it a spin today.

  • Developer

    Hi Simon,

    The betas should be fine to fly. I hope to get the new release out soon, just a bit busy on a few things right now.

    Cheers, Tridge

  • @Tridge: how safe is it to fly 2.75Beta2? I have been looking into airspeed errors lately and it seems that after every flight the analog sensor reports 4m/s too much after landing, although I wait before take off to heat it up. This is reproducible and causes problems during landing and sometimes even during flight.

    If I checked correctly, there haven't been any commits to beta2 since august 30th, I guess this is a good sign?

  • Developer

    Hi Mikko,

    We use EAS, CAS and IAS essentially interchangeably in APM, and only separate out TAS. EAS is used for anything involving aerodynamics, and TAS for navigation. We use the estimated EAS2TAS ratio (from the pressure altitude) to convert between EAS and TAS. This ratio is also used to scale the control loops, loiter radius etc.

    I don't think adding the math for EAS to CAS conversion would add much for APM at the speeds we operate at, although I'll leave it to Paul to correct me if I'm wrong!

    Cheers, Tridge

  • @ Morli,

    I have posted a small blog on the airdata sensor tubes - see if that helps? If you need more , let me know, I will try.

    Joe

    The Nampilot.

This reply was deleted.