paparazzi-devel
[Top][All Lists]

## Re: [Paparazzi-devel] Booz attitude estimation

 From: Marko Thaler Subject: Re: [Paparazzi-devel] Booz attitude estimation Date: Sun, 6 Jun 2010 19:15:53 +0200

```Hello Poine,

```
I understand and agree with everything you wrote but would like to point out the following concern.
```
```
Xdotdot = 0 assumption leads us to believe we can estimate the roll and pitch angle based on the body frame [ax ay az] IMU measurements. In quadrotors Xdotdot = 0 can only be achieved in perfect hover (roll and pitch = 0) or if we hold the quad in our hand and rotate it to a certain attitude. If the quad is flying, non-zero attitude angles (roll and/or pitch) will cause the quad to accelerate in a given direction. The gravitational (F_g = m g) and inertial force (F_i = m a) will cause our accelerometer measurements in body frame to be [0 0 az]. This measurements assume IMU in the center of gravity, no external forces acting on the quad (wind, etc.), zero sensor noise and motor vibration. The only acceleration in the body frame we can measure, based on the previous assumptions, is caused by the motor/ propellor thrust force. This force is always parallel to the az direction no matter what the attitude angles of the quad are!
```
```
This leads us back to my basic concern that we are trying to estimate the attitude angles based on attitude non-relevant body frame sensor data ax and ay (non-zero values are caused by sensor noise, motor vibration, external forces, etc.).
```
```
Please, let me know if I can improve the clarity of my concerns with some drawings and formulas.
```
I am looking forward to hear your thoughts and opinions.

Thank you and kind regards,

Marko

On Jun 5, 2010, at 12:01 AM, antoine drouin wrote:

```
```Hi Marko

What the accelerometer senses is the non gravitational acceleration,
in the inertial frame, and expressed in the sensor frame... that is :
[ax ay az] = Xdotdot - g
What the filter does, is assume that Xdotdot is zero ( which is more
or less true for a hovering vehicle ). Then the accelerometer is only
sensing.... the opposite of gravity. Knowing that the gravity is [0 0
9.81] in inertial frame, you can express the first two euler angles as

phi = -atan(ay/az)
theta = asin(ax/|a|)

(  use of atan and asin is in order to constrain phi to -180:180 and
theta to -90:90, but it's not important )

the formula you show in your post is just a linearization of that.
Also, if you're trying to understand the value of ACC_AMP, please note
that i did not compute the slope of the linearization at the origin,
but at pi/8 ( so that the value is exact at pi/8)

It's a bit hard to explain all that without drawings and formulas. If
that doesn't do the trick, ask again and I'll make some drawings.

hth

Poine

```
On Fri, Jun 4, 2010 at 11:37 PM, Marko Thaler <address@hidden> wrote:
```Hello everybody!

```
I am building my first Booz quad and studying it's code. One thing that puzzles me is the implementation of the Complementary Euler Attitude Filter.
```
On lines 159 and 160 in
```
sw/airborne/booz/ahrs/booz2_filter_attitude_cmpl_euler.c we estimate the
```body attitude angles based on the accelerometer measurements:

measurement.phi   = -booz_imu.accel.y * ACC_AMP;
measurement.theta =  booz_imu.accel.x * ACC_AMP;

```
Quadrotor flight dynamics dictate that x and y acceleration in the body coordinate system (imu) are always zero. Non-zero values are only produced by sensor noise, external wind force, IMU not in the center of gravity etc. Additionally, IMU measurements can directly be used for attitude estimation
```only when the system is not accelerating (in hover or constant speed
condition). If we ignore the extreme cases this condition can only be
achieved when phi and theta are 0.

```
Based on this I can not see the value of direct attitude estimation based
```only on the accelerometer data.

```
I would really appreciate if somebody can explain the purpose of this part
```of the code or show me if I have missed something.

Thank you very much for your help!

Kind regards,

Marko Thaler

_______________________________________________
Paparazzi-devel mailing list
http://lists.nongnu.org/mailman/listinfo/paparazzi-devel

```
```

```
```

```