Difference between revisions of "Sensors/Airspeed"
(→MS45xx) |
|||
Line 73: | Line 73: | ||
[http://www.digikey.com/catalog/en/partgroup/ms4525do/29060|One can buy one here at digikey] | [http://www.digikey.com/catalog/en/partgroup/ms4525do/29060|One can buy one here at digikey] | ||
To use MS4525 you need to put these lines in the modules section of your airframe file: | |||
''<load name="airspeed_ms45xx_i2c.xml"> | |||
<define name="MS45XX_I2C_DEV" value="i2c1"/> | |||
<define name="MS45XX_PRESSURE_RANGE" value="1"/> | |||
<define name="MS45XX_OUTPUT_TYPE" value="0"/> | |||
<define name="MS45XX_PRESSURE_OFFSET" value="8549.0"/> <!-- 8542.0--> | |||
</load>'' | |||
== Duo MS5611 == | == Duo MS5611 == |
Revision as of 13:45, 29 June 2015
Introduction
By default, in the airborne code, airspeed is estimated by measuring the GPS ground speed. The related control loops are described here. This gives reasonable results particularly in calm weather conditions. Adding an airspeed sensor measures actual airspeed resulting in better throttle control and aircraft performance especially in windy conditions. It is possible to build your own airspeed sensor by using pressure sensors. To start with adding airspeed sensors it is easier to buy pre-build calibrated airspeeds sensors. This page is currently mainly about how to do just that.
How does it work internally
The altitude and airspeed loops are separated as shown in the diagram below. Basically the throttle and pitch are controlled independently and are not coupled in the control loops. Of course one affects the other but the control loops are independent. Please see the control loops for a more detailed block diagram. The airspeed is controlled by two cascaded Proportional–Integral (PI) loops. The first loop is used to regulate the ground speed and the second the airspeed. This is done just to ensure that if the ground speed drops below a certain value the airspeed will be increased to compensate in order to maintain a valid GPS heading. If you happen to have a 3axis magnetometer build in your airframe for getting the heading values, maintaining a certain GPS speed for getting a heading is not needed.
The following plot is from an actual test flight after spending some time setting the loop gains Here the possibility to perform real-time tuning through the GCS is a real time saver. In thi test, the an airplane was flying circles at a constant altitude, except in the end of the flight. The wind was about 5 m/s, judging from the ground speed variations. In the middle there is an example of what happens when the ground speed falls below the setpoint. Finally the altitude setpoint was changed to verify that the airspeed will be maintained while climbing.
The benefits of the airspeed hold are obvious in this example. The throttle adjusts to keep the airspeed close to the setpoint.
Measuring
Sometimes it is very helpful for tuning your aircraft that you only measure the airspeed without controlling you aircraft behavior. This can be accomplished in the following way:
Replace the USE_AIRSPEED define with MEASURE_AIRSPEED. If you want to get sensor information as it is acquired without delay through the PERIODIC_SEND_ telemetry mechanism, please set SENSOR_SYNC_SEND instead. Note that defining MEASURE_AIRSPEED and not USE_AIRSPEED results in the normal AIRSPEED message containing rather useless information (it is simply four copies of estimator_airspeed, which is not updated by the airspeed sensor, though appears to be updated a very low rate FIX THIS?). Since the airspeed control loops are not active, one can vary the frequency of the raw measurements by adjusting the rate at which the airspeed_ets module is called in conf/modules/airspeed_ets.xml in the periodic function frequency.
Airspeed sensors
EagleTree Airspeed Sensor
Connecting an EagleTree Airspeed Sensor
The EagleTree Airspeed Sensor is a low cost module and comes with a very good pitot tube (Prandtl style, pitot-static tube) that includes static and dynamic ports. It has an I²C interface that connects directly to the Autopilot I²C port. The paparazzi autopilot code is able to regulate the throttle in order to keep the airspeed constant (and a minimum ground speed).
When you buy the airspeed sensor it is set to operate in the default mode. Make sure you did not set it somehow to 3rd party mode.
First, connect the sensor directly to the TWOG, Tiny or Lisa/M autopilot board via the I²C connector. The connector is J6 on the TWOG and Tiny and I2C on Lisa board. The wires coming from the sensor module have the following layout:
Red wire: 5V White wire: Ground Yellow wire: SDA Brown wire: SCL
See the airspeed_ets module page for configuration.
EagleTree sensor in 3rd party mode
While it is possible to use the sensors in a mode where values are the real values measured a.k.a. 3rd party mode, for regular use with the autopilot it has no specific advantage. Since the paparazzi already contain code to convert values to real speed values. Using the default setting is even a simpler if you have an eagletree logger and inbetween do some measurement with it, you do not need to reprogram the sensors if you connect them to the Autopilot board again.
Direct mode
Optionally if you have a special requirement and want to use the direct mode, it is possible. For this at the moment one needs to use the Eagletree software under Windows.
Regardless that his software runs fine under Linux Wine, using is not possible since the USB port is used in HID mode and as of Wine v1.2 using the USB bus under wind this way is not possible yet. There is however work done and on its way that USB ports do work under Wine for HID device.
Sensortechnics Airspeed Sensor
Sensortechnics provides a lot of solution for pressure measurements, absolute or differential, using analog or digital (i2c) outputs.
For airspeed measurements on low speed MAVs, a good choice is the LBA series, especially the LBAS500UF6S.
This sensor can be used with the generic airspeed_adc module. Note that it may be necessary to use a divisor bridge to adapt the 5V output of the sensor to the 3.3V ADC input of the autopilot.
MS45xx
A MS4525DO based sensor use could benefit from build in temperature compensation.
Application notes to accompany this product:
To use MS4525 you need to put these lines in the modules section of your airframe file:
<load name="airspeed_ms45xx_i2c.xml"> <define name="MS45XX_I2C_DEV" value="i2c1"/> <define name="MS45XX_PRESSURE_RANGE" value="1"/> <define name="MS45XX_OUTPUT_TYPE" value="0"/> <define name="MS45XX_PRESSURE_OFFSET" value="8549.0"/> </load>
Duo MS5611
Two MS5611 working in cooperation. see http://blueflyvario.blogspot.de/2013/06/air-speed-from-two-ms5611.html
Future
Just as with everything in the UAS world, lots of imprevments are still possible.
What could be improved:
- Maybe revert to GPS measurements only if the airspeed sensor fails.
- Detect Swap of static/dynamic port at pre-flight test