Sensors/AMSYS
This site will explain a way, how to use a AMSYS pressure sensor - AMS 5812 Series.
Addressing
At first you have to be sure, you've programmed the right I2C address on the sensor chip.
To do this, you can use a programmer device named “AMS 5812 starter kit“ which comes with all the software you need.
http://www.amsys.info/sheets/usersguide_I2C_AMG_rev1.GB.pdf
Paparazzi addresses
I2C Addresses: The default address of every AMSYS chip is F0 and it is always reachable, even if you've programmed a other one.
The default addresses defined in the paparazzi driver are:
- Baro: 0xE4
- Airspeed: 0xE8
You can change them and many othe sensor specific data in the files:
- /sw/airborne/modules/sensors/baro_amsys.c
- sw/airborne/modules/sensors/airspeed_amsys.c
AMSYS addresses
The „AMS 5812 starter kit“ software does not use the first bit of the address.
If you want to know more see:
http://www.amsys.info/sheets/amsys.en.ams5812_e.pdf
Because of this you have to program the sensor chips with this addresses:
- Baro: 0x72
- Airspeed: 0x74
Airframe
This is an expample to define the module in the airframe.
<firmware name="fixedwing">
...
<define name="USE_I2C0"/>
<define name="USE_AIRSPEED"/>
...
</firmware>
<modules>
<load name="airspeed_amsys.xml">
<define name="AIRSPEED_SCALE" value="1."/>
<define name="AIRSPEED_FILTER" value="0.902000010014"/>
</load>
<load name="baro_amsys.xml">
<define name="BARO_FILTER" value="0."/>
</load>
</modules>
USE_AIRSPEED is only needed if you want to control your plane's speed by true airspeed.
This is the calculation which should explain the usage of AIRSPEED_SCALE
sqrtf(2*(pressure_amsys)*airspeed_scale/1.2041);
1.2041 is the value of the air density.
AIRSPEED_FILTER and BARO_FILTER are values of an TP1 filter:
airspeed_amsys = airspeed_filter * airspeed_old + (1 - airspeed_filter) * airspeed_tmp;
airspeed_old = airspeed_amsys;
The AMSYS Baro driver is only written to measure the hight not to use it as an flight variable.