Difference between revisions of "Sensors/AMSYS"

From PaparazziUAV
Jump to navigation Jump to search
m
Line 1: Line 1:
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Sensors</categorytree>
<categorytree style="float:right; clear:right; margin-left:1ex; border: 1px solid gray; padding: 0.7ex;" mode=pages>Sensors</categorytree>


AMSYS pressure sensors
This site will explain a way, how to use a AMSYS pressure sensor - AMS 5812 Series.
Descriptions coming soon


[[Category:Sensors]] [[Category:DeleteMe]]
==Addressing==
At first you have to be sure, you've programmed the right I2C address on the sensor chip. <br>
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: 0xF2
*Airspeed: 0xF4
 
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
 
The „AMS 5812 starter kit“ software does not use the first bit of the address. <br>
If you want to know more see:<br>
http://www.amsys.info/sheets/amsys.en.ams5812_e.pdf<br>
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.
 
<source lang="xml">
<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>
</source>
 
 
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 <br>
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:
<source lang="c">
airspeed_amsys = airspeed_filter * airspeed_old + (1 - airspeed_filter) * airspeed_tmp;
airspeed_old = airspeed_amsys;
</source>
 
 
The AMSYS Baro driver is only written to measure the hight not  to use it as an flight variable.
 
 
 
 
[[Category:Sensors]]

Revision as of 16:47, 5 March 2012

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: 0xF2
  • Airspeed: 0xF4

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

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.