29th IEEE EMBS Annual International Conference (EMBC07), August 23-26, 2007, Cité Internationale, Lyon, France
Sensor Based Systems for Monitoring III, FrP1C4.5
A Fast Algorithm to Track Changes of Direction of a Person Using Magnetometers Anthony Fleury, Norbert Noury and Nicolas Vuillerme Laboratoire TIMC-IMAG, UMR CNRS/UJF 5525, équipe AFIRM, Faculté de médecine de Grenoble, Bâtiment Jean Roget - 38706 La Tronche. {Anthony.Fleury,Norbert.Noury,Nicolas.Vuillerme}@imag.fr
Introduction Context:
Objectives:
We need to detect and to classify changes of direction of a person with a tri-axis magnetometer (significant changes with their orientation: ± 90°, ± 180°, ± 270°, ± 360°).
To improve the calculus of activity indicator based on accelerometers as they can’t detect vertical rotation (it occurs at constant gravitational field).
To develop an algorithm that can be embedded (fast and real time)
To test the capacity of magnetometers and their complexity of integration in MEMs without considering them only as a mean of correction of gyroscope signals).
Materials
Fig. 2. Position of the 3-D axis set on the subject.
Fig. 1. Circuit board used for data acquisition
Fig. 3. Position of the 3-D axis set on the circuit board
Algorithm Description of the algorithm
Legend :
Illustration of the process on the magnetometers signal
B: Earth magnetic field vector measured by the sensors. t: Time.
A Initialization of the algorithm: t = 0, Bd = B0, Bf = B0, N = 20.
B0: Magnetic field vector for t = 0. Bd: Magnetic field vector at the beginning of the current movement.
Acquisition of N new samples from the 3 axis of the magnetometers circuit (3-D vector B) (Fig. 4A and 5A)
Bf: Magnetic field vector at the end of the current movement. Bx
N: number of samples within an analysis frame. sw: standard deviation in the current window. st: standard deviation in the signal since the beginning of the experimental session.
By
Fig. 4. Successive steps of the filtering process shown on a significant part of the signal of an experimental session in which the subject made a 180°rotation, walked and made a second 180° rotation in the opposite direction.
B
Three-order bandstop Butterworth digital filter [0.5Hz; 2Hz]. (Reduce periodical effect of walking) (Fig. 4B) Bx
x: data that is being processed (Bx, By or Bz).
Bz
By
Bz
Non-linear filter based on the running standard deviation of the signal (Fig. 4C):
xw: mean value of the data in the current window. є: coefficient optimized from the experimentation.
xi if s w ≥ ε ⋅ st (activity) ∀ i ∈ [1, N ], xi = x w else (non - activity)
є90: value of the norm of the difference vector for a 90° movement.
C
є180: value of the norm of the difference vector for a 180° movement. Activity Frame?
Determination of the projection of Bd and Bn (bd and bn) in a new basis in which Bd ∧ Bn is the rotation vector. Determination of the angle of the rotation around this vector k: b ⋅b θ = arccos
Determination of the quaternion
Q of this rotation:
Bd = Bt+N+1
Yes
bn × bd n
No
Start of analysis : n = 0.
d
θ q1= cos 2 θ q2 = sin 2 ⋅ k x Q= q = sin θ ⋅ k y 3 2 θ q 4 = sin ⋅ k z 2
Yes
Bt + n − Bd ≥ ε180 Or
No
Bt + n − Bd ≥ ε 90
n
No
Yes From this quaternion, we obtain the rotation matrix of the rotation, that we can identify with the rotation matrix of a combination of rotation around the three directions. We obtain 3 angles: Θ (roll), Ψ (pitch), φ (yaw)
n=n+1
Fig. 5. Output signal of the algorithm. (A) Raw signal from the experimental session, (B) computed yaw angle to obtain a “reference” of the movements and (C) results of the algorithm with the different movements.
- Update the position of the person with Is this yaw angle coherent with the first decision ?
Yes
No
this new information (output signal shown on Fig. 5C). - Bd = Bn+1 (update the starting point of the analysis)
Results Two experimental sessions (5 times each) have been performed on 8 young subjects : (1) Walk in a corridor, at a confortable speed, and make multiples changes of direction (ten 180°change s, five in each direction of rotation) and sit on a chair between these changes. (2) Walk, go up and down the stairs and make four 180°changes (two in each direction) and eight 90°cha nges (four in each direction).
90°
180°
Purcentage of windows declared as “activity”
-
+
-
+
Total time for the experimental session
(1)
0
0
5
5
226s ± 37
85%
(2)
8
8
1
1
147s ± 36
54%
Session
Results : All movements have been detected by the algorithm and its verification procedure. An approximation of the number of window declared as “non activity”, and so ignored by the algorithm, is given by Table 1.
Table 1 : Information on the two different experimental sessions
Discussion and conclusion Our algorithm, associated with its uncertainty minimization part, is efficient to detect the main changes of direction of a person. A better value of the coefficient could be computed, from more experiments, to reduce the number of operations and optimize it for embedded environments. EMC sensitivity have been tested (because the magnetic field measured is very low: about 0.47G). The results of the tests are shown on Table 2. We have computed the mean magnetic field and its standard deviation, during a session of one hour with two different elements that can create disturbance at home: near a TV and near an elevator. For the elevator, 20 cm near the door, we can detect the disturbance looking at the mean magnetic field but we can not cancel it. So far we cannot correct this side effect, but at least we can detect it.
Condition
TV off
TV On (sensors at 20cm)
Elevator (20 cm)
Elevator (1m)
Measured magnetic field (mG)
528.9 ± 1.94
528.7 ± 1.65
2193.6 ± 303.13
565.1 ± 10.21
Possible uses of this algorithms includes health smart homes [1] and data fusions. It can also be associated with activity detection systems [2] to compute an “activity index” of the subject. Futur works include more investigations on the magnetometers signals capability, to detect and characterize other movements of a person (seating, laying down, …). [1] C. N. Scanaill, S. Carew, P. Barralon, N. Noury, D. Lyons, and G. M. Lyons, “A review of approaches to mobility telemonitoring of the elderly in their living environment,” Annals of Biomedical Engineering, vol. 34, pp. 547 – 563, April 2006. [2] P. Barralon, N. Noury, and N. Vuillerme, “Classification of daily physical activities from a single kinematic sensor,” in 27th Annual International Conference of the Engineering in Medicine and Biology Society, 2005. IEEE-EMBS 2005, pp. 2447–2450.
Table 2 : EMC sensitivity results of our circuit