Figure 4: Experimental protocol.
7 IMPLEMENTATION ON A 8-BIT
MICROCONTROLLER
In the preceding section we validated the Matlab
Simulink implementation of our observer. To demon-
strate its computational simplicity we have also im-
plemented it on a 8-bit microcontroller (Atmel AT-
mega128 running at 11.0592MHz on development kit
STK500/501). The computations are done in C with
the standard floating point emulation. The microcon-
troller is fed with the MIDG II raw data at a 50Hz rate.
We have used a simple Euler explicit approximation
for the integration scheme.
The experimental protocol was the following:
1. move the sensors in all directions and save the
MIDG II raw measurements and estimations at
50Hz.
2. use of xPCTarget to feed the ATmega with these
data at 50Hz via a serial port and send at the same
time the estimated variables. given by the micro-
controller via a serial port to a computer
3. save these estimations.
4. compare offline the estimations given by the mi-
crocontroller and those given by the observer writ-
ten in the Matlab embedded function.
This protocol can be illustrated by the figure 4 where
xPCTarget has been replaced by the MIDG II.
We obtain the results of the figure 5. The two es-
timations are very similar. We see on the bottom plot
the discretization at 50Hz due to the microcontroller.
REFERENCES
Bonnabel, S., Martin, P., and Rouchon, P. (2007). Invari-
ant observers. arxiv.math.OC/0612193. Accepted for
publication in IEEE Trans. Automat. Control.
240 250 260 270 280 290 300 310
−200
−100
0
100
200
Comparison ATmega/Matlab
(°)
253.25 253.3 253.35 253.4
70
75
80
85
90
(°)
time(s)
φ ATmega
φ Matlab
φ ATmega
φ Matlab
Figure 5: Comparison ATmega/Matlab.
Collinson, R. (2003). Introduction to avionics systems.
Kluwer Academic Publishers, second edition.
Grewal, M., Weill, L., and Andrews, A. (2007). Global po-
sitioning systems, inertial navigation, and integration.
Wiley, second edition.
Hamel, T. and Mahony, R. (2006). Attitude estimation
on SO(3) based on direct inertial measurements. In
Proc. of the 2006 IEEE International Conference on
Robotics and Automation, pages 2170–2175.
Kayton, M. and Fried, W., editors (1997). Avionics naviga-
tion systems. Wiley, second edition.
Mahony, R., Hamel, T., and Pfimlin, J.-M. (2008). Non-
linear complementary filters on the special orthogonal
group. IEEE Trans. Automat. Control. To appear.
Mahony, R., Hamel, T., and Pflimlin, J.-M. (2005). Comple-
mentary filter design on the special orthogonal group
SO(3). In Proc. of the 44th IEEE Conf. on Decision
and Control, pages 1477–1484.
Martin, P. and Sala
¨
un, E. (2007). Invariant observers for
attitude and heading estimation from low-cost inertial
and magnetic sensors. In Proc. of the 46th IEEE Conf.
on Decision and Control.
Stevens, B. and Lewis, F. (2003). Aircraft control and sim-
ulation. Wiley, second edition.
Thienel, J. and Sanner, R. (2003). A coupled nonlinear
spacecraft attitude controller and observer with an un-
known constant gyro bias and gyro noise. IEEE Trans.
Automat. Control, 48(11):2011–2015.
APPENDIX: QUATERNIONS
Thanks to their four coordinates, quaternions provide
a global parametrization of the orientation of a rigid
body (whereas a parametrization with three Euler an-
gles necessarily has singularities). Indeed, to any
quaternion q with unit norm is associated a rotation
matrix R
q
∈ SO(3) by
q
−1
∗~p ∗ q = R
q
·~p for all ~p ∈ R
3
.
ICINCO 2008 - International Conference on Informatics in Control, Automation and Robotics
60