## Section: New Results

### Control and scheduling co-design

Participants : D. Simon [ contact person ] , O. Sename, E. Roche, M. Ben Gaid [ IFP ] .

We propose here a control/scheduling co-design approach. We aim to provide an
*Integrated control and scheduling co-design* approach. Indeed closing the loop between the control performance and the computing activity seems to be promising for both adaptivity and robustness issues.

#### A LPV approach to control a robot arm

Optimization of computing resources in computer-controlled systems is a challenging problem. Current solutions consist in on-line changing the algorithm or adapting the sampling period in order to increase the flexibility by adaptation of the processor utilization.

Methods to design sampling period dependent controllers have been already proposed, e.g. in [54] for RST controllers and in [55] using the LPV/ control approach for polytopic systems. However in these studies the variation of computing resources is linked to the real-time system performance only and not to the plant expected performances. In this section we provide a methodology to design a feedback scheduling controller which will make the resource utilization vary on line according to the resource availability and to the plant trajectory.

Feedback scheduling is a dynamic approach allowing a better usage of the computing resources, in particular when the workload changes (e.g. due to the activation of an admitted new task). Here the CPU activity will be controlled according to the resource availability by adjusting scheduling parameters (i.e. period) of the plant control tasks. However the use of computing resources should also be linked to the dynamical behavior of the plant(s) to be controlled. Indeed while controlling different subsystems in a single computer it is natural to ensure the resource availability when large transient behaviors occur.

The main result given in this section consists in deriving a new feedback scheduling controller which will depend on the plant trajectory in view of an "optimal" resource sharing [19] . It is designed in the LPV/ framework for polytopic systems. Following previous results in [8] , the feedback scheduling is illustrated in Fig 9 as a dynamical system between control task frequencies and processor utilization.

In figure
9 a the interval of frequencies is limited by the "saturation" block,
represents a set of real parameters
{
_{1},
_{2}, ...,
_{n}} dedicated to the set of control tasks
{
U_{1},
U_{2}, ...,
U_{n}} . These parameters will be used to make the resource sharing vary according to the plant trajectory. For instance, in a 2 control-tasks system, where
U=
U_{1}+
U_{2} , we will require that:

being a varying parameter.

In figure
9 b,
G^{'} is the model of the scheduler, the output of which is the vector of all task loads. To get the sum of all task loads we use
C^{'}= [1 ...1] . The
H transfer function represents the sensor dynamical behavior which measures the load of the other tasks. It may be a first order filter. The template
W_{e} specifies the performances on the load tracking error.

The resource distribution is realized through the M( ) matrix. To associate the use of computing resources with the robot trajectory, the contribution of each of 3 robot control sub-tasks ( namely computing the Inertia matrix, the Coriolis forces and the Gravity forces) to the closed-loop system performances has been evaluated as a function of their execution period. Cost function has been evaluated through simulations of a particular robot trajectory (see Figure 10 ).

While it is difficult to infer the relations between the compensation tasks execution period and the trajectory tracking performance, simulation using the TrueTime toolbox (
[35] ) shows that the loads of the compensation tasks (Gravity, Coriolis and Inertia) vary on line as expected according to the parameter
_{I} , and that the adaptive LPV case (
varying) leads to a smaller cost function compared with the constant case (
= 0.375 ), which was already efficiently tuned (Figure
11 ).

#### Process state based feedback scheduling based on convex optimization

Existing approaches for state-feedback optimal scheduling (e.g. as in [39] , [51] , [66] , [45] )did not exploit or investigate the possible convexity properties of the optimal state-feedback based resource allocation problem. In fact, in these approaches, the solutions were based on rather generic optimization methods or special heuristics. However, in optimization, convexity is an interesting property that considerably simplifies the obtained solutions. Convex optimization problems have in general efficient solutions. In the context of the on-line state-feedback scheduling, the complexity of the scheduling algorithm is a crucial point for its effectiveness.

Instead of approximating the cost as a function of the sampling period, we suggest a sampling-period approximation of the different coefficients of the Riccati equations solutions, which are involved in the LQ control design.

The problem has been stated in
[15] for a collection of
N continuous-time LTI systems
described by
associated with an infinite horizon continuous-time cost functional
J_{i} , defined by
. A global cost functional
J(
x_{1}, ...,
x_{N},
u_{1}, ...,
u_{N}) , defined by
is associated to the entire system, allowing the evaluation of its global performance. Constants
are weighting factors, representing the relative importance of each control loop.

An interesting property in optimal LQ sampled-data control is that the cost functional
J_{i}(
t_{i}(
k),
x_{i},
u_{i,
hi}^{*}) may be characterized by a unique positive definite matrix
S_{i}(
h_{i}) of size
n_{i}×
n_{i} , which is the solution of the associated Riccati equation.

On several benchmarks, e.g. LQ control of an unstable pendulum, an active car suspension and the quadrotor drone described in section
6.7.4 , it has been observed that the control performance penalty due to sampling, compared with the continuous case, has a convex shape. More precisely, Figure
12 plots the elements of
(
S(
h)-
S^{c}) where
S^{c} is the solution of the Riccati equation in the continuous case, and
(
S(
h) its solution for increasing values of the sampling period
h : in all these cases the sampling penalty can be accurately approximated by quadratic functions.

In that case the problem of finding optimal solutions (i.e. sampling rates) to solve the problem of minimizing
J(
x_{1}, ...,
x_{N},
u_{1}, ...,
u_{N}) is feasible and can be computed analytically (in bounded and moderate time) using the Karush-Kuhn-Tucker (KKT) conditions.
[28] .

Simulations have been setup using a plant made of two unstable pendulums sharing a unique computing resource. Each pendulum is disturbed by different king of disturbance. The state-based feedback-scheduler (FBS) automatically allocates more computing power to the system subject to the highest disturbance, so that a global performance index is made better than in the case of a traditional fixed periods scheduling (Figure 12 b).

#### Robust control of underwater vehicles

For system with important non-linearities and large uncertainties on parameters, the use of a robust control, such as the , may not be sufficient to obtain good performances for the closed loop system over all the parameters variation range. The Linear Parameter Varying (LPV) theory, based on robust control, improves the method by taking into account the non-linearities and variations of the system at design time [30] . The obtained controller is then parametrized by a set of parameters, and is on-line adapted at the working points.

In the framework of the Connect project ( 8.1.2 ) the approach for LPV system is again applied to an Autonomous Underwater Vehicle (AUV) ( [56] ). The control of these vehicles is made difficult by numerous non-linearities, due to cross-coupled dynamics and hydrodynamic forces. Moreover the knowledge about the vehicles parameters is very poor. On the other hand the performance required by the payload may be high, e.g. the roll and pitch velocities must be kept inside tight bounds to perform high quality imaging using a side-scan sonar. Hence robust control is necessary to perform safely autonomous missions.

In a preliminary approach, the mass of the vehicle M is chosen as the unique varying parameter. Indeed, the mass is one of the parameter varying during the navigation (because of the water-added terms uncertainty, or due to the casting off of payloads during a mission). The choice of this unique varying parameters allows for keeping the controller reconstruction simple. More complex sets of varying parameters could be chosen in future studies to enlarge the set of operating conditions, such as the speed of the vehicle like in [24] for missile control. The problem for the LPV system is first solved considering a variation of + or - 20% with regards to the nominal mass of the vehicle. In that case simulations show that the LPV (adaptive) controller is always better than a purely robust controller. For higher variations of the AUV's mass (upto 70%), the LPV controller is still able to stabilize the system, provided that the mass can be roughly estimated.

These first results foster ongoing research to better understand how the LPV approach can be used to efficiently and robustly control such autonomous vehicle. In particular it is intended to combine several uncertain parameters, including computing and communication resources related disturbances like computing and networking induces delays.

#### Hardware-in-the-loop simulation of a quadrotor drone

In the framework of the SafeNECS project (see 8.1.1 ), a hardware-in-the-loop experiments using Orccad has been set up to provide a safe environment for both algorithms and software validation, prior to experiments with the real (expensive and fragile) quadrotor.

Figure 13 describes the control and diagnostic setup used for testing purpose [26] . In this block-diagram the blue boxes represent the user-provided modules (i.e. functions) interconnected by their input/output ports (respectively blue/red). From the real-time point of view, each module is implemented by a real-time task possessing its own programmable timer. Therefore all the modules can be run asynchronously at their own (possibly varying) sampling frequency. In this diagram one of the modules implements a feedback scheduler: it monitors the controller's real-time activity and may react by setting on-the-fly the tasks scheduling parameters, e.g. their firing intervals. For example it is may used to implement a (m,k)-firm dropping policy ( [42] ), accelerable tasks ( [16] ) or any one of the scheduling control algorithms described in the previous sections.

To set up a “hardware-in-the-loop” real-time simulator, the multitasks controller running on the embedded target is connected via a Can (or Ethernet) link running a numerical integrator, calling a model of the drone, of its sensors and of its actuators. This setup allows for ultimate tuning of the control algorithms before launching the real and fragile system. It is also provided with a disturbing daemon allowing to simulate various failures and to check the validity of the diagnosis and recovery procedures defined in the Safe-Necs project.