Ruben Ibáñez

Emmanuelle Abisset-Chavanne
email: emmanuelle.abisset-chavanne@ec-nantes.frc

Elías Cueto
email: ecueto@unizar.esd

F Chinesta

Data-driven in computational plasticity

INTRODUCTION

Simulations are taking an important role as a tool to predict new scenarios circumventing the need of making several experiences in the laboratory. However, when a new problem is confronted two main difficulties have to be tackled. Roughly, it is known that simulations have two main sources of error. On one hand, numerical approximation will be associated to a discretization due to the fact that we are constraining continuous fields by a discrete set of degrees of freedom (dof's). On the other hand, the so-called constitutive equations are needed in order to close the system of equations. Typically, those equations relate the kinematic variables with their associated constraints. For instance, the tangent modulus is a fourth order tensor relating stress andstrain. Normally, constitutive laws such as Hooke's law are validdue the accordance between laboratory and simulation results. However, the problem appears when there is no accordance. Then, the main potential error source candidate is the constitutive equation related to the material specification. That is the reason why, there exists a vast library of material templates, for instance in the case ofhyperelasticitywe can find Neo-Hookean, Saint Venant, Ogden among others. Therefore, if a new material has to be tested, plenty of experiences have to be done in order to calibrate one of those templates. Hence, the need of developing numerical tools that will help to calibrate constitutive equations is crucial.

In the sequel, constitutive equations appearing in plasticity are going to be analyzed. Typically, the main equation defining the material behavior in this framework is called plastic yield function. The main role of the plastic yield function is to separate plastic and elastic regions, or in other words, whether the material deformation is irreversible or reversible, respectively. A more geometrical interpretation of a plastic yield function is to consider it as a surface living in the stress space as shown in Fig. [START_REF] Barlat | Linear transformation-based anisotropic yield functions[END_REF].

In a first part, a methodology, allowing to identify the yield function from a complex test, is proposed. Secondly, a sparse identification approach is given.

PROBLEM STATEMENT/LIMITATIONS IN PLASTICITY

Several plastic yield functions have been proposed throughout the history, i.e. Von-Misses, Tresca, Hill, Barlat, etc. Indeed, a problem will appear when a given plastic yield function is used to do a simulation and a difference is observed between experiences and simulations. If this difference is desired to be minimal, the first step is to provide a generalized parameterization of the plastic yield function. Afterwards, an extensive search has to be done in the generated span of such parameterization. Such search is motivated in order to find the combination in the parameter space so the difference between simulation and experiment is minimized. Despite of the fact that the stress field introduces plenty of information when determining the plastic yield function; it is not possible to measure it when relatively complex experiments are considered. That is the reason why, our figure of interest determining the similaritybetween a given simulation and a given experience uses the displacement field. Eq. ( 1) shows a scalar quantity (g) which is the global displacement error in the entire domain (V) taking into account the whole time interval (t).

= || exp ||

(1) Thus, the space in which we have to perform either an interpolation or an optimization problem has the same dimensionality than the parameterization of the plastic yield function. Increasing the dimensionality of the parameter space is not trivial, since the curse of dimensionality will appear sooner or later. Hence, strategies to develop either sparse interpolation or optimization techniques will be of crucial interest as well. Otherwise, there will be needed too many points to provide a good approximation in the high dimensional space.

Plastic Yield Function Parameterization

For the sake of simplicity, and without loss of generality, in what follows, we will work in a 2D spatial problem under plane stress hypothesis. Under these circumstances, the Cauchy stress tensor has three independent components. Therefore, the plastic yield function can be represented in a three dimensional space. In the sequel, its parameterization is done by a set of control points distributed along the surface. The rest of the surface will move according to continuous interpolating function so that the evolution of the plastic yield surface moves smoothly when the control points change. Another choice for the parameterization would be to precompute a POD-basis taking into account a set of already existing convex functions.

As mentioned before, our main objective is to identify which combination of parameters describes the better the displacement field captured in the laboratory. There are open questions related to the kind of experiences that has to be done in the laboratory. For instance, if only a homogeneous uniaxial traction test is done, only a small region of the plastic yield function will describe the mismatch between experiments and simulations whereas the rest of the plastic yield function will not cause any influence into the noticed difference. That is the reason why, either many simple test experiments or few but complex tests have to be used in order to introduce enough information to well capture the plastic yield function everywhere. Even though, an optimization problem can be settled in order to find the best candidate, it will require a lot of trial simulations to converge to the local minimum. Moreover, if each is computationally expensive, the global cost of the optimization will be prohibitive.

Another application related to plasticity is to infer the plastic yield function when only the information at certain points is known. Imagine a situation where after computing several homogeneous tests, the plastic yield function is only well calibrated at certain points of the surface but nothing has been said about the rest of the plastic yield. Then, data completion techniques are needed in order to complete the material response under any possible solicitation. The common point of both problematics resides in performing a smart interpolation when the objective function is known just at certain points which are not necessarily uniformly distributed. In what follows we propose a sparse counterpart of the PGD able to proceed in multidimensional settings.

SPARSE-PGD

The main ail of the present section is to develop new strategies with respect to traditional interpolation methods so that fewer points are required to give an overall estimation of the response surface. For the sake of simplicity, but without loss of generality, let's suppose that a two dimensional objective function, f(x,y) is desired to be approximated. Eq. ( 2) shows a standard weak form typical from FEM approximation.

( , )( ( , )

Nevertheless, the integral that multiplies the test function times the objective function is only known in few points (the ones corresponding to the measurements). Several options can be adopted in this scenario, for instance, the objective function can be first interpolated everywhere and then projected into the basis of the test function. However, the converged solution of this procedure will capture the already interpolated solution in the high dimensional space but in a more compact format. That is the reason why, we will like to first do the projection and then interpolation. Therefore, the test function is constraint to a set of Dirac delta function collocated at the P points at which measures were performed, as shown in eq. ( 3).

( , ) = ( , ) =1

Hence, the integral is transformed into a sum at the collocation points. The next step isto express the approximated function as a set of separated unidimensional functions, like in the classical PGD framework.

( , ) = ( ) ( ) =1 (4)
The last step is to provide a basis for each one of the unidimensional modes appearing in equation ( 4). Several options can be adopted, local linear shape functions, global non-linear shape functions, maximum entropy interpolants, etc. In this particular case, simple Kriging interpolants have been used in order to get relatively smooth solutions, avoiding spurious oscillations characteristic of high order polynomial interpolation:

( ) = =1 + ( ) =1 =1 (5) ( ) = =1 + ( ) =1 =1 (6)
Combining equations(2-6) a non-linear system of equations is obtained, which is solved using an alternate direction scheme, classical in the PGD framework.

FIGURE 1 .

 1 FIGURE 1.Barlat's Yld2004-18p under plane stress hypothesis.

FigureFIGURE 2 .

 2 Figure (2a) shows the Barlat Yld2004-18p plastic yield function where the trajectories inside are the gauss point stress recordsin the solid.The geometrical configuration is aL-shapedcantilever beam clamped in one of its borders, whereas in the other border a vertical traction isapplied. Figure (2b) shows the final yield function after the optimization procedure. The yield function has been parameterized by a set of control points (red points) distributed along the yield surface.The initialization of the optimization problem is done with a unit radius sphere.As it can be seen, the excited part is similar to the Barlat yield function. On the contrary, the top part of the optimized yield function did not move because the lab experiments to calibrate the yield did not take into accountthat region. That is the reason why, if the yield function is intended to be well captured everywhere,it is crucial to take a set of experiments which are able to excite the yield function everywhere.

FIGURE 3 .

 3 FIGURE 3. (a) Biaxial Barlat Yld2004-18p surface in polar coordinates R ( ) for different isotropic hardenings (h). Control points used in the interpolations (Red). (b) 2D Linear interpolation. (c) Sparse PGD interpolation with simple Kriging interpolants.

Figure

  Figure (3a) shows a response surface made out of different biaxial Barlat yield functions in polar coordinates for different isotropic hardening levels. The red control points are randomly distributed along the surface. Figure (3b) depicts the interpolated response surface using piecewise linear shape functionsbased on a Delaunay triangularization of the red control points.Figure (3c) represents the interpolated surface based on the same control points but using the sparse PGD algorithm. As it can be seen, the new algorithm takes profit of the separability of the reference solution providing less error than classical linear interpolations.


Timothy Claeys

Franck Rousseau

Bernard Tourancheau

Andrzej Duda

Clock Drift Prediction for Fast Rejoin in 802.15.4e TSCH Networks

HAL is

I. INTRODUCTION

There is a growing need for network protocols that meet the requirements for supporting the Internet of Things (IoT). The IEEE802.15.4e standard defined three new MAC-layer protocols [1]: i) the Deterministic and Synchronous Multichannel Extension (DSME) that uses the same beacon format as IEEE802. 15.4 and adds channel hopping, ii) Low Latency Deterministic Networks (LLDN), and iii) Time Slotted Channel Hopping (TSCH). TSCH defines a time synchronized network with dedicated timeslots to avoid collisions, and channel hopping, with maximum 16 frequency channels, for high reliability. Timeslot synchronization is important because the operation of the MAC layer relies on the precise time alignment of the timeslots. Clock imperfections may therefore lead to synchronization issues. To mitigate such problems, TSCH specifies a default scheme to maintain synchronization: nodes take advantage of the timing information on frame arrivals to calibrate their clocks. Stanislowski et al. [START_REF] Stanislowski | Adaptive Synchronization in IEEE 802.15.4e Networks[END_REF] extended this default scheme by introducing the concept of drift awareness in which nodes learn how their clocks drift with respect to their neighbors to dynamically change the amount of traffic required for a network to stay synchronized.

Synchronized operation and channel hopping have made TSCH one of the most promising solutions for a wide range of IoT applications (e.g. industrial, automotive, e-health applications) [START_REF] Elsts | Microsecond-Accuracy Time Synchronization Using the IEEE 802.15. 4 TSCH Protocol[END_REF]. A fast network rejoin procedure lets TSCH support truly dynamic networks with high churn when nodes often leave and rejoin the network, e.g. the Floating Sensor Network (FSN) project built at UC Berkeley [START_REF] Tinka | A Decentralized Scheduling Algorithm for Time Synchronized Channel Hopping[END_REF] or energy scavenging networks where nodes need to rejoin after the batteries are recharged. Currently, the only way to realign the timeslots of a node that wants to rejoin the network is to capture a specific frame, called an Enhanced Beacon (EB), containing synchronization information. If the network traffic is sparse and spread over multiple frequency channels, the rejoining node may have to scan actively for long time periods, which may be unfeasible for nodes with small batteries or energy harvesting. The current state of the art in this domain [START_REF] Vogli | Fast Join and Synchronization Schema in the IEEE 802.15.4e MAC[END_REF], [START_REF] Duy | A Rapid Joining Scheme based on Fuzzy Logic for Highly Dynamic IEEE 802.15.4e TSCH Networks[END_REF] has mainly focused on optimizing the bootstrap synchronization phase in which uninitialized nodes want to join a network.

In this paper, we first study in detail the internal and external root causes of the clock drift between two nodes. We begin with an analysis of the internal root causes by measuring the clock frequency variation on three hardware platforms, namely TelosB Crossbow [7], OpenMote-CC2538 [START_REF]A Powerful System-On-Chip for 2.4-GHz IEEE[END_REF], and GREENNET [START_REF] Varga | GreenNet: an Energy Harvesting IP-enabled Wireless Sensor Network[END_REF]. We investigate its effect on the clock drift and model the internal as well as external root causes of the drift. The investigation shows that a pair of nodes has a stable relative drift that depends only on the stability of the clock frequency. Moreover, platforms with a high frequency (HF) clock stay synchronized longer because the fluctuations in the clock frequency caused by the production spread (small imperfections in the crystal and the surrounding electrical components [START_REF] Elsts | Microsecond-Accuracy Time Synchronization Using the IEEE 802.15. 4 TSCH Protocol[END_REF]) have a smaller impact on the relative drift. Furthermore, we study the impact of external drift root causes such as temperature and input voltage to show that we can use the relationship between the external causes and the frequency of the crystal to compensate for an unstable relative drift.

Based on these investigations, we propose a new three phase scheme for rejoining the network with a minimal latency and energy consumption. In the first phase, when a node is still synchronized, it predicts the relative drift caused by internal and external sources with respect to its time source neighbors, the nodes whose timing information is used to calibrate the clock. The node also tracks the number of elapsing slots by using a low power timer. In the second phase, when the node becomes desynchronized, it can find the current network timeslot in an accurate manner by combining the drift prediction and the low power timer value. Finally, the node computes the right frequency channel based on the timeslot parameters stored in the persistent memory. The node uses a radio reception (Rx) window to capture passing frames. The length of the Rx window depends on the time during which the node was desynchronized and on the different types of drift sources. The window grows steadily to account for unforeseen drift factors.

We have implemented the proposed scheme in the Open-WSN stack 1 and evaluated its performance on three different hardware platforms. The experimental results show that our scheme outperforms the existing joining schemes. It achieves a faster rejoin latency and consumes much less energy because it accurately predicts the time location of frames transmitted by the time source neighbor and thus spends less time in radio active mode.

We start the paper with the background on IEEE802.15.4e TSCH in Section II. Section III presents the state of the art of the research relative to our work. Section IV shows the investigation results on modeling the sources of the clock drift and Section V introduces the proposed scheme. Section VI reports on the experimental results of the performance evaluation and Section VII concludes the paper.

II. IEEE802.15.4E TSCH: AN OVERVIEW

This section gives an overview of the IEEE802.15.4e TSCH protocol and discusses in detail its synchronization methods.

A. Slotted Schedule

TSCH uses a schedule, which repeats over time, to synchronize its communication in time and frequency. The schedule defines a slotframe structure consisting of a group of timeslots. Nodes can use different channel offsets during a timeslot so a timeslot is subdivided into individual slots (see Fig. 1). The schedule specifies the channel offset and the timeslots during which a node should wake up to communicate with its neighbors [START_REF] Palattella | Standardized Protocol Stack for the Internet of (Important) Things[END_REF]. The node can go to sleep to save energy in other slots. Each timeslot has an unique Absolute Slot Number (ASN): the total number of timeslots elapsed since the start of the network or an arbitrary start time determined by the PAN coordinator. The ASN counter is incremented for every timeslot and its value is tracked by all the devices in the network. The ASN and the channel offset uniquely identify a slot. A single slot is long enough to send a maximum length frame and receive an acknowledgement frame. The duration of a slot is implementation specific with 10 ms or 15 ms commonly used values. When a node wakes up for a transmission slot (Tx) in its schedule, it checks the transmission buffer for a frame to send. If the buffer is empty, the node goes back to sleep. If there is a frame in the buffer, the node turns the radio on, sends the frame, and waits for the acknowledgement if expected. For a reception slot (Rx), the node turns on its radio to receive a frame, sends back an acknowledgement if required, and goes back to sleep. When it does not receive anything within a specified time interval, it goes back to sleep. During the TxRx slot, the node first checks the buffer for a frame to transmit. If there is one, it proceeds as in the Tx slot, otherwise it acts as an Rx slot. No frame reception in Rx mode means that either the sender had nothing to send or the frame sent by a neighboring node was lost. One of the main advantages of TSCH is frequency channel hopping that results in frequency diversity to mitigate the effects of interference and multipath fading [START_REF] Palattella | Traffic Aware Scheduling Algorithm for Reliable Low-Power Multi-Hop IEEE 802.15. 4e Networks[END_REF]. Moreover, the use of several frequencies increases network capacity because more nodes can transmit at the same time. Nodes periodically switch the frequency channel using a hopping sequence, an ordered list of frequency channels (by default, it is a pseudorandomly sorted list of all available channels) known to both sending and receiving nodes. Two hopping nodes sharing a hopping sequence compute the frequency channel for a given slot with [1]:

CH = HS [counter mod sequence length], (1)
where HS is a hopping sequence, counter is a shared counter for a pair of communicating nodes, and sequence length is the length of the channel hopping sequence. In most TSCH implementations, the counter is constructed as the sum of the ASN and a channel offset for a given slot [START_REF] Palattella | Traffic Aware Scheduling Algorithm for Reliable Low-Power Multi-Hop IEEE 802.15. 4e Networks[END_REF], [START_REF]OpenWSN: Open-Source Implementations of Protocol Stacks Based on IoT Standards[END_REF]. Nodes can use 16 available frequency channels. If the hopping sequence length and slotframe size are relatively prime, nodes will successively hop through all available channels [START_REF] Palattella | Traffic Aware Scheduling Algorithm for Reliable Low-Power Multi-Hop IEEE 802.15. 4e Networks[END_REF].

B. TSCH PAN Formation and Maintenance

1) Building a TSCH Network: Nodes in the network advertise the network presence by periodically sending out Enhanced Beacons (EB) containing a payload with information elements (IE). IEs contain all the information needed by a new or desynchronized node to join the network. The following payloads are mandatory to ensure the successful synchronization of a new node: turned on, when they should expect an incoming data or acknowledgement frame. Fig. 2 presents a template.

• Channel Hopping IE: contains the hopping sequence used by the network. • TSCH Slotframe and Link IE: contains one or more slotframes and their active slots. The joining nodes can use the slots to communicate with the advertising device. A node willing to join the network turns its radio on and listens to EBs on a given channel [START_REF] De Guglielmo | A Performance Analysis of the Network Formation Process[END_REF]. The information delivered by an EB allows the joining node to construct an initial local schedule and to negotiate with the advertising node some dedicated slots in which only one pair of nodes can communicate. After building the initial schedule, the node has to select a time source neighbor for clock calibration and eventually construct its own EB for network advertisement.

2) Synchronization: As described above, a node initially synchronizes with the network by means of EBs. This way of operation is called advertisement based synchronization [START_REF] Vilajosana | A Realistic Energy Consumption Model for TSCH Networks[END_REF]. Every network has an advertisement policy that defines when nodes transmit EBs. After the bootstrap phase synchronization, nodes maintain time synchronization through regular communication with their time source neighbor. The need for synchronization comes from the fact that nodes have independent clocks, the frequency of which may diverge from the nominal frequency because of the production spread, small imperfections in the crystal and the surrounding electrical components. External factors can also influence the actual frequency of clocks. All these phenomena cause a clock drift: we assume that nodes have imperfect clocks C(t) with a given drift D such that dC(t) dt -1 ≤ D [15]. A typical value of D is 40 ppm for crystal clocks. The clock skew is the difference between a given clock with respect to the perfect clock after a certain time:

δ = [C(t) -t] • ∆t.
TSCH defines an additional synchronization method based on exchanging keep-alive frames. A higher layer such as 6top can create a keep-alive (KA) frame when there has been no clock calibration for a long time. When a node does not communicate with its time source neighbor for a time longer than the KA interval, it is considered desynchronized. KA frames contain no data, they are sent just to calibrate the clock.

When a node pair exchanges any frame with its time source neighbor, it uses either frame-based or acknowledgementbased synchronization. Both methods require the receiver to measure the clock skew (δ) between the expected and actual time of the frame arrival. Because of the clock skew, nodes have to use a guard time when turning on the radio. TSCH defines the Packet Guard Time (PGT) with typical value of 2600 µs [12] [14]. A receiver will turn its radio on PGT/2 earlier than it expects the arrival of a frame (see Fig. 3). If at least one frame is sent every KA interval, then |δ| < P GT 2 and the reception of the frame is guaranteed. When the node does not receive a frame preamble after a full PGT, it will turn its radio off and go back to sleep. The same procedure is used at the transmitter side when it expects an acknowledgement.

The frame-based and acknowledgement-based synchronization schemes are defined as follows:

1) The receiver records timestamp t s of the frame start symbol.

2) It measures the following clock skew:

δ = Radio offset + P GT 2 -t s , (2)
where Radio offset represents the time between the beginning of the timeslot and the activation of the radio. For Tx and Rx slots these offsets are called TsTxOffset and TsRxOffset, respectively, see Fig. 3. 3) In case of frame-based synchronization, the receiver will use the measured value of δ to calibrate its clock. When using acknowledgement-based synchronization, the receiver will add δ to the acknowledgement frame, which is sent back to the transmitter. In this scenario, the transmitter calibrates its clock.

III. RELATED WORK

In this section, we give a brief overview of the main proposals related to our work and with which we compare in the evaluation. The vast amount of related research has mainly focused on optimizing the bootstrap synchronization phase for single channel protocols. Nodes have no prior knowledge of the network but use only one radio frequency for discovery [START_REF] Dutta | Practical Asynchronous Neighbor Discovery and Rendezvous for Mobile Sensing Applications[END_REF] [17] [START_REF] Qiu | Talk More Listen Less: Energy-Efficient Neighbor Discovery in Wireless Sensor Networks[END_REF]. We do not assess these proposals as our scheme focuses on a multichannel rejoining scenario, where we can exploit previously gained network information. In this paper, we compare our scheme to the proposals of Vogli et al. [START_REF] Vogli | Fast Join and Synchronization Schema in the IEEE 802.15.4e MAC[END_REF] and Duy et al. [START_REF] Duy | A Rapid Joining Scheme based on Fuzzy Logic for Highly Dynamic IEEE 802.15.4e TSCH Networks[END_REF] as their join schemes also specifically focus on the TSCH protocol. Both papers impose network advertisement policies, while our scheme does not require any specific scheduling of EBs nor data frames.

Vogli et al. [START_REF] Vogli | Fast Join and Synchronization Schema in the IEEE 802.15.4e MAC[END_REF] proposed two advertisement policies: Random Vertical filling (RV) and Random Horizontal filling (RH). The RV policy fixes a timeslot. Each new node that joins the network sends one EB per slotframe. The location of the EB in the schedule is defined by the fixed timeslot and a randomly picked channel offset. In contrast, the RH policy fixes the channel offset and randomly chooses a timeslot. As timeslots or channel offsets are randomly picked, there is no guarantee that a slot will not be taken twice by neighboring nodes. If this happens, EBs are lost due to collisions. The chance that a node captures an EB will also reduce when the slotframe size and the amount of used channel offsets increases [START_REF] De Guglielmo | A Performance Analysis of the Network Formation Process[END_REF].

Duy et al. [START_REF] Duy | A Rapid Joining Scheme based on Fuzzy Logic for Highly Dynamic IEEE 802.15.4e TSCH Networks[END_REF] took a similar approach, but they let every node send multiple EBs per slotframe. Their scheme divides a slotframe into an advertisement plane and a data plane. Each synchronizer, a node that advertises the network with EBs, uses the advertisement plane to send a EBs on random consecutive channels. The number of EBs sent by each synchronizer depends on the output of a fuzzy system that takes into account the number of neighbors in the network and optimizes the number of EBs sent by each node.

IV. IDENTIFYING ROOT CAUSES OF THE CLOCK DRIFT, CLOCK SKEW AND ITS MODELING

In subsection IV-A and IV-B, we respectively investigate the internal and external sources, i.e., voltage and temperature, of the clock drift and the clock skew on different hardware platforms running TSCH. The methodology of the study is to have a one-hop network with a sink and a leaf. We deactivate all drift mitigation techniques of TSCH in OpenWSN and measure the clock frequencies on the nodes with a logic analyzer [19] that samples at 50 MHz.

OpenWSN expects each node to have a clock frequency of exactly 32 768 Hz. Therefore, a perfect clock with a frequency of 32 768 Hz is our reference clock to measure the drift and the skew of a given clock. Fig. 4a shows the frequencies of the crystal oscillator for both the sink and the leaf for each tested platform, the reference clock is shown by the dashed line. We call the difference between the real frequency and the reference the absolute drift (D abs ). The difference between the absolute drift of the sink and the leaf is the relative drift (D rel ). Fig. 4b shows how fast the clocks diverge with respect to a perfect clock by showing the absolute clock skew, and with respect to each other, by presenting the relative clock skew. Every time the node uses Eq. ( 2), it actually measures the relative clock skew with respect to its time source neighbor. We only show the absolute clock skew for the sink and the relative clock skew to keep the figure readable. The leaf absolute skew is not shown in Fig. 4b.

A. Internal Drift Causes

The TelosB platform has a 32 768 Hz crystal oscillator [START_REF]MSP430 32-kHz Crystal Oscillators[END_REF] and we observe that it has the smallest absolute drift (see Table I), but also important fluctuations, caused by the production spread. The GREENNET motes use a 64 kHz clock [START_REF] Varga | GreenNet: an Energy Harvesting IP-enabled Wireless Sensor Network[END_REF] with a scaling factor to approximate a 32 768 Hz clock. As the oscillator frequency is not a multiple of 32 768 Hz, the resulting frequency deviates with an extra 2 Hz from the reference frequency, resulting in a greater absolute drift. The OpenMote nodes have a 32 MHz internal oscillator [START_REF]A Powerful System-On-Chip for 2.4-GHz IEEE[END_REF], so its output is divided by an integer to obtain the frequency of 32 768 Hz. Similarly to the GREENNET platform, the 32 MHz frequency of OpenMotes is not a multiple of 32 768 Hz and the obtained frequency is shifted with roughly 18 Hz on top of the production spread, giving them very high absolute drift. The absolute drift shown in Table I generates an increasing absolute skew, δ abs , with respect to a perfect clock of 32 768 Hz (see Fig. 4b) represented after time ∆t by the following relation:

δ abs = ∆t 1 1 ± e f + , (3)
where ±e f [ppm] is the production spread and represents the frequency shift due to integer divisions.

The absolute skew for the OpenMote nodes is the largest due to the large shift of 18 Hz. At the same time, the OpenMote nodes present small frequency fluctuations while they are fairly large on TelosB and GREENNET, which explains the smaller relative drift (D rel ) for OpenMotes. The clock of OpenMotes runs at 32 MHz and dividing its frequency by almost 1000 renders the clock fluctuations negligible. For the TelosB and GREENNET nodes, the frequency fluctuations result in a greater relative drift. When the resulting relative skew exceeds PGT 2 , i.e. 1300 µs, indicated by the dashed line in Fig. 4b, the leaf desynchronizes.

We can observe that combining nodes of different hardware platforms leads to an increased relative skew due to a large ∆ between platforms. Synchronization in heterogeneous hardware networks falls out of the scope of this paper, but the authors are actively working on this issue.

B. External Drift Sources

1) Temperature: The main external factor that influences the clock drift is temperature. Other causes, i.e. supply voltage and crystal aging, change more slowly [START_REF] Stanislowski | Adaptive Synchronization in IEEE 802.15.4e Networks[END_REF]. Datasheets of clock crystals often describe the relationship between the temperature and the crystal frequency. We can use this information to compensate the varying drift when a node can measure the temperature changes, see subsection V-B.

2) Voltage: We have tested the impact of the battery voltage on the TelosB crystal oscillator. We only tested the TelosB platform as it is the only platform at our disposal that does not have any voltage regulator. The input voltage is directly applied to the clock crystal. In an experiment, we have successively used the voltage of 1.8 V, 3 V, and 4 V for periods of ten minutes. We have measured the following corresponding frequencies: 32 768.42 Hz, 32 768.45 Hz, and 32 768.49 Hz. Although we can notice a slight increase in frequency with the growing input voltage, the values are too small to conclude that the changing voltage would noticeably influence the clock drift for this platform. The TelosB nodes include a battery voltage monitor that can track the voltage levels of the battery. Platforms whose clock drift depends on a changing input voltage can use such a monitor to compensate for this external form of the varying drift.

C. Clock Drift and Clock Skew Model

By accounting for all the previous causes of the clock drift, we can use the following relation to estimate the relative skew between a node and its time source neighbor after time ∆t:

δ rel = ∆t 1 1 -e f - 1 1 + e f + E(t) + ∆ , (4)
where E(t), ∆ and ±e f represent the varying drift from external causes, the difference in the frequency shift between the nodes and the production spreads of the nodes, respectively.

V. PREDICTIVE REJOINING SCHEME FOR TSCH

Building on the model presented in the last section, we propose a fast rejoining scheme based on the prediction of the clock drift and the resulting skew. The scheme minimizes the join latency and energy consumption. It is backward compatible with the TSCH protocol. Nodes implementing the scheme do not rely on any actions taken by other nodes and can thus coexist with "standard" nodes. As we assume that the radio is the main energy consumer, the scheme needs to minimize the time during which a node actively scans for EB frames and tries to rejoin the network. To decide when the node needs to start receiving, the scheme computes the relative clock drift to predict the instant of the next frame, sent by a time source neighbor. The duration of the Rx window depends on the predicted skew, the minimal duration being default PGT (2600 µs).

A. Principles of the Rejoining Scheme

The scheme consists of three phases:

Phase 1. The first stage occurs when nodes are still synchronized. Every node periodically measures its clock skew with respect to its time source neighbor, δ rel , by using the frame-based synchronization method and calibrates its clock accordingly, see Fig. 3. The rejoining scheme sums up the measured skews over a time interval. The relative drift can be calculated by dividing the skew sum by the time interval. This estimation is constantly updated while the node stays synchronized. A node also stores the ASN value each time it measures δ rel . After each clock calibration, the node restarts a low power timer that counts the elapsed slots until a new clock calibration occurs. The timer keeps running even when the node is in the low power sleeping mode to save energy.

A node becomes desynchronized when the time elapsed since the last clock calibration exceeds the KA interval. For example solar-energy powered nodes desynchronize during the night. At this instant, we cannot guarantee that frames will be captured as the relative clock skew, δ rel , might be larger than PGT/2. When the desynchronized node does no longer exchanges frames with its time source neighbor, the clock drift causes the skew to grow further (see Fig. 5). The ASN of the desynchronized node for a given slot does not longer correspond to the ASN used by its time source neighbor and Eq. (1) will not give the right frequency channel. We can notice that all other information delivered in the EB frame (slotframe size, channel hopping sequence, and timeslot template) during the bootstrap phase of the network stays valid after desynchronization. We can make this assumption because changing these parameters would require a full update of the whole network.

Phase 2. The second phase starts when the node detects its desynchronization, which may happen either directly after the KA interval overflow or after an extended period of time when the node wakes up from low power mode. The node adds the value of the low power timer to the most recently stored ASN. The resulting value gives the node the first estimation of the ASN currently used by the network. Then, the node calculates the additional skew by multiplying the most recent relative drift estimation with the total time the node was desynchronized. If the additional relative skew since the last clock calibration is larger than an entire timeslot, the node updates its estimated ASN value. For example, on the right side of Fig. 5, the desynchronized node estimates an ASN of 94, while due to the clock drift, the actual ASN used by the network, and the time source neighbor, is 93. By accounting for the additional skew, a node detects that the estimated ASN is off by 1 because the additional skew is larger than a timeslot. Phase 3. In the final step, the desynchronized node looks at its stored schedule for the first Rx slot for communication with its time source neighbor and it goes to sleep up to the Rx slot. When the node wakes up, it reestimates its additional skew as if it had to sleep for a long time until the Rx slot. The schedule contains the channel offset of the respective Rx slot and combined with the estimated ASN, the node can tune its radio to the right frequency channel. The node uses the estimated skew to reschedule the Rx window such that it aligns with the Tx window of its time source neighbor (see Fig. 6a). The node activates its radio for the PGT interval. If the time source neighbor does not send a frame in the Rx slot, the node repeats the final step and locates the next Rx slots.

When the node successfully captures an incoming frame from its time source neighbor, it recalibrates its clock with the KA based synchronization method. The low power timer is reset and the node becomes again synchronized with the network. The captured frame does not have to be necessarily addressed to the desynchronized node, but the transmitter must be its time source neighbor. The node can use any frame coming from the time source neighbor to synchronize (so its content is not important), which means that an encrypted frame can also be used to resynchronize-only the arrival instant is needed to recalibrate the clock.

B. Compensation for Unpredictable Drift Causes

Unforeseen drift fluctuations after desynchronization and finite arithmetic precision during the skew estimation may create an undetected skew between the Tx window of the time source neighbor and the Rx window of the desynchronized node, see Fig. 6b. This skew comes from the fact that the relative drift the node established during phase 1 of the rejoining scheme is only an ephemeral estimation. The relative drift can change any moment after desynchronization due to external causes, e.g. temperature fluctuations. Once the node is desynchronized, it is no longer aware that the relative drift has changed as it cannot communicate with its time source neighbor. The second cause of scheduling errors is the finite precision when the node estimates the relative skew because all platforms only use 16-bit integer arithmetic. Rounding errors become more relevant when a node is desynchronized for longer periods.

To compensate for the skew caused by unforeseen drift causes, the Rx radio window grows steadily in time (see Fig. 6b)-it depends on the total time the node was desynchronized, the arithmetic precision, and the worst case external drift change, e.g. the largest temperature change, expected in the network. The window expands in both directions as the desynchronized node does not know in which direction the clock will drift. Nodes with a temperature sensor and having sufficient energy can apply drift compensation in real-time. Its goal is to keep the actual relative drift as close as possible to the previously established relative drift estimation. If the node obtains a stable relative drift by compensating the drift changes that occur after desynchronization, our scheme gives a more precise prediction of the relative skew and the instant of the Tx window used by its time source neighbor, which results in an smaller Rx window, thus lower energy consumption.

VI. EXPERIMENTAL EVALUATION

To validate our prediction-based rejoining scheme, we have implemented it on the hardware platforms [7] [8] [9], using the OpenWSN networking stack. We use the TSCH-minimal schedule with 16 frequency channels and a slotframe of 101 timeslots, 15 ms each to obtain a 1% duty cycle [START_REF] Vilajosana | Minimal 6TiSCH Configuration[END_REF]. The EB interval is the sum of a fixed value of 30 s and a random value chosen in [-3.48; +3.48], which lowers the probability of an EB collision when nodes use the same EB interval and the same timeslot. We compare our scheme with the proposals by Vogli et al. [START_REF] Vogli | Fast Join and Synchronization Schema in the IEEE 802.15.4e MAC[END_REF] and Duy et al. [START_REF] Duy | A Rapid Joining Scheme based on Fuzzy Logic for Highly Dynamic IEEE 802.15.4e TSCH Networks[END_REF].

A. Join Latency

In the first experiment, we have evaluated the join latency of our scheme on the three platforms. The first node is configured as the network sink, while a second node is set up as a network leaf. At the beginning of the experiment, we wait until the leaf is synchronized with the sink. Once the initial synchronization occurs, we wait an additional 5 min so that the leaf node learns its relative drift (see Phase 1 of Section V) with respect to the sink. Once the leaf node establishes an initial relative drift estimation, the sink node starts sending frames on an unreachable frequency channel. After a period of the KA interval, the leaf node enters the desynchronized state and the resynchronization procedure starts. The sink node keeps transmitting its frames on the unreachable frequency channel for 5 min. After this delay, we instruct the sink to return to the same channel hopping sequence as the leaf node. Starting from this instant, we start measuring the time for the leaf node to resynchronize with the sink. In this experiment, the rejoin procedure becomes active directly after the node desynchronizes as the node has sufficient energy.

Table II shows the average join latency for three different scenarios. We obtain the experimental results for our scheme after 35 runs on the OpenMote platform and we compute the average join latency for the other schemes based on the theoretical expressions experimentally validated by the authors in their respective papers [START_REF] Vogli | Fast Join and Synchronization Schema in the IEEE 802.15.4e MAC[END_REF], [START_REF] Duy | A Rapid Joining Scheme based on Fuzzy Logic for Highly Dynamic IEEE 802.15.4e TSCH Networks[END_REF]. Below the results for the other proposals, we show the ratio with respect to our scheme. We can see that our scheme significantly outperforms the other proposals in each scenario. The upper bound join latency for our scheme corresponds to the interval between EBs as we will always capture every frame sent by the time source neighbor for a Packet Delivery Ratio (PDR) of 100% and the correct drift estimation. However, other frames such as Routing Protocol for Low-Power and Lossy Networks (RPL), KA, or data frames will very often speed up the resynchronization process, because they are also sent by the network and they do not cost any additional energy. Adding extra EB frames will therefore only slightly improve the speed of our scheme. The other proposals only use EBs for resynchronization and do not predict the instant of the transmitted EBs. Fast Join by Vogli [START_REF] Vogli | Fast Join and Synchronization Schema in the IEEE 802.15.4e MAC[END_REF] sends one EB per node. Rapid Join Scheme by Duy [START_REF] Duy | A Rapid Joining Scheme based on Fuzzy Logic for Highly Dynamic IEEE 802.15.4e TSCH Networks[END_REF] has two modes: the first mode is the same as Fast Join, and the second mode lets every node send multiple EBs (it is the scheme in the last row of Table II). The latter mode obtains faster rejoin, but consumes more energy from the network perspective as every node sends extra EBs. A typical energy cost for an EB, depending on its size and hardware platform, is 72.4 µJ with a battery at 2.2 V [START_REF] Duy | A Rapid Joining Scheme based on Fuzzy Logic for Highly Dynamic IEEE 802.15.4e TSCH Networks[END_REF].

We have further tested the influence of the application traffic on the rejoin scheme performance on the other hardware platforms. Fig. 7 shows the synchronization speed for three different traffic loads. In the first setup, there is no application compiled on top of the stack and nodes only rely on EBs, RPL, and KA frames to resynchronize. In the second setup, the sink node injects one data frame in the network every EB period and in the last scenario, the sink sends four extra data packets per EB period. We notice that the resynchronization speed for our scheme is independent from the platform and shows the same behavior as in Table II. We can also see that there is one outlier for the TelosB experiment with no application data. We cannot be sure what caused the desynchronized node to miss earlier frames, but we suspect interference issues. Our scheme reschedules its Rx window and resynchronizes to the next frame sent by its time source neighbor.

B. Expanded Radio Reception Windows

1) Impact of the Arithmetic Precision: The OpenWSN code is written in a portable way so it can be run on a wide range of different platforms. We have used integer arithmetic for computing the relative skew because either the usage of floating point arithmetic is not supported or the memory and speed costs are too high. We have optimized our code to obtain a relative drift precision of 0.5 ppm. To get the experimental results in Table III, we have used the same setup as in the first experiment, but we have desynchronized the leaf for 1 h. At the end, we have measured with the logic analyzer [19] at 25 MHz the difference between the skew prediction and the real skew. The desynchronized node uses a standard Rx window size of PGT. If the unpredicted skew is smaller than the half PGT (1300 µs), a successful resynchronization is possible without an expanded Rx window (see Fig. 6). We notice that after 1 h both the OpenMote and TelosB platforms are still able to resynchronize without an expanded Rx window. The bad results on the GREENNET platform can be explained by looking at the relative drift prediction and the actual drift between a GREENNET pair of nodes: the prediction error on the GREENNET platform is significantly larger because the relative drift for the GREENNET nodes amounts to Leaf Sink (1) (1)

(1) (1)
(2)

(2)(3) (3) (1) (1)
(2) 6.8 ppm (see Table I), which is not a multiple of 0.5 ppm, the smallest step we can apply in the Rx rescheduling process with our scheme. Therefore, the drift estimation introduces an extra error of 0.2 ppm. The relative drifts for the other platforms are multiples of 0.5 ppm, which results in a smaller error.

2) Temperature Impact: In this experiment, we have evaluated the growth of the Rx windows when after desynchronization, a node is exposed to a fluctuating relative drift caused by temperature changes. We have considered two cases: i) a node without a temperature sensor and therefore it could not compensate the additional drift, ii) a node with a temperature sensor, compensating the measured drift in real-time. In both experiments, the TelosB sink was in a room with a temperature of approximately 25 • C. The leaf was put in an environment where the temperature ranged between 10 • C and 35 • C. The leaf measured its temperature and relative clock drift every minute, and sent the results to the sink as plotted in Fig. 9. The drift compensation in the second scenario was computed using the relation -0.035 ppm/ • C 2 ×(T -T 0 ) 2 [START_REF]MSP430 32-kHz Crystal Oscillators[END_REF]. When the nodes start communicating, the temperature is 25 • C everywhere and the clocks operate at their nominal temperature. The relative drift measured during the first 10 min of the experiment, at a constant temperature, is around 9.5 ppm for node pair (1) and (2). After 10 min, we have gradually changed the temperature in the environment of the leaf node. The node, without temperature sensor, is not aware of the temperature fluctuation. It cannot compensate and the relative drift for node pair (1) changes drastically. Notice that Phase 1 of our scheme accounts for the observed 9.5 ppm and the expanded Rx window must compensate for the additional drift.

Node pair (1) has an additional 5 ppm drift caused by the temperature changes (see Fig. 9), which amounts to 18 ms after 1 h. Because we cannot predict how the drift changes, we would have to expand the Rx window at both sides to: We use a simplified energy model by Vilajosana et al. [START_REF] Vilajosana | A Realistic Energy Consumption Model for TSCH Networks[END_REF] to obtain energy consumption from the current measurements shown in Fig. 8. Table IV presents the measured energy (mJ) on a TelosB node for the different states of a timeslot. Fig. 8 shows (1) the CPU waking up to check if a frame needs to be sent at this timeslot, (2) the preparation of the data that needs to be sent, (3) activation of the radio in Rx or Tx mode, (4) the CPU waking up, noticing there is an incoming frame, calculating the skew and rescheduling the Rx window, and (5) the CPU verifying there is no incoming frame from the time source neighbor. In Fig. 8, (4) shows the computational overhead of the scheme in phase 2 and 3. The code is not optimized but only uses basic arithmetic operations. The nonoptimized code size is 2.5 kB. The OpenWSN stack code size is currently more than 50 kB. The overhead of phase 1 is negligible as it only increments a counter, uses additions and a simple division to estimate the clock drift. We can compute the total used energy in a timeslot as the sum of the energy spent in each state (Idle, Active, Radio), where T , I and V b are the time spent, the current drawn in a state, and the battery voltage, respectively:

E tot = (T Id • I Id + T Act • I Act + T T x|Rx • I T x|Rx ) • V b . (5)
An "idle slot" is a slot during which only the CPU is responsible for energy consumption. Slots during which the radio is active are "radio slots". Fast and Rapid Rejoin Schemes [START_REF] Vogli | Fast Join and Synchronization Schema in the IEEE 802.15.4e MAC[END_REF], [START_REF] Duy | A Rapid Joining Scheme based on Fuzzy Logic for Highly Dynamic IEEE 802.15.4e TSCH Networks[END_REF] cannot use prediction to localize the incoming EB. Therefore, they need to keep their radio active all the time. The multibeacon option of Rapid Join also requires additional network energy because it sends multiple EBs in the same EB period. Because the sink uses a duty cycle of 1%, our scheme also approaches this duty cycle. It uses one double sized active slot to reschedule the Rx window and 99 idle slots per slotframe (see Fig. 8b). This approach facilitates rescheduling of the Rx window when it is located in between two timeslots. The energy drawn for 99 idle slots and 1 double sized active slot is 1.29 mJ. While the energy for 101 active slots is 59.99 mJ. Table V shows the computed energy for the measured join latency presented in Table II. Below the used energy for the other proposals, we show the ratio with respect to our scheme.

VII. CONCLUSION

This paper proposes a novel predictive resynchronization scheme that allows nodes to rejoin quickly the TSCH network with which they were previously synchronized. The idea of the scheme comes from the modeling of the clock drift root causes. Based on the prediction of the relative drift, we are able to determine the instant at which a node needs to wake up after desynchronization thus reducing its energy consumption.

The predictive rejoining scheme is composed of three phases. In phase 1, while nodes are still synchronized, they learn their relative drift with respect to their time source neighbors. Phase 2 happens when the node desynchronizes from the network. It estimates the correct ASN based on a low power timer and skew prediction. Phase 3 applies a rescheduled Rx window that has an adapted length to compensate unforeseen drift sources.

We have compared the proposed scheme with other stateof-the-art proposals. The experimental results show that our scheme significantly outperforms other proposals as we can exploit the previously obtained network information. The scheme results in a join latency that is up to 34 times faster and the nodes consume a factor of 1000 less energy.

Fig. 1 .

 1 Fig. 1. Example TSCH schedule and slotframe with 6 timeslots, 4 channel offsets, and slots dedicated to Tx or Rx operations.

Fig. 2 .

 2 Fig. 2. Timeslot template indicates the time offsets within the timeslot. PGT and AGT stand for Packet and Acknowledgment Guard Time, respectively.

Fig. 4 .

 4 Fig. 4. Clock measurements on TelosB Crossbow, OpenMote-CC2538, and GREENNET platforms (at 25 • C): a) frequency variations in time, b) clock skew.

Fig. 5 .

 5 Fig. 5. Node pair timeline: the skew grows larger than the entire timeslot.

Fig. 6 .

 6 Fig. 6. Node pair timeline illustrating rejoin. (1) TsRxOffset and TsTxOffset before the respective Tx and Rx radio windows. (2) The predicted relative skew allows for rescheduling of the Rx window (shown as the RX' window). (3) Rx window expands for the unpredictable skew after desynchronization.

Fig. 7 .

 7 Fig. 7. Join latency after 35 experimental runs for three application traffic loads on three different platforms.

Fig. 8 .

 8 Fig. 8. Current measurements with a Tektronix MD03012 oscilloscope for energy consumption evaluation on the TelosB platform (battery at 2.2 V).

( 2 •

 2 18 ms) + PGT = 38.6 ms. Node pair (2) only needs to compensate an additional 1.5 ppm, which amounts to a smaller Rx window of 13.4 ms.C. Predictive Rejoin Scheme FootprintFig.8presents the measured current consumption: a) by a synchronized pair of TelosB nodes and b) when the predictive rejoin scheme reschedules the Rx window.

Fig. 9 .

 9 Fig. 9. Temperature and drift in time for compensated and uncompensated TelosB pairs shows that temperature changes cause an additional drift.

TABLE I MEASURED

 I FREQUENCY (Hz) AND DRIFT (PPM) ON CHOSEN PLATFORMS.

		Avg. Frequency	D abs	D rel
		Sink	Leaf	Sink	Leaf	S -L
	TelosB	32768.65	32768.34	20.1	10.6	9.5
	GREENNET	32766.47	32766.47	46.3	39.5	6.8
	OpenMote	32786.93	32786.93	578.5	584.0	5.5

TABLE V ENERGY

 V USED FOR RESYNCHRONIZATION(mJ)

	Join scheme	EB (30 s)	EB (15 s)	EB (6 s)
	Predictive Rejoin	6.45	5.15	4.51
	Fast|Rapid Join [5][6]	15.3e3	7.65e3	3.06e3
		× 2372	× 1485	× 678
	Rapid Join [6] (4 EBs)	3.82e3	1.91e3	0.76e3
		× 592	× 370	× 168

The OpenWSN project provides open-source implementations of IoT protocol stacks (https://github.com/openwsn-berkeley).

• Synchronization IE: contains the current ASN.• Timeslot IE: contains the timeslot template that specifies when the radio of the receiver and sender should be

VIII. ACKNOWLEDGMENTS This work has been partially supported by the LabEx PERSYVAL-Lab (ANR-11-LABX-0025-01) funded by the French program Investissement d'avenir, the FUI IoTize project funded by Région Auvergne-Rhône-Alpes, and the DataTweet project under contract ANR-13-INFR-0008-01.


Sebastien Berujon

Eric Ziegler

Ruxandra Cojocaru

Thierry Martin

Development of a hard X-ray wavefront sensor for the EuXFEL

Keywords: wavefront, sensor, diagnostic, X-ray Free Electron Laser, metrology, speckle

We present developments on a hard X-ray wavefront sensing instrument for characterizing and monitoring the beam of the European X-ray Free Electron Laser (EuXFEL). The pulsed nature of the intense X-ray beam delivered by this new class of facility gives rise to strong challenges for the optics and their diagnostic. In the frame of the EUCALL project Work Package 7, we are developing a sensor able to observe the beam in the X-ray energy range [8-40] keV without altering it. The sensor is based on the speckle tracking principle and employs two semi-transparent optics optimized such that their X-ray absorption is reduced. Furthermore, this instrument requires a scattering object with small random features placed in the beam and two cameras to record images of the beam at two different propagation distances. The analysis of the speckle pattern and its distortion from one image to the other allows absolute or differential wavefront recovery from pulse to pulse. Herein, we introduce the stakes and challenges of wavefront sensing at an XFEL source and explain the strategies adopted to fulfil the high requirements set by such a source.

INTRODUCTION

Hard X-rays are simultaneously light waves with wavelengths in the Angstrøm range and photons with energies of several kilo electron-volts, such properties making this light very difficult to handle. While the optics requires a precision of the optical figure approaching such a short wavelength, the optical material interacts only weakly with the photons. This is why only few approaches are available for wavefront sensing in the hard X-ray regime, where the deflection of light involves angular magnitudes that are much smaller than one degree. Yet, wavefront sensing becomes meaningful on condition that the sensing accuracy is better than the wavelength.

Usually, the spatial resolution required for an X-ray at-wavelength metrology tool should be of a few micrometers and its wavefront gradient sensitivity on the order of a few tens of nanoradian. Several approaches fulfilling these precision requirements have been developed at synchrotron sources [START_REF] Sawhney | At-wavelength Metrology of X-ray Optics at Diamond Light Source[END_REF] . Nevertheless, most of them rely on the generally true assumption that synchrotrons deliver stable beams, thus making the acquisition of many measurements possible.

Hard X-ray wavefront sensing of a XFEL beam is more intricate than for an X-ray synchrotron beam due to the pulsed nature of the delivered light. Each bunch of photons is generated independently and presents optical features that must be characterized. Several wavefront characterization techniques were tested at XFEL facilities including the grating-based [START_REF] Rutishauser | Exploring the wavefront of hard X-ray free-electron laser radiation[END_REF][START_REF] Kayser | Shot-to-shot diagnostic of the longitudinal photon source position at the SPring-8 Angstrom Compact Free Electron Laser by means of x-ray grating interferometry[END_REF][START_REF] Kayser | Wavefront metrology measurements at SACLA by means of Xray grating interferometry[END_REF] and the coherent diffraction imaging-based methods [START_REF] Loh | Sensing the wavefront of x-ray free-electron lasers using aerosol spheres[END_REF][START_REF] Schropp | Full spatial characterization of a nanofocused x-ray free-electron laser beam by ptychographic imaging[END_REF][START_REF] Sikorski | Focus characterization at an X-ray free-electron laser by coherent scattering and speckle analysis[END_REF] .

One drawback of grating-based methods is the absorption induced by the regular wavefront modulator and the hypothesis stating that the grid would remain perfect and unruffled during the acquisition of a series of measurements over a train of X-ray pulses. A sine qua non condition for such an assumption to be valid is that gratings are made of a stable material such as diamond. The silicon grating, commonly employed with a synchrotron beam, would be too sensitive to the high flux density delivered by the XFEL. Diffraction-based methods requires many exposures to achieve the accuracy and certainty necessary for the optimization of a beamline, which eventually can make these methods slow to converge.

In the frame of the EUCALL project, a consortium of European institutes providing pulsed X-ray light sources, the ESRF is committed to develop a wavefront sensor based on the speckle tracking method capable of sensing the wavefront of each individual hard X-ray pulse arriving at the detector. The instrument is planned to be installed at the FXE beamline [START_REF] Bressler | Technical Design Report: Scientific Instrument FXE[END_REF] of the EuXFEL for the commissioning campaigns of the instrument.

The beam provided by the new EuXFEL facility in Hamburg will feature exceptional properties in terms of power, coherence and pulse length. The EuXFEL will operate in a quasi-burst mode, the pulse being organized in trains with a repetition rate of 10 Hz and a structure made of pulses generated at a frequency up to 4.5 MHz.

In the hard X-ray range, each pulse will be loaded with an energy rate up to 10 kW. Hence, huge thermal constrains are placed on the optics. For instance, the optical state could be modified between the first and last pulses of a train due the energy deposited in the optical system. The need for a wavefront sensor capable of analyzing the pulse state dynamically is therefore a high stake for the full exploitation of the FEL beam.

SPECKLE-BASED WAVEFRONT SENSOR PRINCIPLE

The sensor developed in the frame of the EUCALL project employs the speckle tracking principle introduced a few years ago at synchrotrons for absolute wavefront metrology. The term 'absolute metrology' refers to a metrology that accounts for all the distortions occurring on the optical beamline components, eventually mapping the global state of the wavefront beam with a metric reproducible in time and space.

Figure 1. Sketch of the speckle based wavefront sensor. Two imaging systems are looking at the X-ray beam that is modulated with an intensity pattern thanks to a scattering object with small random features. Thin scintillators and low absorbing or holed visible mirrors permit to reduce the absorption of each imaging system.

The sensor principle is sketched in Figure 1. The wavefront is modulated in intensity by a scattering object that creates mutual interference between the scattered photons and the ones which did not interact with the object. This interference creates a random pattern, called speckle that, in the near field regime, has the particularity of having its shape transformation upon propagation to be solely ruled by the wavefront distortion. Next, two semi-transparent imaging detectors record pair of images of this object at two different propagation distances. Then, the remaining part of the beam, i.e not absorbed within the process, propagates further downstream to a sample or a second experiment.

L

The X-ray speckle tracking [START_REF] Berujon | Two-Dimensional X-Ray Beam Phase Sensing[END_REF] principle permits to recover the wavefront gradient through the calculation of the local deflection angle of the speckle modulating pattern P . By noting the distance between the two scintillator screens L, the local wavefront derivative W is recovered using the equation: L v W P where is the local displacement of the speckle pattern, within a scalar factor. The principle of the X-ray speckle tracking technique consists of taking a subset of the image collected on the first detector and finding its counterpart in the image recorded on the second detector by using a cross-correlation algorithm to infer v and hence W . The resolution of the processing method was shown to approach a few pixels in size and the angular sensitivity to reach a fraction of pixel divided by the distance L.

IMPLEMENTATION AND RESULTS

A prototype is currently being developed at the beamline BM05 of the ESRF and was tested at both the BM05 and ID06 beamlines. The sensor will be later deployed at the FXE beamline of the EuXFEL during the instrument commissioning stage. The data presented here was obtained at the ID06 beamline where, for early development purposes, only the first imaging system was semi-transparent to X-rays. For the tests performed at ID06 the detectors consisted of the combination of a PCO 2000 and a FReLoN camera whilst the setup used at BM05 is presently accommodating two PCO Edge cameras as the one shown in Figure 2. These cameras can achieve a frequency rate of 50Hz with 2k x 2k 16-bit images and low electronic noise. However, given that the EuXFEL X-ray pulse rate is able to reach 4.5 MHz, commercially available ultrafast imaging camera are being considered for the sensor deployment there. Such fast cameras are expected to enable the discrimination of each XFEL pulse, providing a better depiction of the thermal and optical variations across the train pulses. Figure 2 shows a drawing of the semi-transparent optics used for the first detector. The mechanical assembly was designed and produced by the company Optique Peter. The X-ray beam passes through a thin scintillator whose light produced by luminescence is reflected at ninety degrees with respect to the beam direction by a thin vitreous carbon mirror toward a X-rays magnifying optics and the CCD camera. A choice of two fast scintillators has been identified: a thin YAG:Ce (70 ns decay time) crystal and an in-house developed LYSO:Ce (40 ns decay time) scintillator able to operate efficiently at high X-ray energy. The thinning of these scintillators is of paramount importance to reduce the amount of X-rays absorbed within the scintillator. It helps prevent any damage that could be caused by the interaction of the scintillator with the intense X-ray beam contained in the X-ray pulse train of the EuXFEL source.

In this implementation, the scattering object was a 120 m thick membrane made of cellulose acetate. At the working energy, the absorption of this object was only of a couple of percent. However, such material cannot sustain the high flux of the EuXFEL over several pulses. For the device implementation with high flux density X-ray sources, solutions are envisaged based either on a diamond modulator or on a liquid jet injector for renewing the modulating material. Figure 3. Calculated distortion for the first imaging system: the combined effect of the scintillator mount and of the semitransparent mirror generates a distortion that is not fully radial as pointed out by the arrows.

In the ID06 setup, the first detector was located at a distance of 55 m from the source and the second one at a distance L = 450 mm further downstream from the first detector. As mentioned earlier, the second imaging camera used at the ESRF ID06 beamline was of a more traditional conception where all the photons are absorbed within the imaging system. The detector distortions were characterized and compensated using the method described in Ref. [START_REF] Berujon | X-ray pulse wavefront metrology using speckle tracking[END_REF] . The calculated distortion for the first detector is shown in Figure 3. One can notice that the recovered distortion is not purely radial and hence does not follow the often-used Brown-Conrady model for optical distortion [START_REF] Brown | Decentering Distortion of Lenses[END_REF] . This is mainly due to the X-ray transparent mirror that creates optical aberrations upon reflection. In this context, the zonal model approach described in Ref. [START_REF] Berujon | X-ray pulse wavefront metrology using speckle tracking[END_REF] is better suited to correct the distortions in the acquired images. The calculated effective pixel sizes were of 0.62 m for the first detector and of 0.74 m for the second one.

The tests conducted at these beamlines aimed at characterizing the ability of the sensor to recover the wavefront curvatures and the source distance in order to infer the optical aberrations of the optics. The photons of the beamline where selected around E = 17 keV thanks to a double-crystal Si(111) monochromator. Figure 4 shows an example of two images recorded on the detector during the same pulse generated using a shutter. The calculated wavefront gradients are shown in (c) and the wavefront reconstruction obtained by 2D integration is shown in (d). One phenomenon observable in the zoomed insets of (b) is that the speckle grains have a much larger shape in the horizontal direction than in the vertical one. This phenomenon, even more pronounced on the image coming from the second detector, arises due to the lower transverse coherence of the high-beta undulator source in the horizontal direction with respect to the vertical one. It is responsible for the blurring of the speckle upon propagation over a distance larger than the deep Fresnel region [START_REF] Cerbino | Correlations of light in the deep Fresnel region: An extended Van Cittert and Zernike theorem[END_REF] The X-ray beam state was changed by using different lens combinations offered by a beamline focusing apparatus based on motorized sets of compound refractive lenses, also called transfocator [START_REF] Vaughan | X-ray transfocators: focusing devices based on compound refractive lenses[END_REF] . This transfocator, located at a distance of 38.6m from the source, possesses different lens assemblies that can be aligned into the beam either individually or by stack. The focusing power of a lens stack, defined by:

i i i R N f 2 1
where is the refraction index of the compound material, Ni is the number of lenses and Ri their radius of curvature, was then compared to the measured one. The theoretical and measured focusing powers are given in Table 1.

Table 1. Theoretical and recovered focusing power for the different transfocator configurations.

In Table 1, one can see that the calculated focusing power increases following closely the theoretical predictions both for the vertical and horizontal directions. Some of the discrepancies may be attributed to the lenses aberrations. The offset between the vertical and horizontal directions relates to the source asymmetry. Such an experiment validates the approach for the characterization of pulses with various wavefront curvatures to define the origin of the X-ray source in the FEL undulator. The current prototype accessing the data acquisition capabilities allows one to reach a frequency rate of 50 Hz whilst computing developments are now aiming at increasing the processing speed to this frequency and thus achieving real time feedback on the pulse wavefront state.

CONCLUSION

We presented here efforts deployed at the ESRF for the development and tuning of a wavefront sensor prototype able to operate in the hard X-ray range with ultra-intense pulses. The device will be used as a tool to monitor and optimize the EuXFEL beam in a near future commissioning stage. The sensor will permit to gain unique insight on the optics behavior and allow real time feedback on the X-ray pulse state thanks to GPU optimized processing codes. Such a device will be also instrumental in the monitoring and optimization of future new quasi-CW FEL sources such as LCLS-II 14 . Additionally, the project aims at developing an open-source software package that will be released by the end of 2018 for hard X-ray wavefront sensing based on speckle modulation.

Figure 2 .

 2 Figure 2. Mechanical assembly of the semi-transparent optics. When the the X-ray beam passes through the scintillator, luminescent light is reflected toward an imaging detector whilst the non-absorbed X-rays continue their propagation toward the second imaging detector.

  Figure 4 shows an example of two images recorded on the detector during the same pulse generated using a shutter. The calculated wavefront gradients are shown in (c) and the wavefront reconstruction obtained by 2D integration is shown in (d). One phenomenon observable in the zoomed insets of (b) is that the speckle grains have a much larger shape in the horizontal direction than in the vertical one. This phenomenon, even more pronounced on the image coming from the second detector, arises due to the lower transverse coherence of the high-beta undulator source in the horizontal direction with respect to the vertical one. It is responsible for the blurring of the speckle upon propagation over a distance larger than the deep Fresnel region[START_REF] Cerbino | Correlations of light in the deep Fresnel region: An extended Van Cittert and Zernike theorem[END_REF] .

Figure 4 .

 4 Figure 4. (a) Example of a pair of images collected with the two detectors (case 3 in the next table). (b) Inset of the images showing the light modulation with speckle. (c) Calculated wavefront gradients and (d) wavefront reconstruction.

ACKNOWLEDGMENTS

RC acknowledges support from the European Cluster of Advanced Laser Light Sources (EUCALL) project which has received funding from the European Union's Horizon 2020 research and innovation program. The authors wish to thank Carsten Detlefs for providing access and support at the ID06 beamline, Roberto Homs and Manuel Perez for the technical support and the ESRF for financial and personal support.