A Vergnol
email: arnaud.vergnol@hei.fr

J Sprooten

B Robyns

V Rious

J Deuse

Optimal network congestion management using wind farms

Keywords: Congestion management, Wind farm, Power Transfer Distribution Factors (PTDF), Power system control, Active power dispatch, Variable speed wind turbines

With the increased use of wind energy for the power generation several TSO have increasing difficulties for congestion forecasting due to the unpredictable nature of the energy source. An actual method used to deal with days-ahead congestion planning is based on an order of disconnection of the generation of the type "last generation installed, first generation limited". This paper proposes to enhance the congestion management using a real time supervisor. This supervisor is developed to perform automatic and dynamic re-dispatching using both wind and conventional generators. In order to reduce the production constraints to the minimum, the real time congestion management is based on an indicator of the efficiency of a re-dispatching on the power flowing in the overloaded line. This approach leads to reduced re-dispatching costs and increased network reliability. Actual and proposed methods are compared in the paper using Matlab/Simulink simulations of a realistic test grid. It is shown that the real-time supervisor allows maximization of renewable production during congestions while ensuring network reliability.

I. Introduction

For several years, global warming has become a world priority. One of the solutions to solve this problem is the increased use of renewable energy for the power generation. However, the integration of such a production in the actual grid is not simple as this grid was not originally design to accept such type and localization of production. In many regions, the Transmission System Operators (TSO) are expecting an increase of line congestion in rural areas due the important increase of wind generation [START_REF] Eon-Netz | Wind Report 2004[END_REF].

In the literature, many methods have been reported for congestion management. Sensitivity-based optimum generation rescheduling and/or load shedding schemes to alleviate overloading of transmission lines are proposed in [START_REF] Manandur | Economic shift in electric power generation with line flow constraints[END_REF] and [START_REF] Hazra | Congestion management using multiobjective particle swarm optimization[END_REF]. These methods, based on the computation of an Optimal Power Flow (OPF) are precise techniques for congestion management in power systems as long as generation, transmission capacities are well known. Other congestion management methods are proposed in [START_REF] Singh | Transmission congestion management in competitive electricity markets[END_REF]- [START_REF] Fang | Optimal Dispatch Under Transmission Contracts[END_REF]. These market-based methods for congestion elimination are also very efficient as long as two areas, delimited by the congested elements can be identified and can create market structure. Furthermore, as for previously presented methods, the market-based methods are affected by errors in load and generation prediction due to element outage or random production as is wind generation.

Therefore, most European TSO's have chosen to manage separately, congestions related to wind generation [START_REF] Centeno-Lopez | Grid connection rules for wind power in five countries with high ambitions concerning amount of wind power in the power system[END_REF]. This is due to the difficulties to predict exact congestion magnitude and time instant and the difficulties to increase production in high voltage distribution network. The actual used method is then to manage congestion in planning (i.e. day-ahead) by disconnection of generation on the technical and economical criteria "last generation installed, first generation limited".

The main consequence of this approach is a limitation of generation that can be more important that necessary as a precise day-ahead prediction of wind power is impossible.

This paper proposes to minimize change in generation due to congestion to the minimum using an automatic real-time congestion supervisor. This proposed method is implemented and validated using in Matlab / Simulink simulations.

In Section II, the considered test system is introduced. Then, the real-time supervisor is presented in Section III. Section IV will use simulation results to compare the proposed method with the actual one and finally, conclusions will be drawn in section V.

II. Modeling of the system under study

In Figure 1, the structure of the considered test system is shown. This system is representative of a part of the 90kV French network. This network is subjected to interregional transit flows, here represented by a load (Transit.out) and a production unit (Transit.in). Connected at node 4, a conventional generator (Gr4) is the slack bus. Wind Farms (WF) are connected to nodes 1, 2 and 3. Their nominal power is respectively 20, 50 and 70 MW. Each wind farm is represented by the equivalent variable speed wind turbine model (VSWT) of Figure 2. The VSWT based permanent magnet synchronous generator (PMSG) and is fully described in [START_REF] Courtecuisse | Experiment of a wind generator participation to frequency control[END_REF]. The inputs of the control system are the reactive reference power (here equal to 0) and a maximum output power equal to the WF nominal power (P nom ). The PMSG control level is based on two separate controllers:

• The rotor side converter controller which controls the torque of the PMSG using a rotor current control loop; • and the grid side converter controller which controls the DC link voltage u and the output reactive power.

The wind turbine control level contains three controllers:

• A speed limiter which uses the pitch angle (β ref ) to limit the blade rotating speed;

• a MPPT (Maximum Power Point Tracking controller) which generates the active power reference (P MPPT ) using rotor speed measurement (Ω) and predefined characteristics.

• a power limiter which generates the torque reference (T ref ) for the torque control loop. This torque control is performed by the rotor side converter controller of the PMSG control level. The torque reference is computed by

( ) Ω = nom MPPT ref P , P min T (1)

III. Real time supervisor

In case of line congestion, actions must be taken on the generators to reduce the power flow in the congested line and maintain the total generation at the same level to avoid frequency deviation. The problem of congestion management is then to select the two generators that will realize the redispatching and to define the amount of active power to re-dispatch. In order to realize these actions, an indicator which quantifies the effect of re-dispatching on congestion is used. This indicator is related to the well known Power Transfer Distribution Factor (PTDF) [START_REF] Fradi | Calculation of Energy Transaction Allocation Factors[END_REF], [START_REF] Zhou | Approximate Model of European Interconnected System as a Benchmark System to Study Effects of Cross-Border Trades[END_REF] and its interpretation in the context of our study can be summarized through equation ( 2 where P redispatched is the re-dispatched power and ΔP line is the amount of power modification in the congested line. Indeed, a same quantity of re-dispatched power via two different couples of units has not same effect on the overloaded line. This depends on the location of the power units. According to Kirchhoff's laws, PTDFs depend on the topology, parameters of the electric power system and on the operating point. However, it has been shown in [START_REF] Baldick | Variation of distribution factors with loading[END_REF] and [START_REF] Liu | Effectiveness of the distribution factor approximations used in congestion modeling[END_REF] that the dependence with the operation point is low and that the computation of the PTDFs using DC load flow equation will give acceptable approximation. The PTDFs, computed for line L 12 of the Figure 1, are shown in Table 1. The PTDFs magnitude will be used to define an order of efficiency of the re-dispatches which relieve congestion of line L 12. This order of efficiency is shown in Table 2. The re-dispatching which is number 1 in the order of efficiency is to be selected. Indeed, for a same quantity of active power reduced in line L 12 , the re-dispatch requires the smallest amount of active power equation (2). 2 represents all the possible re-dispatching in the considered network in Figure 1. However as the generator of nodes 1 to 3 are wind farms working in MPPT, an increase of their power is impossible. Therefore Table 2 can be reduced to the two re-dispatching printed in bold (Node4-Node2 and Node4-Node3). This order of efficiency is used in real-time management to choose the most effective couple of nodes to use to avoid line congestion while changing as little as possible production plans. Furthermore, the real-time supervisor for congestion management requires communication with both TSO and the production units (Figure 3): • PTDF and line thermal limits with depends of the topology and operational policies of the electrical system are provided to the supervisor by the TSO.

• A control mode (Mode) signal is sent by the supervisor to the production unit to specify their participation in congestion management. There are four control Modes; If there is no congestion, then the generators can operate at power planned P planned (for the WF, the default planned power is the P MPPT ), this is the Mode 1. During congestion, the two generators selected by the Table 2 are asked to control their production based on a signal L, this is Mode 2. If a generator reaches its upper limit, it is asked to operate at this limit (P max ), this is Mode 3. Finally, if a generator reaches its lower limit, it is asked to operate at this limit (P min ) (WF for this mode is equivalent to 0MW), this is Mode 4.

• A dynamic control signal is (L) sent by the supervisor to the production units. This signal can be negative or positive to reduce or increase generation power. • The state signal (State) is sent by the generation units to the supervisor to precise their dynamic availability for congestion management.

TSO

Order of efficiency (PTDF)

Real time supervisor

I meas State Gr1 L 1 Mode Gr2 Gr1 Gr3 Gr2 limit thermal line I State Gr2 State Gr3 Mode Gr3 Mode Gr1 L 2 L 3

TSO

Order of efficiency (PTDF)

Real time supervisor The structure of real-time supervisor is shown in Figure 4. This supervisor contains three parts; two controllers located at a central location and a controller located at the generation site:

I meas State Gr1 L 1 Mode Gr2 Gr1 Gr3 Gr2 limit thermal line I State Gr2 State Gr3 Mode Gr3 Mode Gr1 L 2 L 3
• A STATEFLOW controller to define the Mode of each generator. This output depends on the congested line and the PTDF of the available generator for this line. The STATEFLOW algorithm is based on a Moore machine [START_REF] Moore | Gedanken-experiments on Sequential Machines[END_REF], [START_REF] Devadas | On the Verification of Sequential Machines at Differing Levels of Abstraction[END_REF]. Figure 5 shows the STATEFLOW algorithm for line L 12 considering the information of Table 2. If there is no congestion, then every generator operates in Mode 1 (All the WF are to P nom and Gr4 is to P planned ). When line L 12 is overloaded, the WF2 and Gr4 switch to Mode 2 and control the following signal L. When the WF2 reaches its lower limit, the WF3 and Gr4 switch to Mode 2 and WF2 operates at P min (Mode 4). When the WF3 is back to its higher limit, the machine returns to its previous state. is sent to a generator, this generator must decrease (increase) greatly its production.

L ΔI 1 -1 -15% 15% PTDF = 33% PTDF = 100% L ΔI 1 -1 -45% 45% L ΔI 1 -1 -15% 15% PTDF = 33% L ΔI 1 -1 -15% 15% L ΔI 1 -1 -15% 15% PTDF = 33% PTDF = 100% L ΔI 1 -1 -45% 45% PTDF = 100% L ΔI 1 -1 -45% 45% L ΔI 1 -1 -45% 45%
In order to tune the parameter K N of the control loops, an example will be considered. Using equation [START_REF] Eon-Netz | Wind Report 2004[END_REF], in order to modify the power flow in line L 12 , the couple of nodes 4-3 having a PTDF of 15.3% must re-dispatch 3 times more power than the couple of nodes 4-2 (PTDF of 44.8%) to modify the same amount of power in the line. Therefore, the signal L sent to nodes 4 and 3, representing the re-dispatch magnitude will be three times greater than the signal L sent to the nodes 4 and 2. Figure 6 and equation [START_REF] Hazra | Congestion management using multiobjective particle swarm optimization[END_REF] show the cross dependence between the sent signal L, the PTDF of the couple of units realizing the re-dispatching and the overload of the congested line.

where ΔI max is the maximum overload allowed for the congested line (equation ( 4)) and PTDF min is the minimum PDTF that guarantees not to exceed the maximum current I max . The performance of the system (Current overload lower than ΔI max ) will be guaranteed for a PTDF down to PTDF min .

The PTDF min value is obtained considering that the most rapid changes of line power flows in the line are 1,67MVA/s and that maximum dynamics of generators is 5MW/s. Applying equation [START_REF] Manandur | Economic shift in electric power generation with line flow constraints[END_REF] with these values, one can find a PTDF min of 33%. • The generator side is an active regulator. The goal of each generator is to convert the input signal L in a power reference which must be followed. This supervisor contains three controllers shown in Figure 7 : -The power loop which generates the active power reference (P ref ) according to the level L sent to TSO and the measured active power (P meas ). K G is estimated to adjust the maximum dynamic response of the generator to a common value of 5MW/s. In the considered WF, a decrease of 5MW/s is observed for a signal L equal to -1. -The control mode selector is used to select the proper active power reference based on the Mode signal sent by the central supervisor.

-The generator state is used to inform the central supervisor of the limits of the wind farm (limit low or limit high).

IV. Simulations and comparison

The test system shown in Figure 1 was simulated using Matlab/Simulink. Figure 8 shows the time evolution of loads and interregional transit flow. The evolution of loads represents a daily load profile, however to reduce the simulation time this profile is scaled to 900s. The considered interregional transit flow is null at night and maximum during the day. This profile is scaled to 900s but the transition times are kept unmodified to test the supervision algorithm on realistic dynamic constraints. Figure 9 shows the wind speed for all wind farms. As before, the wind profile is not scaled to keep realistic dynamic behavior of the network. In the proposed scenario, a congestion of line L 12 happens when both main transit flow and high winds are present.

The performance of the proposed real-time congestion management can be compared to the actually implemented method. The comparison scenario is based on the network of the Figure 1 and the profiles of the Figure 8 and Figure 9.

The actual method is used in days-ahead congestion planning. As production limits are constant they are computed for the most critical point planned congestion. In this scenario, the time instant t=380s (when interregional flow and the wind speed are high) is the most critical. Therefore limitation of the WF2 at 0MW and WF3 at 63MW are computed and applied for the congestion period t=200s to t=600s. The current in the congested line with real-time supervisor (full line), with actual method (dotted line) and without congestion management (dash-dotted line) is shown in Figure 10. In Figure 11, the power (P WF2 ) of the WF2 is shown, the dash-dotted line represents the maximun power that can be obtained from the wind by the WF (MPPT). In Figure 12, the power (P WF3 ) of the WF3 is shown. The STATEFLOW controller selects the most efficient the available couple of generation to avoid the line overload with a minimum of re-dispatch effort; from t=300s to t=365s, this couple is WF2-Gr4; the WF2 decreases its production while the conventional generator Gr4 increases its production of the same amount.

At t=365s, the WF2 is in lower limit (here P WF2 =0MW) and the STATEFLOW controller selects the second couple (WF3-Gr4) and sets the WF2 to constant minimum power operation (0MW); from t=365s to t=395s.

At t=395s, the WF3 is back to its higher limit (here P WF3 =P MPPT ) and the STATEFLOW controller selects the first couple (WF2-Gr4) and sets the WF3 to operate in normal operation; from t=395s to t=570s.

From 570s, the line is no more onverloaded; WF2 operates back to P MPPT and Gr4 to P planned . Figure 10 shows the ability of the real-time congestion management to avoid the congestion by limiting the current in the line equal to its thermal limit. In addition, the Figure 10 shows that the management can make the minimum re-dispatching.

For the actual method, limitations of the WF2 and WF3 allow the current line L 12 not to exceed the maximum current as shown in Figure 10. By comparing the full line and the dotted line of Figure 11 and Figure 12, the real time management reduces the time and quantity of the limitation imposed to the WF2 and WF3. Table 3 shows that the real time management allows more energy to be produced than with the actual method. The real time management allows therefore the reduction of the energy loss for the wind producers. Besides, by comparing the full line and the dotted line of Figure 10, the real time management allows ensuring the safety of the network. This is possible thanks to the realtime regulation of current in the line.

V. Conclusion and future work

This paper presents a method for real-time congestion management of power grids. Through simualtion results, it is shown that this method avoids the congestion of the lines while reducing the production constraints to the minimum. Therefore, it provides a solution for congestion management in present of weakly predictable production. However, the implementation of this real-time congestion management will require the development of the existing communication systems as well as the modification of the actual grid codes. The proposed method leads to the reduction of the redispatching costs and an increase of the network reliability.

Future work will present the real-time management when congestions are due to element loss (n-1 operation) and will present an automatic construction of the STATEFLOW algorithm.

Figure 1 :Figure 2 :

 12 Figure 1: Test system.

Figure 3 : 1 Figure 4 :

 314 Figure 3: Communication within the real time supervisor.

Figure 5 :

 5 Figure 5: STATEFLOW Algorithm for line L 12 .

Figure 6 :

 6 Figure 6: Adjustment of the signal L based on the PDTF of the units realizing the re-dispatching and the amount of overload.

Figure 7 :

 7 Figure 7: Wind turbine model.

Figure 8 :Figure 9 :

 89 Figure 8: Evolution of the load and interregional transit. Dashed line: Load 2. Dotted line: Load 1 and load 4. Full line: Load 3. Dash-dotted line: Interregional transit.

Figure 10 :Figure 11 :

 1011 Figure 10: Evolution of the line current. 1 p.u represents the thermal current limit. Dash-dotted line: Without congestion management. Full line: With real-time supervisor. Dotted line: With actual method.

Figure 12 :

 12 Figure 12: Power of the WF3. Dash-dotted line: Without congestion management. Full line: With real-time supervisor. Dotted line: With actual method.

Table 1 : PTDF related of line L 12 . PTDF related to power modification of line L 12 Decrease of generation at node

 1

			Node 1	Node 2	Node 3	Node 4
	Increase of generation at node	Node 1 Node 2 Node 3 Node 4	79.8% 50.3% 35.0%	-79.8% -29.5% -44.8%	-50.3% 29.5% -15.3%	-35.0% 44.8% 15.3%

Table 2 : Order of efficiency for line L 12 .

 2

		Re-dispatching
	Order of efficiency	Increase of	Decrease of	PTDF
		generation at node	generation at node
	1	Node 1	Node 2	-79.8%
	2	Node 1	Node 3	-50.3%
	3	Node 4	Node 2	-44.8%
	4	Node 1	Node 4	-35.0%
	5	Node 3	Node 2	-29.5%
	6	Node 4	Node 3	-15.3%
	Table

Table 3 : Produced energy by WF.

 3

	% maximum energy	WF2	WF3	WF2+WF3 +WF1
	Without
	congestion	100%	100%	100%
	management
	With real-time supervisor	57.3%	99.8%	84,7%
	With actual method	46.6%	99.7%	80,8%

http : //www.cigre.org

Acknowledgements

This work was supported by a financing from the regional Council Nord-Pas de Calais and from the European Regional Development Fund (ERDF).


Anthony Fleury
email: fleury_anthony@hotmail.com

Norbert Noury
email: norbert.noury@insa-lyon.fr

Michel Vacher
email: michel.vacher@imag.fr

A WAVELET-BASED PATTERN RECOGNITION ALGORITHM TO CLASSIFY POSTURAL TRANSITIONS IN HUMANS

Elderly people can be monitored at home to detect autonomy issues in their behavior. In addition to the environmental sensors (presence and movements in a room, temperature in the flat, light, etc.), we developed an inertial and magnetic based central of sensors to monitor the activity of the person. This article presents a wavelet-based pattern recognition algorithm that work on the data of this central to detect the postural transitions occurring in the daily life. We constructed four patterns: (1) for stand to sit, (2) for sit to stand, (3) for stand to lying down and (4) for lying down to stand. With this, we are able to detect theses changes, and to infer (as we consider that the subject is stand-up when the sensor is turned on) its posture. We also have, with these sensors, an idea of the activity of the person in each frame of time (immobile, moving, etc.). To test this algorithm and verify that the patterns are independent of the subject, we asked fifteen people to reproduce a scenario and we present, in the last section of this article, the results obtained. Results of an experiment are also given to show a mean good classification rate of 70% for this method.

INTRODUCTION

The constant growing of life expectancy in the world creates a lack of places and workers in institutions equipped to care of elderly people. To prevent overpopulation problems, researcher teams all over the world work on ways to keep elderly people at home. Geriatrics ask researchers to design sensors and algorithms to appreciate the evolution of the person in his environment and detect the appropriate moment to organize the admission in an institution.

Abnormal situations in the behavior of the person should be detected by smart sensors and smart homes. Smart Homes have demonstrated that a measure of the activity of a person at home can be relevant [START_REF] Bellego | A model for the measurement of patient activity in a hospital suite[END_REF]. Inertial and magnetic sensors have been used in the past to detect and reproduce movements of a part of the human body (a limb for instance) with uses in virtual reality. In telemedicine they can be used to analyze movements of the person (for example Sit-to-Stand and Stand-to-Sit [START_REF] Najafi | Ambulatory system for human motion analysis using a kinematic sensor: Monitoring of daily physical activity in the elderly[END_REF], or to detect distress situations such as fall [START_REF] Noury | Fall detection -principles and methods[END_REF]. This paper aims at using such sensors to detect the postural transitions of a human (Sit to Stand, Stand to Sit, Lying down, Standing Up, Walking) with only one point of measurement, to reduce the inconvenience for the user that has to keep the sensor all the time.

This detection has been realized using a wavelet-based pattern recognition algorithm. This kind of algorithms has been applied in a large variety of application such as handwritten and printed characters recognition in different languages [START_REF] Tang | Wavelet Theory and its Application to Pattern Recognition[END_REF].

MATERIALS: ACQUISITION SYSTEM ACTIM6D

2.1 Sensors ACTIM6D (Actimetry in six dimensions) is an home-made acquisition circuit board continuously delivering six signals.

The first three signals are from a tri-axes ±1.5g to ±6g accelerometer (MMA7260Q, Freescale). The ±2g resolution is software selected and gives us a 0g value at V ss /2 with a sensitivity on each axis of 600mV /g. The other three signals are from a tri-axis ±6Gs magnetometer (HMC1053, Honeywell), with a sensitivity of 1.0mV /V /Gs. The magnetic field measured is the Earth one. The three outputs from the magnetometer are amplified to give ±0.6Gs in full-scale.

Description

Data are acquired to a frequency of 100Hz with a DAC of 10 bits for both sensors by a Microchip micro-controller. This frequency is largely sufficient considering that human movements in daily living occurs in the bandwidth [0.8 -5Hz] (for a sensor on the upper part of the body) [START_REF] Bouten | A triaxial accelerometer and portable data processing unit for the assessment of daily physical activity[END_REF]. These collected data are stored on a SD/MMC Memory Card. Figure 1-a and 1-b illustrate this circuit.

All this system is autonomous: it is powered by two coincell batteries and not connected to a computer (as it stores data on the memory card). The data on the memory card have to be stored by 512 bytes block. We store 0.5s on one sector. A 1GB card allow an autonomy of about 11 days. The battery consumption has been reduced by entering in sleep mode when waiting for acquisition. This allow about fifteen hours of autonomy with two CR2025 batteries (250mAh only). For the experimental sessions, it can be easily fixed on the body of the subject. The size of the circuit board has been highly reduced (we can deduce it with the sizes of the battery and of the MMC on the figure).

Positioning

This central is kept immobile on the subject body and worn into a pocket under his left armpit (shown by the pink point on Fig. 1-c). This position has been chosen for two reasons: the first is that it is as comfortable as possible for the subject (the card is very light and small), so it can be used for long time measurements and the second is that the movements of This figure also illustrates the position of the three axis that are created by the central, and that can be described as "the subject basis" ; and finally the orientation of the three axes on the circuit board (for both inertial and magnetic sensors -Fig. 1-d) that corresponds to this subject basis. We chose the different axis as reference to the roll, pitch and yaw axes of an aircraft. As in aeronautic, x is the roll axis, y is the pitch axis and z the yaw axis.

SIGNAL PROCESSING OF INERTIAL AND MAGNETIC SENSORS

Filtering process of accelerometers and magnetometers signals

Both sensors are acquired to 100 Hz in order to be compatible with other applications that the one presented in this article. However, as previously written, for a sensor placed on the upper part of the body, the bandpass necessary for a good analysis of the system is limited to 5Hz [START_REF] Bouten | A triaxial accelerometer and portable data processing unit for the assessment of daily physical activity[END_REF]. For this reason, both signals are filtered using a sixth order low-pass butterworth filter with a cut-off frequency of 5Hz. This kind of filter has been chosen for its flatness in the bandwidth and the order of the filter is selected to be optimal.

Transformation of the magnetometers signals

Magnetometers signal and Quaternion

Our algorithm consists in a pattern recognition using wavelets, on two different signals: the accelerometer signal, that varies with the movements of the subject because of the acceleration that is implied to do such a movement ; and the magnetometer signal that varies because when the subject moves, its position against the fixed earth magnetic field is modified. When the subject do the movement to stand up, we want only a three dimensional pattern of its movement. If we consider the magnetometer signal without any modification, this pattern will be modified with a rotation of the subject around the axis of his chest. Indeed, this pattern will depend on the position of the subject with respect to the north direction.

To compensate this modification of the pattern and become invariant with a rotation around the chest axis, we consider the quaternion representation of the movement for the magnetometer signal. This representation will give us an information on the three dimensional rotation that has been re-alized during the movement and so will not vary with the position of the subject.

In two dimensions, we can write a rotation using the complex numbers. To represent a combination of three rotations in R 3 , Hamilton introduced a fourth dimension to form an hypercomplex algebra over real numbers defined by

H = a + bi + c j + dk | [a, b, c, d] ∈ R 4 with i 2 = j 2 = k 2 = i jk = -1.
With that construction, a quaternion is able to represent a rotation in the 3D space, without singular representation (as for Euler angles). If we consider a composition of three rotations that form a movement in the 3D space, we can write this transformation as a simple rotation around one axis. Let's consider two vectors B 1 and B 2 . From these vectors we can define a new basis (i, j, k) as follow:

    i = B 1 B 1 j = B 1 2 B 2 -(B 1 •B 2 )B 1 || B 1 2 B 2 -(B 1 •B 2 )B 1 || k = B 1 ∧B 2 || B 1 ∧B 2 ||     (1)
Let's now consider b 1 and b 2 , the projection of respectively B 1 and B 2 in this new basis. The rotation from b 1 to b 2 can be written, in (i, j, k), as a rotation around k of angle θ with:

θ = arccos b 1 • b 2 b 1 b 2 (2)
Thus, such a rotation of angle θ and principle axis k = (k x k y k z )

T will be associated to the quaternion

Q = cos θ 2 sin θ 2 k x sin θ 2 k y sin θ 2 k z T (3)
With this representation, whatever could be the starting position regarding the magnetic north, as we will compute the transformation between two moments in 3D, the pattern will be the same for a given movement.

In the following parts, we will use this transformation on the magnetometers signals.

Data segmentation

Segmentation Criterion

The ACTIM6D device is realized to be used on long-term measurement. Analyzing the whole signal to find the patterns that correspond to the postural transition should create a too large amount of computation (while more that 80% of the signal is meaningless) and also should induce a lot of false detections.

For this reason, the first process that is applied to the filtered signal is a segmentation that will determine the possible positions of the postural transitions. While occurring a postural transition, the variations of the accelerometers are higher (due to the force that is being created by the wearer to perform this movement).

Noticing it, the segmentation is done by analyzing the standard deviation of the norm of the accelerometers. This norm evolves with the time (with the dynamical component of the accelerometer induced by the movement of the body).

Segmentation of the signal

From several realization of each movements (by the same person), we computed the respective standard deviation s ass and s all , respectively for Stand to Sit and Lying Down, allowing to take the decision with the following criterion:

Let N Accelero i be the norm, at the window number i and s i the standard deviation of the data inside this window:

Segmentation i =    1 if 0, 5 • s ass s i 1, 5 • s ass 2 if 0, 5 • s s i 1, 5 • s all 0 else (4)
The threshold of detection with half more and less of the initial values have been chosen with preliminary experimentations to reduce the number of false detections without nondetection.

However, this segmentation is not sufficient. Indeed, for example, tying the shoes or getting an object on the floor both create a false detection that will be canceled by the classification algorithm that follows.

Walk Detection

Walking periods detection

Walking give a frequency content in the bandwidth [0.8; 5Hz] [START_REF] Bouten | A triaxial accelerometer and portable data processing unit for the assessment of daily physical activity[END_REF]. We used the Short Term Fast Fourier Transform (STFFT) on the norm of the accelerometers, that greatly represent this oscillation during walking, with the acceleration due to the movement of the chest added to the gravity. As we are interested in an analysis on long-term of the activity of the person, we consider large windows (5 seconds), to detect the walking periods that correspond for example to a movement from a room to another and not only one step to take something in the kitchen.

We first windowed the signal using hamming window, which Fourier transform contains a first rebound extremely weak (comparing to the a rectangular window that have sinc as Fourier transform). We included an aliasing zone in the running window (to compensate the apodization of the window).

This STFFT is computed on the bandwidth [0.8; 5Hz] (M frequencies). The transform is then:

X(ω j , τ) = R x(t)w(t -τ)e -jω j t dt, τ ∈ R, ω j ∈ [0.8; 2Hz] (5)
Afterward, the decision is taken by overtaking a threshold, s marche . The output signal is given by:

S(τ) =      1 if M ∑ j=1 X(ω j , τ) > s marche 0 else (6)
That is to say if the frequency content in the considered bandwidth is sufficient to override the given threshold (determined by preliminary experimentations).

Walking periods and segmentation

As the temporal windows are large for the detection of walking periods (5 secs), if a window contains 3 secs of walking and a postural transition, we will miss the postural transition. Indeed, it is useless to analyze (for the postural transitions) a window that have been detected as walking. But the proximity of a postural transition with walking could be a reason of miss-detection of the transition.

To correct this, when a walking period is detected, the first and the last two seconds of the signal are analyzed more precisely to detect the beginning and the end of the walking episodes. This improves the detection of the transitions on sequences like up & Go but also in real life because no-one really stop his movement before sitting down after walking for example.

PATTERN RECOGNITION

Wavelet Analysis of Inertial and Magnetic Signals

Wavelets have been introduced by Morlet and Grossman to override the problems of the Fourier transform and provide a time-scale analyzing tool able to represent the local variations of a signal and operate on non-stationary ones. For this, we define a mother function ψ, well localized in frequency and time space, and we define a base from this function by translating and dilating it (ψ a,b (t) = 1 a ψ t-b a , with a > 0) and computing the coefficients of the transformation of the signal x with C a,b = +∞ -∞ x(t)ψ a,b (t)dt These coefficients create a two dimensional signal giving information on the energy at a given time b and a given scale a. If we consider an adapted wavelet, when searching for maximal surfaces on this two dimensional signals, we can localize in time and scale the apparition of the pattern [START_REF] Misiti | Les ondelettes et leurs applications[END_REF].

To do so, we will create patterns adapted to each postural transitions that we are looking for and we will look for each patterns in the windows determined by the segmentation algorithm.

Analyzed Data

The data to analyze are two multidimensional functions of time:

• The filtered accelerometer signals: a 3 dimensional vector A = (A x A y A z ) T where A v stands for the projection of the acceleration sensed by the accelerometer on the v axis on the body fixed basis.

• The quaternion representation of the movement acquired by the tri-axis magnetometer, a four-dimensional signal that represents the quaternion of the movement between t = 0 (beginning of the frame of time) and the current sample. For this signal, we only consider the angle θ , reproducible between two movements. For each of these four patterns we have four signals. These transitions are supposed to be isolated by the first process: the segmentation. From the segmentation results, we obtain a piece of signal, recognized as possible transition that is either Sit-stand/Stand-sit or Lying down/standing up. The classification process will determine if a real transition occured trying to detect the presence of a pattern in the piece of signal.

To define these four patterns, we asked a volunteer to realize these transitions ten times, we meaned these realizations and then we interpolated the four signals from this mean realization to obtain the wavelets. To do the interpolation, we need two different informations: the basis used to interpolate the signal (polynomial, cosines, etc.) and the degree of the interpolation (the number of coefficients). These two parameters, for each signals, have been determined empirically by analyzing firstly the shape of the signal (the most important point in the pattern recognition is to keep this shape as intact as possible). This shape give us an information on the kind of basis to use. Then, the second point, the degree, was determined by comparing the interpolated signal with the original signal and computing the error between both (and minimizing it). An example of such construction is given, for standing up from the bed, on figure 2.

CLASSIFICATION ALGORITHM

The previous models are designed one time (for a population). Once realized, we can classify the possible postural transitions detected by the segmentation algorithm. This The advantages of such a classification is that: • We have only one model that is not dependent of the speed of realization of the transition. The scale factor a will try to fit the shape whatever its speed could be. Only the way to perform the transition (and so the shape of the signal) is important. For a same transition between two subjects of a same population (young and healthy, elderly people...), this will not change. • Except for the segmentation algorithm, our process does not depend on many pre-defined coefficients that have to be adapted from one subject to another to be optimal. For an Up&Go experimentation, the whole results of the different phases of the process are given by Fig. 3 6. EXPERIMENTS AND RESULTS

Experimental protocol

This algorithm has been tested, to evaluate its performances, on fifteen healthy subject that volunteered for this experimentation. Within these 13 subjects, 6 were women and 7 men, with the following statistics: age: 30.4 years ± 6, weight: 69.7 kgs ± 7.5, size: 1.76m ± 0.08. The subjects were asked to reproduce movements of daily life inside the Health Smart Home of Grenoble. The whole experimental session was filmed by five webcams for indexation and verification. The flat was especially equipped with two chairs (firm, without armrest, height of the sit: 45 cm, angle sit/back: 10°), placed at 90°one with respect to the other) and a bed (firm, height: 46 cm). The two chairs are used to show the independence of the algorithm against the position of the chair. The scenario was as follow:

• Realize five Up & Go from the chair number one (an Up & Go is defined as follow: the subject is sat down on the chair, he stand up, walk for 4 m, turn around, come back, turn around the chair and sit down again), • A series of five sequences on the bed: the subject walk to the bed, lye down (on the back), stay in this position a few seconds, move on the bed on the left and on the right, stay immobile on the back, stand up and finally walk back to the initial position, • Stand-up in the living room, the subject has to tie up his two shoes and pick-up a pen from the floor. 1 describes the results of the experimentations. The algorithms give a good classification rate of 65% for the transitions Lying down and Standing up from the bed, and 75% for the transitions Sit to Stand and Stand to Sit. This difference is due to the fact that the transition with the lying position are more difficult to detect because of their complexity from one part (with the decubitus part), and because they contain also a sitting transition (and depending on the way to realize the global movement, it can be done with a little stop between both phases).

Results

Incorrect

Moreover, we can see that a large part of the bad classification are due to a bad segmentation. This can be explained by the differences between the subjects in the "strength" of the movement. It will change the acceleration due to the transition. For instance, we could have a subject that sit very slowly and carefully on the bed before the decubitus and on the contrary someone who literally jump on it.

Finally, the transitions are classified correctly in 70% of the cases for the global experiment, using the models and the coefficients for the segmentation obtains by the measurement of ten of each transitions performed by one subject that did not perform the whole experimental protocol.

CONCLUSION

We have described a complete process to detect postural transitions, from the signals of an accelerometers and a magnetometers. The segmentation part is performed by analyzing the standard deviation of a slicing window of the accelerometer signal and the classification part is based on detecting the pattern of the transition using the wavelet transform of the signal with an adapted mother wavelet.

Finally, we obtained a correct classification rate of 70% on an experiment involving 13 subjects. We also noticed that the segmentation part was the weakest point of the algorithm because it is responsible of a large part of the errors.

Futures works include the integration of the algorithms into the micro-controller and the improvement of the segmentation coefficients, by considering more signals to understand how to reinforce this part.

This work is a part of a largest classification algorithm implying this sensor and other environmental and location sensors in a flat. With a whole set of 18 sensors, we classify, using Support Vector Machines, the Activities of Daily Living (resting, sleeping, having a meal, hygiene, communicating, eliminating and dressing/undressing) with a correct classification rate of 86%. Improving the postural transitions detection could improve this classification results. This whole work aims at helping elderly people at home by monitoring their activities of daily living and detecting their loss of autonomy as earlier as possible.

Figure 1 :

 1 Figure 1: ACTIM6D and its positioning on the subject. (a): front side of the circuit board, (b): back side of the circuit board, (c): Positioning of the subject basis on the circuit board, (d): Positioning of the subject basis

Figure 2 :

 2 Figure 2: Mother wavelets for the four signals of the transition standing up from the bed. The dashed lines are the signals obtained from the mean of 10 realizations of the same movements and the straight lines are the mother wavelets given by the interpolation

Figure 3 :

 3 Figure 3: Results of the different phases of the algorithm, from the raw signal to the posture classification and the walk detection

Table 1 :

 1 Confusion matrix for the postural transition classification

			Correct
		Classification Classification
	Sit to Stand and Stand to Sit
	Incorrect Segmentation	8% (10)	10,4% (13)
	Correct Segmentation	6,4% (8)	75% (93)
	Lying down and Standing up from bed
	Incorrect Segmentation	13,4% (15)	17,8% (20)
	Correct Segmentation	4,4% (5)	64,2% (72)

Table

Acknowledgments

The authors would like to thank D. Flammarion, J. Groussier and S. Khong for their help on the circuit board design. Special thanks are also extended to S. Girard for her dressmaking contribution, to N. Vuillerme for his advices on the experimental part and to all the subjects for the time they spent taking part the experimental sessions.