paparazzi-devel
[Top][All Lists]
Advanced

[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

[Paparazzi-devel] Please help regarding code for BOOZ MS2100 magnetic se


From: Thomas Wuensche
Subject: [Paparazzi-devel] Please help regarding code for BOOZ MS2100 magnetic sensor
Date: Sun, 06 Feb 2011 19:48:33 +0100
User-agent: Mozilla-Thunderbird 2.0.0.24 (X11/20100328)

Hi all,

Coming from some problems with my magnetic sensor I tried to
study and understand the code for taking measurements on
the BOOZ IMU.

Situation is that I have unreliable measurements from the
sensor. The unreliability is not (only?) in the measurement
values, but in how regularly they are taken. Sometimes
I get values, sometimes not.

Trying to understand what is happening I see that there are
a number of state machines, some driven from the cyclic
processing in the main loop, some driven from three different
interrupts.

What I see is that reading of the A/D converter on the IMU is
started within the 512Hz main periodic process. Correspondingly
there is a chip select to the A/D converter approx. every 2ms,
the request for a reading, the reading complete signal to be
processed in the interrupt. So far everything is OK, I can follow
the relevant signals on the scope.

What I understand is that after the reading of the A/D is complete,
the reading for the magnetic sensor is started, one component at
a time. When measurements are running, I then see the signals
to/from the magnetic sensor. The observation is that the comple-
tion of the measurement cycle is longer than the main periodic
cycle (handling A/D converter). So before the magnetic sensor
signals complete, there are 1 or two further samplings of the
A/D converter. Should it be that way? Is the code safe to handle
that?

Even if that is running, samples are sometimes taken only once
a second, sometimes faster, sometimes slower. This is something
I don't understand at all. I think if one magnetic measurement
is completed, the next should be started after the next A/D
sample is complete, right? But I do not even see the chip select
to the magnetic sensor get active, so the guess is that the
software does not trigger the next conversion.

And sometimes I get no conversion at all. The magnetic sensor
receives a measurement request once after power up, and then
nothing happens any more.

Basically I think my magnetic sensor may be somehow broken from
the hardware side, sometimes delivering measurements, sometimes
not. But despite that I wonder how stable the mixture of the
different state machines is, if a measurement takes longer than
to the beginning of the next run of the main periodic loop.
If it would be stable, at least further measurements should be
tried, even if one fails.

I'm willing to investigate that further, but it would be nice
to have some information on what are the (conceptual) prerequi-
sites of the existing code. Is the completion signal for the
magnet expected to be set before the next run of the main
periodic loop? In this case structure would be clear and there
could be no mix of the different interrupt procedures. If not,
how are the different state machines interlocked, given the
fact that some are handled in the interrupt. Is the common
hardware (SPI access) locked sufficiently so that not an access
from the main loop or an interrupt can be disturbed by another
interrupt (accessing SPI to one of the peripherals while the
chip select to the other is also set)? What is the intended
mechanism for that?

Thanks a lot for any information,

Thomas
-- 
EMS Dr. Thomas Wuensche e.K.
Sonnenhang 3
85304 Ilmmuenster
HRA Neuburg a.d. Donau, HR-Nr. 70.106
Phone: +49-8441-490260
Fax  : +49-8441-81860
http://www.ems-wuensche.com



reply via email to

[Prev in Thread] Current Thread [Next in Thread]