Abdelkrim Ali Zazou
email: abdelkrim.ali-zazou@ensma.fr

Emmanuel Grolleau
email: grolleau@ensma.fr

Emilie Chevrier
email: emilie.chevrier@srd-energies.fr

Pascal Richard
email: pascal.richard@univ-poitiers.fr

Jean-Paul Gaubert
email: jean.paul.gaubert@univ-poitiers.fr

Ladjel Bellatreche
email: bellatreche@ensma.fr

Abdelkrim Ali

Zazou Srd

Ensma Poitiers

Power distribution network reconfiguration based on min-cost flow problem

I. INTRODUCTION

This paper presents advances in a joint work between an academic research lab and SRD, the company in charge of the power network in the french department Vienne (431000 inhabitants). Nowadays, the insertion of renewable energy and the future of storage has more and more of an impact on the global energy flow. The aim of this paper is to present an optimization solution of the flow minimizing the loss, which can be applied on a large scale network in a reasonable time. We study the problem of loss reduction in a distribution network by reconfiguration of feeders. This problem has been addressed for a long time [START_REF] Baran | Network reconfiguration in distribution systems for loss reduction and load balancing[END_REF], and we can separate methods into three main categories: capacitor placement, distributed generation allocation and feeder reconfiguration [START_REF]Loss minimization techniques used in distribution network: bibliographical survey[END_REF]. The previous problem becomes harder to deal with when capacitor or renewable energy sources must be handled. Also capacitor placement can be efficient when investments are made to improve the network but not in day to day operations, and distributed generation utilization presents a risk because it is hard to predict due to weather uncertainty and cannot be controlled. Moreover large renewable energy sources are usually isolated in the network and the produced power is sent directly to the high voltage to medium voltage transformer so it cannot be used to deliver power directly to consumers. It is for this reason that reconfiguration of the network by modifying switch states is the most accurate way of trying to reduce loss without investing a lot and with less production uncertainty. The aim of network reconfiguration is to change network topology by modifying the switches state (open/close). Distribution networks are operated in radial configuration, so network reconfiguration transfers loads from one branch to another, and modifies the flow of power in the branch. The discrete nature of such an operation makes the optimization problem of integer type. Before explaining the way to optimize a network, note that electrical characteristics (voltage, current, phase and power loss) depend usually on a power flow. In the case where the network can be operated in a loop, meaning that a consumer can be connected to different sources, the solution of the non linear equations involved in the power flow has many solutions, one of them inducing a minimum power loss. However in radial configuration where a consumer can be connected to one source only, the power flow has a unique solution and a fixed amount of loss. To solve this second case there are two ways of solving the minimum loss problem: 1) Firstly solve the power flow and then determine which line to open in the network to get a radial configuration or 2) Enumerate all the possible radial configuration and evaluate each one of them to find the best one in term of loss. Radial configuration is commonly used for distribution networks, the optimization problem of loss reduction can be solved by different techniques presented in [START_REF]Loss minimization techniques used in distribution network: bibliographical survey[END_REF], such as specific heuristic procedures, meta-heuristics, hybrid techniques or exact optimization methods. Optimization methods are set for different purposes and due to the huge amount of possible solutions in a distribution network, approximations are made to efficiently solve the problem. This can be achieved at modeling level, or at resolution level. For example, in [START_REF] Schmidt | Fast reconfiguration of distribution systems considering loss minimization[END_REF] and [START_REF] Gomes | A new distribution system reconfiguration approach using optimum power flow and sensitivity analysis for loss reduction[END_REF] the authors use optimization to solve the non linear system of equations involved in the exact power flow with minimum loss, and develop a specific heuristic method to choose the switches to open or close. Therefore, they use approximation at the solving level, that can be efficient as long as a means to search effectively for the solution is known. In [START_REF] Khodr | Distribution systems reconfiguration based on opf using benders decomposition[END_REF] two exact optimization methods are used, one for each stage of the process: one solver for the power flow equations (slave problem), and one solver using the branch and bound method to determine the switch position (master problem). Optimization can be used to find the best solution among every possible radial configuration in one model. However, with the non linear nature of the power flow and knowing the difficulty of solving a large MINLP (Mixed Integer Non Linear Program), non-linear equations involved in the model can be simplified such as in [START_REF] Ramos | Optimal reconfiguration of distribution networks for power loss reduction[END_REF] [START_REF] Borghetti | A mixed-integer linear programming approach for the computation of the minimum-losses radial configuration of electrical distribution networks[END_REF]. Another option is to work on the integer constraints that define the radiality such as in [START_REF] Lavorato | Imposing radiality constraints in distribution system optimization problems[END_REF]. In the real-world context of distribution network, we usually do not have an exact view of the consumption and production of the nodes of the network and network reconfiguration is not really suited to real-time decision making. Therefore in general worst-case studies are made to define an operational network by this technique. In this paper, we choose to simplify power flow calculations by model simplification to reduce the optimization problem size and complexity. The purpose of this proposed model is to be used in a real network by non optimization and modeling experts and to be easy to plug on off-the-shelf solvers. The optimization problem defined to solve the network reconfiguration is simplified by a minimum cost flow problem (MCFP) with disjunctive constraints composed by the different operational constraints. This problem is NP-hard [START_REF] Pferschy | The maximum flow problem with disjunctive constraints[END_REF]. We compare this model to other techniques presented on a small academic test case found in [START_REF] Baran | Network reconfiguration in distribution systems for loss reduction and load balancing[END_REF], and we then apply our method to a large scale real system. In section II the model is described and simplifications are explained, in section III, the method used to evaluate the model is presented and in fourth section results are presented and commented.

II. OPTIMIZATION MODEL

A. Basic concepts of electricity

In the case where the three phase alternating current system is considered balanced and the current and voltage are sinusoidal we can define three sorts of power :

• Active power (real power): P = u × i × cos φ where u is the voltage, i the intensity, φ the phase between intensity and voltage and cos φ the Power factor

• Reactive power: Q = u × i × sin φ
• Complex power (apparent power): S = P + jQ where j is the imaginary unit

In our case, at each point of the network the exact value of φ is unknown but considered constant as is the active power consumption, so we will focus only on the active power. u is also considered constant along the feeders for loss calculation but an approximate voltage drop calculation is implemented and described in II-E and is only taken as an indicator. Furthermore the energy losses on the line to be minimized can be deduced with the active power alone.

B. calculation of energy loss

In this section, we compute the energy loss between two nodes i and j of the power network.

P loss (i, j) = R(i, j) × i(i, j) 2 i(i, j) = P (i,j) u×cos φ so P loss (i, j) = kp(i, j) × P (i, j) 2 (1) with kp(i, j) = R(i,j) u 2 ×(cos φ) 2 ) (2)
where R(i, j) is the resistance of the line connecting node i to j and P (i, j) the power flowing between i and j.

In this problem we want to optimize the energy transit into the network by minimizing power loss. Having seen how to calculate losses on a line, we show on Figure 1 how to compute the loss on a network. P (1),P (2),P (3) are known and kp(s2, 1), kp(1, 2), kp(2, 3), kp(s1, 2), kp(s3, 3) are deduced from material characteristics. However P (s1), P (s2) and P (s3) are unknown and depend on the flow between each node of the network. This flow depends on which consumption is connected to which source.

The aim of the optimization is to minimize the total loss of the network caused by the loss of each individual line.

P loss total = P loss (s2, 1) + P loss (1, 2) + P loss (s1, 2) + P loss (2, 3) + P loss (3, s3) This network can be modeled by a graph, in which source nodes are connected to consumption nodes by edges having a fixed cost, the kp(i, j) value (see Eq. 2). Each line is represented by two edges to represent the two possible directions of the electrical flow. Note that a consumption node may also be a renewable energy source and in this case its consumption has a negative value.

The lines between the power source and the first node are modeled by just one edge, considering that at this connection point the flow goes in only one direction. In reality it is possible to have a flow going up to the power source. This happen when distributed energy produce more energy than what is consumed in the network down to the power source. But here productions are modeled as negative consumption so

C. Electrical flow computation

An optimization problem is defined by an objective function and constraints. In sectionII-B the objective function is described and in the following sections the constraints are presented and explained. Graph theory says that the flow coming into a node is equal to the flow going out, this is a rule applicable to active power flow (Kirschofs law) [START_REF] Gondran | Graphes et algorithmes[END_REF]. Also the graph has to be conservative, so the graph of Fig. 2 is defined as follows:

Equations 3-5 give the quantities flowing through the graph, and 6 the conservative flow but we need another constraint to stick to the reality of the electrical network operability.

D. Operational constraint:

A consumption node cannot be powered by two different sources; this constraint is called radiality constraint, and is a disjunctive constraint. To model this a new binary variable is defined b(i, j) representing whether an edge connects (i, j) or not. That is the set of b values that gives a "network configuration" by defining where the network should be opened and closed.

Based on figure 2 we can define the following equations:

Node 1: b(s2, 1) + b(2, 1) = 1 (7) Node 2: b(1, 2) + b(s1, 2) + b(3, 2) = 1 (8) Node 3: b(s3, 3) + b(2, 3) = 1 (9)
Equations 7-9 define the fact that a node can be powered by only one source. Also another important rule has to be implemented, concerning the fact that two opposite edges cannot be active at the same time, which means that the power can only go in one direction through a line.

In the example figure 2 this applies to only two pairs of edges:

b(1, 2) + b(2, 1) ≤ 1 (10) b(2, 3) + b(3, 2) ≤ 1 (11)
In the real test case, equations 10 and 11 are slightly modified to take into account the possibility of opening a line. The condition for allowing a line to be opened is that a switch belongs to the edge considered. If this condition is respected, the constraints are written as in 10 and 11. Whereas in the other case the inequality becomes an equality meaning that at least one of the two edges have to be connected. Note that b(s1, 2), b(s2, 1) and b(s3, 3) are forced to one.

E. Voltage drop constraint

Voltage drop on a line in a power network must stay between +/-5% of the nominal value. The calculation is defined using the short line pi model Figure 3. Fig. 3. short line pi model U1 is the voltage at the beginning of the line, U2 at the end, and U3 represents the voltage drop on the line. Note that a is the complex value a and a * is the complex conjugate of a.

U 2 = U 1 -U 3 (12) S2 = U 2 × I2 * (13)
I2 = P 2 -Q2 * j ×U 2 * and U 3 = (R + X * j) * I2 (14) So U 3 = (R * P 2 + X * Q2) + (X * P 2 -R * Q2)j U 2 (15)
To know the value of the voltage drop U3, the absolute value of the complex U 3 has to be calculated. We are interested in the relative voltage drop, because the distribution network voltage drop limitation is defined in terms of percentage of the nominal value. So we divide the obtained value by U 2. Following these equations, U 2, P 2, R and X are known.

|U 3| U 2 = 1 U 2 × ( RP 2 + XQ2 U 2 ) 2 + ( XP 2 -RQ2 U 2 ) 2 ) with Q = P * tan φ is known and constant |U 3| U 2 = ( ((R 2 + X 2 ) × (1 + (tan φ) 2 )) U 2 2 ) × P 2 (16)
From this is defined the constant coefficient

Kc = (R 2 + X 2 ) × (1 + (tan φ) 2 ) U 2 2 (17)
which is proportional to the flow obtained by Eq. 3-5. The particularity of this voltage value is that it is accumulated from the source to the last node of the branch. So, to compute such calculation a third variable ch(i) is defined, which represents the voltage drop accumulated at node i. We also set ch(source) = 0. With the constraints described in above sections and knowing that :

P loss (i, j) = kp(i, j) × P (i, j) 2 (21)
the optimization model defined in section II-F can be defined with the variables x(i, j) = P (i, j). Two different equations for energy loss calculation are computed to simplify the computation, one taking into account the square of x(i, j) and the other not. By taking into account the square of the power in the objective function, the MIQCP problem becomes a MINLP problem, and due to the non-convexity it is harder to solve. We assume that those simplifications do not affect the result of the optimization because during the process, P loss total will be compared based on the same calculation. However, this could affect the quality of resulting optimization due to computational complexity.

F. Optimization problem definition 1) Glossary: x(i, j) : Real value representing the power flow from vertex i to j ch(i) : Real value representing relative voltage drop at node I b(i, j) : Binary value representing line state (1=edges (i,j) active, 0= edge (i,j) not active) kp(i, j) : Constant loss coefficient from i to j kc(i, j) : Constant voltage drop coefficient from i to j up(i, j) : Upper bound of x(i,j) up ch (i) : Upper bound of ch(i) nb source : Number sources src(p) : Maximum power that a source p can deliver a) objective function:

Z = kp(i, j) * x(i, j) * b(i, j) ∀(i, j) (22) b) Constraint: n i=0 x(i, j) × b(i, j) - n k=0 x(j, k) × b(j, k) = P (j) (23)
∀j with ∀k consecutive to j and ∀i incident to j b(i, j) ≤ 1 ∀j incident to i (24)

ch(i) = (i, j) * (x(i, j) × kc(i, j)) + ch(j)) (25) ∀ j incident to i b(i, j) + b(j, i) ≤ 1 ∀(i, j), ∀(j, i) (26) x(i, j) ≤ up(i, j) ∀(i, j) (27) x(i, j) ≥ -up(i, j) ∀(i, j) (28) ch(i) ≤ up ch (i) ∀i (29) ch(i) ≥ -up ch (i)∀i (30) b(p, i) = nb source ∀(p, i) i consecutive to p (31)
x(i, p) ≤ src(p) ∀(i, p) i incident to source p (32) (33)

III. PERFORMANCE ANALYSIS METHOD

To check the performance of the proposed model, the Matlab tool MATPOWER [START_REF] Zimmerman | Matpower: Steady-state operations, planning, and analysis tools for power systems research and education[END_REF] is used. It is a program developed to calculate power flow of a given network, returning several pieces of information such as voltage at each node and loss in each line. The proposed optimization model does not give the exact loss quantity due to approximations and is used only to find a realistic network configuration that satisfies constraints presented in section II. In the real-world context, this model is included in a larger application that only handles electrical network data to establish the optimization model, and uses the binary variables assignment to give a network configuration that can be studied on the company state estimator. In the real network test case, the exact value of cos φ is not known. Moreover we have access to the apparent power for small and medium consumers, and to the real power for large consumers. Note that small consumers are residential houses, medium consumers are small business and farmers, and large consumers are mainly industrial factories. However, as input data MATPOWER needs the consumption of each node and the characteristic resistance and reactance of each line. Therefore to get the consumption of each node, a cos φ of 0.95 is used for small consumers and 0.9 is used for medium and large consumers. These values are used to estimate the active and reactive power of each node. Whereas for the Baran and Wu [START_REF] Baran | Network reconfiguration in distribution systems for loss reduction and load balancing[END_REF] test case, exact network characteristics are already given. Also each configuration obtained by the optimization process is compared to an initial configuration given by opening s33,34,35,36 and s37 (see figure 5). The loss reduction corresponds to the difference between this initial configuration (loss=202.7kW) and the proposed one. Our model is mostly developed to be used in planning so computation time is not required to be instantaneous. Nevertheless, it has to be reasonable for practical use (less than 20min), or fast enough to compute a reconfiguration after a blackout.

IV. RESULTS

The proposed model has been tested over Baran and Wu test case [START_REF] Baran | Network reconfiguration in distribution systems for loss reduction and load balancing[END_REF] composed of 32 nodes, and a real network from SRD composed of 2162 nodes. In the first case no specific limitations are included in the optimization so that every configuration is possible. Whereas in the real case, limitations on the position of the line to be opened are taken into account to simulate the real possibilities of reconfiguration.

The first case study aims at comparing the performance of the result proposed by our simplified model, an optimal configuration, and other proposed methods. The real case study is used to prove the scalability of the model over large networks and studies the trade-off between precision and scalability or rapidity. For the large scale test case voltage drop control is tested. Also taking into account the square of the power is tested for both case study and it corresponds to the annotation "(simple)" or "(square)" in Table I.

The optimization is modeled through GAMS and is computed on NEOS server [START_REF] Czyzyk | The neos server[END_REF] [START_REF] Dolan | NEOS server 4.0 administrative guide[END_REF].

A. Baran and Wu test case

Different solvers have been used to look for an optimal configuration. Solutions are given in two columns in Table II: in the first column, we considered a linear loss, while in the second column we consider the loss calculated considering the square of the power. In the case where the loss is considered linear, the optimal solution proposed on the model does not correspond to the optimal solution for the general loss reduction problem. Whereas in the other case, the optimal solution of the model and the general problem are the same. In case of square simplification, only two solvers over eight could not find the optimal solution, Alphaecp and Dicopt. SBB found the optimal solution but was not able to declare it optimal. Whereas in case where the square of the power is computed, three solvers could not find the optimal solution Scip, Alphaecp and Bonmin. Also this time Dicopt, SBB and Baron could not declare the solution optimal even if they found it. Baron found the solution in 19.11s but stopped on the maximum time allowed. An option was used for Dicopt to stop on iteration limit (option: "stop=0" and "iterlim=1000000)). Table I summarizes those results and shows that taking into account the square of the power to optimize energy loss gives better solutions. Also the solver chosen can influence the result, both in quality (energy loss) and speed. In table II the configurations proposed are compared in terms of line status. We can see that the proposed model reached the optimum configuration. It should be noted that With dicopt in the first case without square on the power, the solution returned is different from the optimal one because of one switch (s27). The proposed model has been compared to other methods of solving the loss reduction problem based on previous work [START_REF] Khodr | Distribution systems reconfiguration based on opf using benders decomposition[END_REF]. The author also notes that there is some difference in the value of power loss given by the literature, but to compute the presented value the list of open/closed switches have been used. Table III shows that our proposed method method loss Quantity (kW) computation time (s) optimum 139.6 647 khodr [START_REF] Khodr | Distribution systems reconfiguration based on opf using benders decomposition[END_REF] 139.6 0.11 Gomes [START_REF] Khodr | Distribution systems reconfiguration based on opf using benders decomposition[END_REF] 139.6 1.66 Goswami [START_REF] Khodr | Distribution systems reconfiguration based on opf using benders decomposition[END_REF] 139.6 0.87 McDermott [START_REF] Khodr | Distribution systems reconfiguration based on opf using benders decomposition[END_REF] 139.6 1.99 Ahmadi [START_REF] Ahmadi | Distribution system optimization based on a linear power-flow formulation[END_REF] 139.6 3.2 Proposed 139.6 1.35 Gomes2 [START_REF] Khodr | Distribution systems reconfiguration based on opf using benders decomposition[END_REF] 140.2 0.96 Shirohammadi [START_REF] Khodr | Distribution systems reconfiguration based on opf using benders decomposition[END_REF] 140.2 0.14 Schmidt [START_REF] Schmidt | Fast reconfiguration of distribution systems considering loss minimization[END_REF] 142.4 0.01 Baran [START_REF] Baran | Network reconfiguration in distribution systems for loss reduction and load balancing[END_REF] 146.8 -

TABLE III

COMPARAISON BETWEEN DIFFERENT METHODE has the same performance as the best ones proposed in the literature. Nevertheless, our main goal is scalability for realworld networks.

B. Real test case

The Baran Wu test case shows that taking into account the square has a positive impact on loss reduction. However because of computation complexity of a non convex MINLP problem, the time needed to find a solution increased. In the case of a real network with up to 2k variables, the only solver that finds a solution is Baron.

In this part the same tools are used to evaluate their behavior. Nevertheless, since we do not know any optimal solution, the solution is compared to the actual configuration used to operate the network, which is obtained by a manual worst case study. This gives an idea of the energy that could be saved by reducing the maximum voltage drop of each configuration. (loss=8.65MW, voltage drop=45.5%). In Table IV, we can see that the model is able to give a solution that reduces the total power loss of the network in any case. We also see that the voltage drop can be controlled even if it the change is small between the two proposed configurations. In reality, there is a minimum voltage drop under which it is impossible to converge, so trying to control it too much will result in non-convergence. Maybe if we turn off the constraint on the switch position we could control the voltage drop better by allowing more configuration to be evaluated. But we also see that the complexity introduced by taking into account the square of the real power in the objective function significantly increases the solving time due to non linearity. We also see that those configurations are not better than the one given by the simplified model. These results show that approximation on the model is more efficient than approximation on the solver. It has to be noted that computation time is reduced in comparison to other methods. In [START_REF] Lavorato | Imposing radiality constraints in distribution system optimization problems[END_REF] the process takes 14256s on a 417 node network, whereas in [START_REF] Ahmadi | Distribution system optimization based on a linear power-flow formulation[END_REF] it takes 1134s for a 880 node system and [START_REF] Taylor | Convex models of distribution system reconfiguration[END_REF] relaxes the problem of 880 nodes to have a solution in 874s. So those three examples show that our approach is efficient for a large scale problem.

V. CONCLUSION

These results tend to prove the possibility of reducing loss in a real distribution network, with network flow problem modeling and show that simplification on model level is better than on solving level. However we can see that MINLP and MIQCP solvers struggle with large scale problems, and that makes the optimization of large distribution network difficult. The proposed method gives good results in comparison to other methods presented in section IV.

Fig. 1 .

 1 Fig. 1. Simplified electrical network

Fig. 2 .

 2 Fig. 2. Simplified network graph

Node 1 :

 1 P (s2, 1) + P (2, 1) = P (1, 2) + P 1 P (s2, 1) + P (2, 1) -P (1, 2) = P 1 (3) Node 2: P (1, 2) + P (s1, 2) + P (3, 2) = P (2, 3) + P (2, 1) + P 2 P (1, 2) + P (s1, 2) + P (3, 2) -P (2, 3) -P (2, 1) = P 2 (4) Node 3: P (s3, 3) + P (2, 3) = P (3, 2) + P 3 P (s3, 3) + P (2, 3) -P (3, 2) = P 3 (5) Conservation : P (s1, 2) + P (s2, 1) + P (s3, 3) = P 1 + P 2 + P 3

Fig. 4 .

 4 Fig. 4. simplified voltage drop calculation

Fig. 5 .

 5 Fig. 5. Baran and Wu network

TABLE I SOLVERS

 I

RESULTS COMPARISON

TABLE IV RESULTS

 IV

OF REAL CASE


Zakaria Sahraoui
email: z.sahraoui@gmail.com

Abdenour Labed
email: abd.labed@gmail.com

Mohamed Ahmed-Nacer

Emmanuel Grolleau
email: grolleau@ensma.fr

Subtask scheduling & Predictive-Delay Control Comparison and hybridization

Keywords: Input-output latency, subtask scheduling, real-time control, Predictive-Delay, quality of control, Feedbackscheduling, TrueTime

published or not. The documents may come   L'archive ouverte pluridisciplinaire

INTRODUCTION

In real-time multi-task control, the choice of performance criteria is guided by multiple design constraints. In one hand, a part of these constraints is related to control design, whereas the others rely on the real-time scheduling theory. But the question is what can be the dependence between the tow sides of these constraints ? For instance, it is well-known that in control theory, selection of appropriate task periods is one of the most prevailing constraints, while in scheduling theory, the processor overload is a fundamental constraint. The choice of a processor in an embedded system is initially based on these tow parameters, which means that there is relationship between the period and the processor load. Furthermore, as schedulability does not necessarily mean control with high performance, and reducing the task periods is not all the time gainful. More explicitly, since control tasks are of recurrent nature, the first step in control design is to identify the closed loop frequency of the controlled process which provides a first idea about the control task periods. As a matter of fact, with coarse values of the execution times in hand, an estimate of the processor load and at the same time its capacity are generally deduced from the control task periods. In this context, some recent theories and research results may be of valuable help. For example in [START_REF] Cervin | Integrated Control and Real-Time Scheduling[END_REF] [START_REF] Sahraoui | Antinomy between schedulability and quality of control using a feedback scheduler[END_REF], it has been shown that a higher processor bound test does not necessarily lead to a better quality of control. It has also been proven that input-output latency, is a significant artifact which may deteriorate the control if it is not taken into account. Nevertheless, some mechanisms and simulation setting need to be characterized. Effectively, in this context, we aim through the present work at testing the quality of the control for second and third order processes under different conditions. The main points of the analysis carried out in [START_REF] Sahraoui | Antinomy between schedulability and quality of control using a feedback scheduler[END_REF] are resumed to focus the variation of some non dealt parameters. The execution time confidence interval is widened to ensure convergent and divergent behavior of the quality of the control (QC) cost in the same simulation set. Executiontime with a wider confidence interval may also means a mode change. This also can reveal overload situation required to highlight some scheduling artefacts. These characterizations give more in deep sight and help the reader discern between the extent of research works. Finally, after this deepening in analysis and a comparison between the subtask model studied in [START_REF] Cervin | Integrated Control and Real-Time Scheduling[END_REF] and the Predictive-Delay Control (P-DC) proposed in [START_REF] Sahraoui | Predictive-delay control based on real-time feedback scheduling[END_REF], we try to take benefit from the former to reinforce the result of the P-DC improvement.

Several Works have studied the scheduling and control codesign problem. They generally investigate methods either able to enhance the control performance or to recover the process stability. The realtime community started this subject since 20 years ago. The seminal work presented in [START_REF] Seto | On task schedulability in real-time control systems[END_REF], solves an optimization problem based on a non linear criterion, then in [START_REF] Ryu | Streamlining real-time controller design : From performance specifications to end-to-end timing constraints[END_REF] other criteria are proposed for the optimization of control performance as a function of the period and the computing latency. Later, there has been suggestions to resolve other optimization problems in-line to fit the scheduling constraints as schedulability or task periods selection, like in [START_REF] Robert | Sampling period dependent RST controller used in control/scheduling co-design[END_REF] by RST & H∞ algorithms together or by the LPV method [START_REF] Sename | A LPV approach to control and real-time scheduling codesign : application to a robot-arm control[END_REF][START_REF] Robert | An H∞ LPV design for sampling varying controllers experimentation with a T-inverted pendulum[END_REF] . These solutions are referred to as the indirect feedback scheduling (FBS). In return, Methods that suggest priority assignment, like in [START_REF] Xu | Response time driven design of control systems[END_REF] with the LQG method or in [START_REF] Bini | Delay-aware period assignment in control systems[END_REF][START_REF] Yepez | The large error first (LEF) scheduling policy for real-time control systems[END_REF][START_REF] Xia | Control oriented direct feedback scheduling[END_REF] are called direct FBS. In the class of the direct FBS we also find the solution of [START_REF] Henriksson | On dynamic real-time scheduling of model predictive controllers[END_REF][START_REF] Henriksson | Flexible Implementation of Model Predictive Control Using Sub-optimal Solutions[END_REF] based on the Predictive Control Model. Particularly, authors in [START_REF] Cervin | Feedback scheduling of control tasks[END_REF][START_REF] Cervin | Integrated Control and Real-Time Scheduling[END_REF] have studied the impact of the scheduling jitters on the QC using the jitterbug tool [START_REF] Cervin | Integrated Control and Real-Time Scheduling[END_REF] and then those of the latencies on the QC using the TrueTime tool [START_REF] Cervin | How does control timing affect performance ? Analysis and simulation of timing using Jitterbug and TrueTime[END_REF]. The authors, towards the cited solutions, proposed an indirect FBS, to rescale tasks periods, based on a processor load estimator. Then, this study has been taken back in-details in [START_REF] Sahraoui | Antinomy between schedulability and quality of control using a feedback scheduler[END_REF] [START_REF] Sahraoui | Predictive-delay control based on real-time feedback scheduling[END_REF], where it is accounted for other scheduling artefacts and constraints. For more details about feedback scheduling the reader can refer to [START_REF] Sahraoui | Antinomy between schedulability and quality of control using a feedback scheduler[END_REF]. As regards the subtask solution, it is considered by [START_REF] Gerber | Semantics-based compiler transformations for enhanced schedulability[END_REF][START_REF] Gerber | Slicing real-time programs for enhanced schedulability[END_REF] in order to enhance the schedulability under fixed priority (FP) scheduling or by [START_REF] Crespo | Reducing delays in rt control: the control action interval[END_REF][START_REF] Albertos | Real-time control of non-uniformly sampled systems[END_REF][START_REF] Balbastre | Control tasks delay reduction under static and dynamic scheduling policies[END_REF] to minimize the input/output jitter. Finally, in [START_REF] Cervin | Integrated Control and Real-Time Scheduling[END_REF] the subtask scheduling is used to improve the QC.

Task model and experimental settings

Let us introduce the classical task model with the associated notation: we call tasks system the set of tasks S = {τ 1 ,...τ N } involved in a given real-time system and denote the number of tasks by N. In addition, two jobs of a task are considered perfectly interchangeable in that they perform identical treatment. A given task τ i is characterized by its period h i , its observed execution-time C i (k) at time index k, its worst execution time C i and the date of its first arrival (or offset) O i . The tasks systems studied in this work are of implicit-deadlines (i.e., tasks must terminate before their next release), where ∀ τ i : D i = h i . Each periodic task generates a potentially infinite set of jobs τ i (k), where k refers to the k th sampling period : a job will be submitted every period h i . The list below describes remaining tasks parameters:

h nom i Nominal task period Ls i (k) Sampling latency Lresp i (k) Observed response time of τ i (k) Lio i (k)
Observed input/output latency

In the sequel, we specify the task model and the used FBS as well as the servo motor and the pendulum processes to be controlled with a PID controller and finally the cost criterion of the QC.

Subtask Model

Instead of the task model used in [START_REF] Sahraoui | Predictive-delay control based on real-time feedback scheduling[END_REF], we use the subtask model used in [START_REF] Cervin | Integrated Control and Real-Time Scheduling[END_REF] and implemented under the TrueTime tool. In Figure 1 the subtask model is presented, where the execution time of the first task segment of the calculateoutput part C co as a rate of C i (k) (in %). This means that the delay from the jobs start hook to the controloutput time (end of seg 1) will be at least C co C i (k). However, preemption from higher priority tasks may cause the delay to be longer, where Lio is the Input-Output latency representing this segment latency.

The second segment returns C us (%) of C i (k) , which is reserved to update the PID state variables. For detailed descriptions of these functions implementation see the TrueTime reference manual [START_REF] Cervin | How does control timing affect performance ? Analysis and simulation of timing using Jitterbug and TrueTime[END_REF].

Physical Processes

The first case study application presented in Figure 2 concerns three second order processes. It consists of three similar servo-motors, each one described by the transfer function

G(s) = 1000 s(s + 1)
.

(1)

While the second case study consists of three considered as reference benchmark in control design problems. For our simulation, the pendulum starts from the center which corresponds to an angle of 0 rad. It will be constrained to an impulsion of 0.0873 rad (about 5 degrees), applied in force on cart two seconds after the beginning of the simulation.

Feedback Scheduling

The FBS is used on-line, generally to supersede the off-line scheduling analysis. Moreover, the FBS can be used to reduce the overload interval or to keep it as short as possible. Job durations of the three controller tasks τ 1 , τ 2 and τ 3 are generated using a Weibull distribution as in [START_REF] Sahraoui | Predictive-delay control based on real-time feedback scheduling[END_REF]. This distribution is defined by three parameters : the localization parameter l which fixes the best case execution-time, the shape factor λ and the scale factor µ. Variation in task executiontimes during the simulation is accompanied by task periods rescaling, in order to have schedulable tasks set according to the RM bound.

At the end of each job τ i (k), the execution time Ĉi (k) is smoothed by a low pass filter. The FBS relies on this value, to calculate an estimate CPU utilization factor Û(t).

Tasks systems

The tasks systems used in the present work are given in Tables 1 and2. Durations are given in ms time unit.

The shape factor µ is chosen high enough to ensure The system defined in Table 2 is simulated with the same range of processor utilization U i used in the three servo-motors example, where periods and execution times are both multiplied by a factor of 1.6. It is worth noting that the task sampling period never exceeds the divergent threshold of 27 ms for the servomotor and 60 ms for the inverted pendulum. These thresholds are related to the PID setting described in the next subsection.

h nom i C i l µ λ τ 1
9.6 7.5 5 0.0014 3 τ 2 20.8 7.5 5 0.0014 3 τ 3 22.4 7.5 5 0.0014 3

PID controller

The PID controller defined by equations (2-7) is used.

This controller is developed in [START_REF] Åström | PID controllers : Theory, design, and tuning -2nd ed[END_REF]. Given fact that we rescale periods by FBS to ensure schedulability, a d and b d parameters are recomputed according to formulas ( 5) and ( 6). Thus, derivative term is computed using backward differences and a low pass filter (equation ( 4)) is used, with no noise involved in simulations. 4)

P(k) = K(β * r(k) -y(t k )), (2)
I(k) = I(k -1) + K * h T i (r(k) -y(t k )), (3)
D(k) = a d * D(k -1) + b d * (y(t k-1 ) -y(t k )),(
a d = T d N * h + T d , (5)
b d = N * K * T d N * h + T d , (6)
u(k) = P(k) + I(k) + D(k). (7)
PID parameters (K, T i , T d , N) are tuned in a way to obtain a system closed-loop bandwidth of ω c = 20 rd s and a relative damping ξ = 0.707. This excludes the fact that the controller design and discretization may be a source of instability for the range of the sampling periods h i . For such convergence the cost (8) has been specified to respect a threshold of 0.36 as an outset for divergent costs.

J yr i = t sim 0 r i -y i dt . (8)
3.6 Impact of the input-output latency on QC For the tasks system presented in Table1, the QC may diverge because of high input-output latency of lower priority tasks, due to preemption from tasks of higher priority level. Figure 4 confirms this rule.

Subtask scheduling

The idea of the subtask scheduling is to use the subtask model developed in section 3.1 with a fixed pri-ority assignment scheduling protocol, where we assign the highest priority to the output control segment (time critical part) and the lowest priority to the update state segment (must respect the period as deadline). It is obvious that the improvement will concern τ 3 , the task which has the lowest priority within the RM model. Nevertheless, for overload situation, it can happen that τ 3 is blocked most of the time. Scheduling of this case is shown in figure 5. The output measure y for each task of the tasks system defined in Table1 is shown in Figure 6. Undesirable breaks in the diagram testify the overload situation under subtask scheduling method. In this marginal case, tasks τ 2 and τ 3 states are concerned within the interval times [2. 5, 3.5] and [2.5 3.8], respectively. Figure 6 shows the divergence of tasks with lower priority τ 3 and then τ 2 in time as a consequence to the overload situation.

Schedulability

It is noted in [START_REF] Cervin | Integrated Control and Real-Time Scheduling[END_REF] that the ideal case of subtask scheduling under FP scheduling is when all Calculate-Output tasks segments have higher priorities than all Update-State segments. Unfortunately, such a priority assignment may render the task set unschedulable. In cases where this approach does not work, an iterative algorithm is used. Given a schedulable original task set, the iterative algorithm attempts to minimize the deadlines of the Calculate Output segments while maintaining schedulability. In our case, the used FBS does not care about job overruns and the basic FP implementation technique of [START_REF] Cervin | Integrated Control and Real-Time Scheduling[END_REF] is used. Since the TrueTime tool supports dynamic changes of priorities, we simply insert the TrueTime instruction SetPriority in the code when entering a new subtask, see Listing 1. Note that the priority changes may introduce additional context switches, which may degrade the performance in a It has been established in [START_REF] Cervin | Integrated Control and Real-Time Scheduling[END_REF] that the input output latency Lio is reduced to 42 % and the used cost (an LQG function based on the control and the output signals), is reduced up to 26 %. Nevertheless, it is also noted that even if the latency is fixed and known, delay compensation can only recover part of the performance loss. This fact is illustrated by an example where the cost for control of an integrator is

J ≈ 0.79h + L.
(For details, see [START_REF] Cervin | Integrated Control and Real-Time Scheduling[END_REF]).

Predictive-Delay Control

To improve the QC, the P-DC method brings up a predicted response time latency Lresp i of the concerned task τ i to calculate the control signal u i . This artifice is simple and helps bypassing several practical problems like schedulability, convergence and computation time from which suffer most of proposed solutions. The method relies on an estimate Lresp i , the current and the previous measure to extrapolate the forthcoming measure y i required in the PID control calculus. Without the P-DC, the measure to be used in the PID will be obsolete. With the observed C i (k) Figure 7: Predictive measures based on Lio [START_REF] Sahraoui | Predictive-delay control based on real-time feedback scheduling[END_REF].

within the overloaded case of the subtask simulation of section 4 we obtain the P-DC result presented in figures 8 and 9. Table 3 sums up the comparison and the hybridization solution proposed to enhance the QC of tasks τ 2 and τ 3 . Solutions are ranked in percentage order of expected performances of 20000 simulations as carried out in the graphical simulation. It can be noticed that subtask scheduling combined with P-DC leads to a solution that outperforms those obtained using P-DC or the subtask scheduling solely whatever the task is. When the hybrid solution is not involved in the comparison tests, for mild to moderate deterioration as in the case of τ 2 or for obvious deterioration like in the case of τ 3 , using estimated Lresp (line 4,5) or its previous values (line 2 and 3), the P-DC solution may be of great help. However, using subtask scheduling together with P-DC may lead to higher performance (see 10.d). Implementation of solutions based on the previous Lresp or Lio needs system calls to save the response time and eventually the sampling latency for each job termination. However, solutions using the responsetime calculated on the basis of upper bounds may show significant improvements. To verify these results, we simulate 20000 samples based on each technique and plot the Lio impact on the QC. Figure 11.a shows the improvement of the QC when the previous value of Lio is used as an estimate. The result in Figure 11.b is based on actual Lio and is similar to the one obtained when the previous Lio is used. The smoothed Lio in Figure 11.c, can be considered as the easiest prediction if we use a simple filter; the same as the one used to smooth the execution-time values. Similarly to Figure 11.d, the result gives the best cost where J yr 3 is all time under 0.12 < 0.15. In all the tested cases, it is noticed that J yr 3 never exceeds the value of 0.36 which is considered as a threshold in our specification (section 3.2). It is also important to recall that, due to the overload situation, it was very difficult to accomplish the 20000 simulations samples for subtask solution. For the case of the inverted pendulum, which is considered as a benchmark with a more sensitive cost, where Jyr < 0.09 for convergent control case. Figures 12.a and 12.b show the impact of the inputoutput latency on the QC for 20000 simulation samples of 5 s. The Cost J yr 3 converges for all the samples, which confirms the result obtained for the first case of three servo-motors. It is also noticed that the P-DC method is more appropriate for impulse response systems like in the pendulum case.

CONCLUSIONS

A comparison between the P-DC and the subtask scheduling techniques is performed experimentally by simulation under TrueTime tool. We found out that the hybridization of both techniques under an FP protocol is a promising path that helps improving significantly the quality of the control. Indeed, hybridization can suggest a better quality than a scheduling or a feedback scheduling based solely on the Predictive-Delay control. Hence, it can be deduced that the Predictive-Delay Control would be used not only to make up for scheduling latency but also to recover the control signal in overload/overrun situations. This recovering should be difficult to handle under indirect feedback scheduling or any other scheduling algorithm like the subtask scheduling techniques. To sum up concluding remarks, reducing the inputoutput latency through a subtask scheduling technique can help boosting the P-DC method. For further works, we can compare the P-DC technique with other methods like the control server or the subtask scheduling under the Earliest deadline first (EDF) scheduler, where some other techniques to avoid overruns or overload situations are used.

Figure 1 :

 1 Figure 1: Subtask model.

Figure 2 :

 2 Figure 2: The three servo-motors case under True-Time/Simulinkinverted-pendulum which are a convolution of the inverted pendulums, carts, motors and the pulley chain mechanisms as specified by the transfer functions (Figure3). The Inverted pendulum is often

  of the C i (k) values. This may not introduce processor overload situation in simulations, but such situation can occur for the subtask scheduling case.

Figure 4 :

 4 Figure 4: The three servo-motors example with the subtask model and wide range of C i (k).

Figure 6 :

 6 Figure 6: Output measures of the three servo-motors example with the subtask scheduling method under overload situation.

Figure 5 :

 5 Figure 5: Scheduling diagram of the three servo-motors example with the subtask scheduling method under overload situation.

Figure 9 :Figure 8 :

 98 Figure 9: The three servo-motors controls converge to the set point with a low cost for an overloaded system.

Figure 10 :Figure 12 :

 1012 Figure 10: Output and costs for improved QC and performance comparison, case of the three servo-motors.

Table 1 :

 1 The three servo-motors tasks system for scheduling artifacts characterization.

Table 2 :

 2 The inverted pendulums tasks system characterization.

Table 3 :

 3 Summary statement in comparison and hybridization between subtask scheduling and P-DC for the case of the three servo-motors.

			τ 2		τ 3
			Comparison Hybridization Comparison Hybridization Implementation
	1	Actual Lio	0%	0%	31%	1%
	2	Previous Lio	0%	4%	22%	0%	++
	3	Previous Lresp	0%	4%	0%	0%	-
	4	Lresp ub (WCET)	79%	0%	0%	0%	-
	5 6 Smoothed Lresp ub ( Ĉi (k)) Lresp ub ( Ĉi (k))	0% 0%	0% 51%	0% 0.5%	0% 0%	-++
	7	Subtask only	21%	0%	46.5%	0%	+
	8	Subtask & P-DC		41%		99%	++