0% found this document useful (0 votes)
51 views10 pages

Robust Control/scheduling Co-Design: Application To Robot Control

This document discusses robust control/scheduling co-design for real-time robot control systems. It reviews how timing uncertainties from digital implementation can impact control performance, but closed-loop controllers are robust to some disturbances. The paper proposes adaptive feedback scheduling to dynamically adjust task periods based on computing resource usage in order to meet control performance specifications while allowing for timing flexibility. An experimental feedback scheduler is briefly described along with directions for future research.

Uploaded by

ronaldputera
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
51 views10 pages

Robust Control/scheduling Co-Design: Application To Robot Control

This document discusses robust control/scheduling co-design for real-time robot control systems. It reviews how timing uncertainties from digital implementation can impact control performance, but closed-loop controllers are robust to some disturbances. The paper proposes adaptive feedback scheduling to dynamically adjust task periods based on computing resource usage in order to meet control performance specifications while allowing for timing flexibility. An experimental feedback scheduler is briefly described along with directions for future research.

Uploaded by

ronaldputera
Copyright
© Attribution Non-Commercial (BY-NC)
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 10

Robust control/scheduling co-design: application to robot control

Daniel Simon David Robert, Olivier Sename


INRIA Rhône-Alpes Laboratoire d’Automatique de Grenoble
655 avenue de l’Europe, Montbonnot ENSIEG-BP 46
38334 Saint-Ismier Cedex, France 38402 Saint Martin d’Hères Cedex, France
[email protected] {david.robert,olivier.sename}@inpg.fr

Abstract multi-rate sampling, preemption, synchronisation and


various sources of delays makes the run-time behaviour
Control systems running on a computer are subject of the controller very difficult to accurately predict.
to timing disturbances coming from implementation con- However as we deal with closed-loop controllers we may
straints. Fortunately closed-loop systems behave robustly take advantage of the robustness of such systems to de-
w.r.t. modelling errors and disturbances, and the con- sign and implement flexible and adaptive real-time con-
troller design can be performed to explicitly enhance ro- trol architectures.
bustness against specific uncertainties. On one hand ro- This paper deals with robust and adaptive solutions
bustness in process controllers can be used to comply with for real-time scheduling and control co-design. In the
weakly modelled timing uncertainties. On the other hand next section we review some properties of closed-loop
the principle of robust closed-loop control can also be ap- controllers in contrast with real-time implementation
plied to the real-time scheduler to provide on-line adap- constraints. Some recent results in control and schedul-
tion of some scheduling parameters, with the objective of ing co-design are recalled in section 3. Section 4 gives an
controlling the computing resource allocation. The con- overview of a new feedback scheduling strategy aimed
trol performance specification may be set according to to on-line adapt the tasks period according to the com-
both control and implementation constraints. The ap- puting resource activity. This approach is then applied
proach is illustrated through several examples using sim- in the design of a robot controller in section 5, for
ulation and an experimental feedback scheduler is briefly which the importance of integrated control/scheduling
described. co-design is emphasised. Finally an experimental feed-
back scheduler implementation is described in section
6 and future research directions conclude the paper.
Keywords: control/scheduling co-design, feed-back
scheduling, robustness, resource management
2. Problem position: background on
1. Introduction control and implementation con-
straints
Digital control systems can be implemented as a set
of tasks running on top of an off-the-shelf real-time Closed-loop digital control systems use a computer
operating system (RTOS) using fixed-priority and pre- to periodically sample sensors, compute a control law
emption. The performance of the control, e.g measured and send control signals to the actuators of a contin-
by the tracking error, and even more importantly its uous time physical process. The control algorithm can
stability, strongly relies on the values of the sampling be either designed in continuous time and then dis-
rates and sensor-to-actuator latencies (the latency we cretized or directly synthesised in discrete time taking
consider for control purpose is the delay between the account of a model of the plant sampled by a zero-
instant when a measure qn is taken on a sensor and order holder. Control theory for linear systems sam-
the instant when the control signal U (qn ) is received pled at fixed rates has been established a long time
by the actuators [1]). Therefore it is essential that ago, e.g. [1].
the implementation of the controller respect an ade- Assigning an adequate value for the sampling rate
quate temporal behaviour to meet the expected per- is a decisive duty as this value has a direct impact on
formance. However implementation constraints such as the control performance and stability. While an abso-
lute lower limit for the sampling rate is given by Shan- the sample-induced disturbances stay inside the per-
non’s theorem, in practise rules of thumb are used to formance specification bounds.
give a useful range of control frequencies according to Therefore the hard real-time assumption can soft-
the process dynamics and to the desired closed-loop ened to better cope with the reality of closed-loop con-
bandwidth (see for example section 5.3). A general rule trol. For example they can be changed for ”weakly
is that decreasing the control period and latencies al- hard” constraints: absolute deadlines are replaced by
lows for improved control performance, e.g. measured statistical ones, e.g. the allowable output jitter compli-
by the tracking error or disturbances rejection. ant with the desired control performance or the num-
ber of allowed deadlines miss over a specified time win-
dow [2]. Note that to be fully exploited weakly hard
2.1. Digital control of continuous systems constraints should be associated with a decisional pro-
cess: tasks missing their deadline can be for example
To implement a controller the basic idea consist in delayed, aborted or skipped according to their impact
running the whole set of control equations in a unique on the control law behaviour.
periodic real-time task which clock gives the controller
Finding the values of such weakly hard constraints
sampling rate. In fact all parts of the control algorithm
for a given control law is currently out of the scope
do not have an equal weight and urgency w.r.t. the con-
of current control theory in the general case. However
trol performance. To minimise the latency a control law
the intrinsic robustness of closed-loop controllers allows
can be basically implemented as two real-time blocks,
for complying with softened timing constraints specifi-
the urgent one sends the control signal directly com-
cation and flexible scheduling design.
puted from the sampled measures while updating the
state estimation or parameters can be delayed or even
more computed less frequently [1]. 2.3. Control and scheduling
In fact, a complex system involves sub-systems with
different dynamics which must be further coordinated Usually, real-time systems are modelled by a set of
[18]. Assigning different periods and priorities to differ- recurrent tasks assigned to one or several processors
ent blocks according to their relative weight allows for and a worst case response times technique is used to
a better control of critical latencies and for a more ef- analyse fixed-priority real-time systems. Well known
ficient use of the computing resource [15]. However in scheduling policies, such as Rate Monotonic for fixed
such cases finding adequate periods for each block is priorities and EDF for dynamic priorities, assign prior-
out of the scope of current control theory and must ities according to timing parameters, respectively sam-
be done through case studies, simulation and experi- pling periods and deadlines. They are said to be “opti-
ments. mal” as they maximise the number of tasks sets which
can be scheduled with respect of deadlines, under some
restrictive assumptions. Unfortunately they are not op-
2.2. Control and timing uncertainty timised for control purpose.
They hardly take into account precedence and syn-
While timing uncertainties have an impact on the chronisation constraints which naturally appear in a
control performance they are difficult to be accurately control algorithm. The relative urgency or criticality
modelled or constrained to lie inside precisely known of the control tasks can be unrelated with the timing
bounds. Thus it is worth examining the sensitivity of parameters. Thus, the timing requirements of control
control systems w.r.t. timing fluctuations. systems w.r.t. the performance specification do not fit
Control systems are often cited as examples of ”hard well with scheduling policies purely based on schedu-
real-time systems” where jitter and deadline violations lability tests. It has been shown through experiments,
are strictly forbidden. In fact experiments show that e.g. [4], that a blind use of such traditional scheduling
this assumption may be false for closed-loop control. policy can lead to an inefficient controller implementa-
Any practical feedback system is designed to obtain tion; on the other hand a scheduling policy based on
some stability margin and robustness w.r.t. the plant application’s requirements, associated with a right par-
parameters uncertainty. This also provides robustness tition of the control algorithm into real-time modules
w.r.t. timing uncertainties: closed-loop systems are able may give better results.
to tolerate some amount of sampling period and com- Another example of unsuitability between comput-
puting delays deviations, jitter and occasional data loss ing and control requirements arises when using prior-
with no loss of stability or integrity, e.g. [4]: their be- ity inheritance or priority ceiling protocols to bypass
haviour can still be considered as correct as long as priority inversion due to mutual exclusion, e.g. to en-

2
sure the integrity of shared data. While they are de- Concerning co-design for on-line implementation, re-
signed to avoid dead-locks and minimise priority inver- cent results deal with varying sampling rates in control
sion lengths, such protocols jeopardise at run-time the loops in the framework of linear systems: for example
initial schedule which was carefully designed to meet [13] show that, while switching between two stable con-
control requirements. As a consequence latencies along trollers, too frequent control period switches may lead
some control paths can be largely increased leading to to unstability. Unfortunately most real-life systems are
a poor control performance or even instability. non-linear and the extrapolation of timing assignment
Finally off-line schedulability analysis rely on a right through linearising often gives rough estimations of al-
estimation of the tasks worst case execution time. Even lowable periods and latencies or even can be meaning-
in embedded systems the processors use caches and less. In fact, as it will be shown in the robot control ap-
pipelines to improve the average computing speed while plication, the plant knowledge is necessary to get an ef-
decreasing the timing predictability. Another source of ficient control/scheduling co-design.
uncertainty may come from some pieces of the con- Feedback scheduling Besides traditional assignment of
trol algorithm. For example, the duration of a vision fixed scheduling parameters more flexible scheduling
process highly depends on incoming data from a dy- policies have been investigated. Let us cite e.g. [3]
namic scene. Also some algorithms are iterative with where the elasticity of the tasks’ periods enables for
a badly known convergence rate, so that the time be- controlling the quality of service of the system as a
fore reaching a predefined threshold is unknown (and function of the current estimated load. While such an
must be bounded by a timeout). In a dynamic environ- approach is still working in open loop w.r.t. a controlled
ment some control activities can be suspended or re- plant, the on-line combination the control performance
sumed and control algorithms with different costs can and implementation constraints lead to the feedback
be scheduled according to various control modes lead- scheduling approach.
ing to large variations in the computing load. This new approach has been initiated both from the
Thus real-time control design based on worst case real-time computing side [10] and from the control side
execution time, maximum expected delay and strict [5, 7, 6]. The idea consists in adding to the process
deadlines inevitably leads to a low average usage of controller an outer sampled feedback loop (”schedul-
the computing resource. ing regulator”) to control the scheduling parameters as
a function of a QoC (Quality of Control) measure. It is
expected that an on line adaption of the scheduling pa-
3. Related work rameters of the controller may increase its overall effi-
ciency w.r.t. timing uncertainties coming from the un-
Control/scheduling co-design This mainly concerns the known controlled environment. Also we know from con-
integration of control performance knowledge in the trol theory that closing the loop may increase perfor-
scheduling parameters assignment. Indeed, once a con- mance and robustness against disturbances when prop-
trol algorithm has been designed, a first job consists in erly designed and tuned (otherwise it may lead to in-
assigning timing parameters, i.e. periods of tasks and stability).
deadlines, so that the controller’s implementation sat- Figure 1 gives an general overview of a feed-back
isfies the control objective. This may be done off-line scheduler where an outer loop (the scheduling con-
or on-line. troller) adapts in real-time the scheduling parameters
In off-line control/scheduling co-design setting ad- from measurements taken on the computer’s activity,
equate values for the timing parameters rapidly falls e.g. the computing load . Besides this controller work-
into case studies based on simulation and experiments. ing periodically (at a rate larger than the sampling pe-
For instance in [11] off-line iterative optimisation is riods of the plant control tasks), the system’s struc-
used to compute an adequate setting of periods, laten- ture may evolve along a discrete time scale upon oc-
cies and gains resulting in a requested control perfor- currence of events, e.g. for new tasks admission or ex-
mance according to the available computing resource ception handling. These decisional processes may be
and implementation constraints. Also in [12] the tem- handled by another real-time task, the scheduling man-
poral requirements of the control system are described ager, which is not further detailed in this paper. Notice
using complex temporal attributes (e.g. nominal period that such a manager may give a reference to the con-
and allowed variations, precedence constraints. . . ): this troller resource utilisation.
model is then used by an off-line iterative heuristic pro- The design problem can thus be stated as control
cedure to assign the scheduling parameters (e.g. prior- performance optimisation under constraint of available
ities and offsets) to meet the constraints. computing resources. Major studies result from [8, 4]

3
concerned, the load of the other tasks is seen as an out-
Task put disturbance.
QoS Feedback periods Computing CPU activity
Scheduler resources

h_i
Uothers
ctrl3 + +
ctrl2 Scheduling fi Plant +
reference Controlled Ur controller control tasks
Process Process output −
Controller

Figure 2. Feedback scheduling bloc diagram


Figure 1. Hierarchical control structure

where it is suggested that a simple solution to this op-


timal control problem (i.e. under resource constraint) 4.2. Sensors and actuators
is the calculation of the new task periods by the rescal- As stated in section 2.3, priorities must be assigned
ing: to control tasks according to their relative urgency ;
U
hnew
i = hinominal this ordering remains the same in the case of a dynamic
Usp scheduler. Dynamic priorities, e.g. as used in EDF, only
where Usp is the utilisation set-point. The feedback alter the interleaving of running tasks and will fail in
scheduler then controls the processor utilisation by as- adjusting the computing load w.r.t. the control require-
signing task periods that optimise the overall control ments. In consequence we have elected the tasks peri-
performance. ods to be the main actuators of the system running on
Preliminary works have been done by the authors. top of a fixed priority scheduler1 .
In [14] an LQG approach is used to design the feed- As the aim is to adjust on-line the sampling periods
back scheduling while in [17], an H∞ control problem of the controllers in order to meet the computing re-
is solved for a two tasks systems (without differentia- source requirements, the control inputs are thus the pe-
tion between both tasks). In what follows the proposed riods of the control tasks.
methodology is described. The measured output is the CPU utilisation. Let us
first recall that the scheduling is here limited to peri-
odic tasks. In this case the processor load induced by a
4. A new methodology for Feed-back task is defined by U = hc where c and h are the execu-
scheduling tion time and period of the task. Hence processor load
induced by a task is estimated, in a similar to way [6],
Feedback scheduling is a dynamic approach allow-
for each period hs of the scheduling controller, as :
ing to better use the computing resources, in particu-
lar when the workload changes e.g. due to the activa-
ckhs
tion of an admitted new task. Indeed, the CPU activity Ûkhs = λ Û(k−1)hs + (1 − λ) (1)
will be controlled according to the resource availabil- h(k−1)hs
ity by adjusting scheduling parameters (i.e. period) of where h is the sampling frequency currently assigned
the plant control tasks. to the plant control task (i.e. at each sampling instant
In the approach here proposed, a way to take into ac- khs ) and c is the mean of its measured job execution-
count the resource sharing over a multitasks process is time. λ is a forgetting factor used to smooth the mea-
developed. In what follows, the control design issue is sure.
described including the control structure, the specifi-
cation of control inputs and measured outputs, as well 4.3. Control design and implementation
as the modelling step.
The proposed control design method for feedback
scheduling is here developed. First one should note
4.1. Control structure
1 Possible secondary actuators are variants of the control algo-
In Fig 2 scheduling is viewed as a dynamical system rithms, with different QoS contributions to the whole system.
between control task frequencies and processor utili- Such variants should be handled by the scheduling manager
sation. As far as the adaptation of the control tasks is working on a discrete events time scale

4
that, as shown in [17], if the execution
Pn times are con- 5.1. Plant modelling and control structure
stant, then the relation, U = i=1 Ci fi (where fi =
1/hi is the frequency of the task) is a linear function The problem under consideration is to track a de-
(while it would not be as a function of the task peri- sired trajectory for the position of the end-effector. Us-
ods). Therefore, using (1), the estimated CPU load is ing the Lagrange formalism the following model can be
given as: obtained:

(1 − λ) X
n Γ = M (q)q̈ + Gra(q) + C(q, q̇) (4)
Û (khS ) = ci (khS )fi (khS ) (2)
z − λ i=1 where q stands for the positions of the joints, M is the
inertia matrix, Gra is the gravity forces vector and C
As c depends on the runtime environment (e.g. proces- gathers Coriolis, centrifugal and friction forces.
sor speed) a ”normalised” linear model of the task i The structure of the (ideal) linearising con-
(i.e independent on the execution time) , Gi , is used troller includes a compensation of the gravity, Corio-
for the scheduling controller synthesis where c is omit- lis/centrifugal effect and Inertia variations as well as a
ted and will be compensated by on-line gain-scheduling Proportional-Derivative (PD) controller for the track-
(1/c) as shown below. ing and stabilisation problem, of the form:
Û(z) 1−λ Γ = Gra(q) + C(q, q̇) + Kp (qd − q) + Kd (q˙d − q̇), (5)
Gi (z) = = , ı = 1, . . . , n (3)
fi (z) z−λ
leading to the linear closed-loop system M (q)q̈ =
As illustration, in a single control task system, the con-
Kp (qd − q) + Kd (q˙d − q̇).
trol scheme is therefore as in figure 3 where the esti-
This controller is divided in four tasks, i.e. a spe-
mated execution-times are used on-line to adapt the
cific task is considered for the PD control, for the grav-
gain of the controller for the original CPU system (2)
ity, Inertia and Coriolis compensations, in order to use
(this allows to compensate the variations of the job ex-
a multi-rate controller. In this first cautious feedback
ecution time).
scheduling scheme, only the periods of the compensa-
tion tasks will be adapted, as they have a moderate im-
pact on the closed-loop stability while they are more
Uothers H(z)
time consuming compared with the PD task.
+ +
1 f +
Ur K(z) T ask
c
5.2. A first step to co-design: evaluation of

controller cost functions

In the co-design, the aim is to give the precedence


Figure 3. Control scheme for CPU resources (i.e. more resources) to the tasks that are more impor-
tant for the robot control. To evaluate this importance
a cost function is defined as
According to this control scheme, the design of the Z ttrajectory X
i=7
controller K can be made using any advanced control J= (qi − qdi )2 dt, (6)
methodology. For the considered application (see sec- 0 i=1
tion 5), we have chosen the well known H∞ control with qi and qdi the actual and desired positions of
theory which can lead to a robust controller w.r.t mod- ith joint. This cost function of figure 4 is here calculated
elling errors (see [19] for details on H∞ control). More- off line first, for each subtask (among three) of the con-
over it provides good properties in the presence of ex- troller, according to the variation of the task periods
ternal disturbance, as it is emphasised in the illustra- (which may vary here from 0.5ms to 30ms), the oth-
tive examples. ers remaining constant and fixed to 1ms. Notice that
we have chosen to let the PD control task at a con-
5. Integrated control-scheduling co- stant period, due to its high influence in the robot con-
design in robot control trol stabilisation strategy. As done in [14], a variable
period could have been assigned to this task to empha-
We consider here a seven degrees of freedom Mit- sise its importance in the closed-loop stability. How-
subishi PA10 robot arm that has been previously mod- ever, in practical robot applications, it will remain at
elled and calibrated [16]. a constant rate.

5
Cost functions
der filter. The template We specifies the performances
0.146
Gravity
on the load tracking error as follows :
Coriolis
0.144 Inertia
s/Ms + ωb
0.142 We (s) = (7)
s + ωs 
0.14
with Ms = 2, ωs = 10 rad/s,  = 0.01 to obtain a
0.138 closed-loop settling time of 300 ms, a static error less
than 1 % and a good robustness margin. Matrix M =
Cost

0.136
[1 − 1 − 1] and template Wx allow to specify the load
0.134
allocation between the control tasks. With a large gain
0.132 in Wx , it leads to:
0.13
Ugravity ≈ UCoriolis + Uinertia ,
0.128
i.e. we allocate more resources for the gravity compen-
0.126
0 100 200 300 400 500
Frequency (Hz)
600 700 800 900 1000 sation.
All templates are discretized with a sampling pe-
riod of 30 ms. Finally discrete-time H∞ synthesis al-
Figure 4. Cost functions gorithm produces a discrete-time scheduling controller
of order 4.
Based on this cost functions it appears that grav-
ity compensation is the more important task therefore 5.4. Simulations
we have to allocate it more resources. Costs of Coriolis
Simulations are performed using the TrueTime tool-
and inertia compensation are quite similar thus grav-
box presented in [9]
ity compensation resources allocation is chosen to be
Benchmark: The trajectory to be tracked consists
twice of Coriolis or inertia ones.
in a point to point motion, coming from the posi-
In this application, the period of the feedback sched-
tion [−π/2, −π/2, −π/2, −π/2, −π/2, −π/2, −π/2] to
uler has been fixed to 30ms to be larger than the robot
[π/2, 0, π/2, 0, π/2, 0, π/2] in the joint space at a con-
control tasks (which limits have been fixed here from
stant velocity for each joint. The trajectory duration
0.5ms to 30ms).
is set to 2 secs, thus it is slow enough to avoid reach-
ing the actuators limits. The system is observed on a
5.3. Feedback scheduling design total duration of 2.5 seconds.
Concerning feedback scheduling, the nominal set
point of the resource utilisation is 60%. At t = 1.5s,
Uothers
a disruptive task appears that needs 30% of the pro-
We (z) e1 cessor load.
G(z) H(z)
Result analysis : From Fig. 6 (periods) the disrup-
+ +
Ur K(z) G0 (z)
+ tive task produces a transient increase of the processor
C0 Ûtot
− load at t = 1.5s. To reject this disturbance, the schedul-
ing controller increases the periods of the three com-
pensators. On Fig. 6 (loads) it appear that the grav-
Ûi M Wx (z) e2
ity compensation load is twice those of the inertia or
Coriolis load as specified through the M and Wx tem-
Figure 5. H∞ design bloc diagram plates.
On Fig. 6 (Angle) we may check that the control
load variations have no noticeable effects on the tra-
jectory (as expected due to the co-design and feedback
The bloc diagram of figure (5) is considered for the scheduling strategies), whereas the commands appear
H∞ design where G0 (z) is the model of the scheduler,
to be a little more noisy on Fig. 6 (torques).
the output of which is the vector of all task loads. To
get the sum of all task loads, we have C 0 = [1 1 1]. H(z) Remark 1 As proposed in [14], the internal process
represents the sensor dynamical behaviour which mea- controller can be also designed to take into account tim-
sures the load of the other tasks. It may be a first or- ing uncertainties, e.g. the control delays due to preemp-

6
Task periods Task periods
0.03 0.02
Gravity Inertia
Coriolis Gravity
Inertia 0.018 Coriolis

0.025
0.016

0.014
0.02

0.012
Periods [s]

Periods [s]
0.015 0.01

0.008

0.01
0.006

0.004
0.005

0.002

0 0
0 0.5 1 1.5 2 2.5 0 0.5 1 1.5 2 2.5
Time [s] Time [s]

0.8 Processor Load


1
0.6 Regulated
Cpu load

Reference
0.8 Integrator
0.4
Grand total
0.2 0.6

Load
0
0 0.5 1 1.5 2 2.5 0.4

6 0.2
Inertia
Coriolis
Scheduling

4 Gravity 0
PD 0 0.5 1 1.5 2 2.5
Disturb Time [s]
2
Task loads
0 Inertia
0 0.5 1 1.5 2 2.5
0.5 Gravity
0.4 Coriolis
Gravity 0.4
0.3 Coriolis
Task loads

Load
Inertia 0.3
0.2 Disturb
0.2
0.1
0.1
0
0 0.5 1 1.5 2 2.5 0
Time [s] 0 0.5 1 1.5 2 2.5
Time [s]
Joint positions
2 Joint positions
1 2
2 1
3 2
1.5 4 3
5 1.5 4
6 5
7 6
1
7
1

0.5
0.5
Angle [rad]

Angle [rad]

0
0

−0.5
−0.5

−1
−1

−1.5
−1.5

−2
0 0.5 1 1.5 2 2.5 −2
Time [s] 0 0.5 1 1.5 2 2.5
Time [s]
Commands
150 Commands
1 150
2 1
3 2
100 4 3
5 100 4
6 5
7 6
50
7
50

0
Joint torques [mN]

0
Joint torques [mN]

−50
−50

−100
−100

−150
−150

−200
−200

−250
0 0.5 1 1.5 2 2.5 −250
Time [s] 0 0.5 1 1.5 2 2.5
Time [s]

Figure 6. Simulations with TrueTime


Figure 7. Experiments with RTAI

7
tions which are unavoidable in real-time control and dif- handling, e.g. initialising the real-time tasks and
ficult to accurately predict in a dynamic environment. cleanly stopping the system when it reaches the
nominal termination state or when the control er-
6. Feasibility of implementation for ror exceeds a predefined threshold.
feedback schedulers Control modules with different sampling rates commu-
nicate through asynchronous protected shared memo-
While Truetime is very useful for fast prototyping
ries ; they are infinite loops triggered by clocks derived
and evaluation of scheduling controllers, it remains a
from the built-in timer by a middleware clock genera-
simulation tool where the hardware and operating sys-
tor task (ClockGen).
tems are abstracted. Execution times for control tasks
are given as arbitrary values and execution times for As our goal is testing the feasibility of feedback-
the scheduler and system level housekeeping tasks are scheduling with no modifications of the internal of the
neglected. Therefore to assess the feasibility and prac- operating system, the scheduling feedback loop is im-
tical interest of such adaptive closed-loop scheduling plemented as follows:
we have developed a feedback scheduler prototype on
• The feedback scheduler is implemented as an ad-
top of an existing robot controller. The current pro-
ditional real-time periodic task, i.e. a control mod-
totype runs under RTAI, the Realtime Linux Appli-
ule which function is specified and encoded by the
cation Interface for Linux (http://www.aero.polimi.
control designer. The inputs are the measured re-
it/~rtai/). This RTOS provides an efficient real-time
sponse times of the control tasks. The set point is
scheduler (with a recorded interrupt latency range of
a desired global computing load. Outputs are the
1 − −7µsec with the Pentium II 450 MHz used for this
sampling periods of the Gravity, Coriolis and In-
setup) and allows time-stamping of events with the res-
ertia control tasks;
olution of the built-in timer, thus the response times
• The period of CompTorque is fixed in this particu-
of each module can be accurately measured and plot-
lar experiment. It runs at a fixed period of 1ms so
ted.
that the stability of the system can be preserved.
The original controller uses the so-called “Comput-
It implements the algorithm described in section
ing Torque Controller” which is split into several com-
5.1 and reads the last available outputs of Grav-
puting modules to implement a multi-rate controller as
ity, Coriolis and Inertia via protected shared mem-
in [15] (Figure 8):
ories;
• CompTorque is the controller, updating the con- • The scheduling regulator adapts the periods of the
trol torque vector U from the state (position and Gravity, Coriolis and Inertia compensation mod-
velocity) error vector Qd − Q using a PD algo- ules and their computing load must be evaluated.
rithm which gains are tuned to provide a comfort- The evaluation of the computing load is more or
able stability margin. The sampling rate and la- less easy and precise according the features of the
tency of this block have a strong impact on the operating system in use.
system’s performance and stability. The extra in- On one hand, the direct measure of tasks exe-
puts coming from the robot model’s computations cution times is out of the scope of the API of a
are used to provide feed-forward; in the previous POSIX system. In that case, the computing load
simulation framework, it is called the PD control could be evaluated via the time of response of the
task. As well, the period of this task is constant tasks, but as the preemption phases cannot be dis-
for stability requirements. carded the global load would be over-estimated.
• Gravity, Coriolis and Inertia compute an explicit On the other hand, the RTAI kernel keeps track
model of the robot arm’s dynamics. They are of the rt tasks execution cycles, thus allowing to
costly to compute but it has been shown through recover a precise measure of the control tasks ex-
simulations that they can be executed several ecution times from the scheduling regulator.
times slower than the main controller with a mod- Deadlines misses are checked and reported to
erate impact on the control performance and sta- the supervisor ; they are not taken into account in
bility; this preliminary setup but may be used in future
• GeneTraj provides the desired trajectory via- improvements of a load estimator, for anti-windup
points at a fixed rate; and for overload handling;
• The behaviour of the periodic control modules • In this experiment the robot is still (cautiously)
is supervised by a event driven reactive task in simulated: the drivers call a numerical integrator
charge of setting up the system and exception running the robot’s dynamics model every time a

8
measure is taken or a new control vector is sent scheduling architecture can be quite easily designed
by the CompTorque task. Therefore the controller and implemented on top of an off-the-shelf real-time
and simulated process time scales are coherent, operating system with fixed priority and preemption.
but the simulation adds unpredicted latencies in Examining the plots and the kernel reporting file calls
the loop. The corresponding measured added load for the following comments:
is about 25% of the Pentium CPU used for the
• As the feedback scheduler is a simple feedback al-
setup which is fortunately strongly over-sized for
gorithm running at a slow rate its computing cost
this robot controller;
is quite low (about 75µsec every 30ms). On the
• Priorities are ordered according to the relative ur-
other hand observing and managing the system
gency and weight of these function blocks on the
at a high rate can be very costly due to numer-
system’s behaviour: ClockGen  Supervisor 
ous context switches. A more efficient implemen-
F edSched  CompT orque  GeneT raj 
tation is currently studied to decrease the system’s
Gravity  Coriolis  Inertia
cost.
• The initial periods has been set to 20 msec for the
• The tasks loads can be directly measured using a
three tasks with a variable and controlled period,
specific, non portable feature of the RTAI kernel.
i.e. Gravity, Coriolis and Inertia. The PD control
As response times are easier to measure (e.g.from
task is run at a fixed rate of 1ms and the trajec-
a POSIX API), using an execution time estimator
tory generator provides new set points every 5ms.
would increase the portability of the system. De-
The feedback scheduler is run every 30 msec.
signing such a low-cost and reliable estimator re-
• The sampling frequency of the clock generator is
mains to be done.
set to 2 KHz thus allowing to increment or decre-
• Overshoots in the control periods and load lead
ment the control tasks clocks by 500µsec steps.
to transient overload and deadline misses. These
Observing and managing the system at a faster
events are not currently processed leading to an
rate would induce a very high system’s load due
avalanche of timing faults and to a system unsta-
to too many context switches.
bility and failure. Overruns and other timing er-
• The desired trajectory is the same as in 5. Pre-
rors must be adequately processed at the supervi-
liminary experiments shown that the robot’s nu-
sion level to more safely manage the system and
merical integration spends about 25% of the avail-
make use of the full range of available processing
able CPU power. As we need some load margin
power.
to avoid transient overruns the desired load is ini-
tially set to 0.6. At time 1.5 sec it is decreased to
0.3 to make room for a disturbing incoming task 7. Conclusion
proposed for admission.
In this paper, a methodology for control and
scheduling co-design is proposed. Besides the usual
modelling errors in the process model a digital
Scheduling Controller
Reference load
Scheduling manager
closed-loop controller is also submitted to timing dis-
Estimated
response time
Error
Signal
Robust
Control Start/Init/Stop
Supervision turbances coming from the implementation: they
Tasks admission
30ms Overload handling are difficult to be accurately predicted and study-
Deadlines
Misses ing the impact of timing deviations in feedback loops
run−time clockgen 100us
library is still a largely unexplored domain. Hence a nat-
Processus
Q(k)
CompTorque U(k) h1
(numerical integration) ural idea consists in using robust control theory to
Q
design controllers to be weakly timing sensitive. Be-
Driver

G
Driver

GeneTraj Qd h2

h3
sides process control this idea can be used also to
Inertie M
design a feedback scheduling loop to implement ro-
h4
Gravite G bust on-line adaption of the scheduling parameters ac-
Coriolis Co
h5 cording to estimates of the computing activity. Thus
Operating System (Linux/RTAI)
this resource allocation control loop is used to ful-
fil the plant control objective under constraint of
Figure 8. Feed-back scheduling experiment limited computing resource.
An integrated control-scheduling framework is pro-
posed. The control periods are weighted according to
As plot in Figure 7 the very first experimental re- their impact on the control performance. An outer
sults are encouraging: they show that such a feedback scheduling controller then regulates in real-time the

9
CPU load according to the allocated computing power. [7] J. Eker, P. Hagander, and K.-E. Årzén. A feedback
Indeed the control synthesis of the feedback scheduler scheduler for real-time control tasks. Control Engineer-
has been provided using the H∞ control theory, and ing Practice, 8(12):1369–1378, 2000.
the gain of the controller is adapted on-line using the [8] J. Eker, P. Hagander, and K.-E. Årzén. A feedback
estimated execution times of the control tasks. In all scheduler for real-time controller tasks. Control Engi-
cases the effectiveness of the controllers lies in a right neering Practice, 8(12):pp 1369–1378, 2000.
choice of the design weighting functions used to spec- [9] D. Henriksson, A. Cervin, and K.-E. Årzén. Truetime:
Simulation of control loops under shared computer re-
ify the trade-off between concurrent constraints. There-
sources. In 15th IFAC World Congress on Automatic
fore the designer(s) must have knowledge on both the
Control, Barcelona, Spain, July 2002.
process and computing platform capabilities to be able [10] C. Lu, J.-A. Stankovic, G. Tao, and S.-H. Son. Feedback
to best fit the end-user requirements. control real-time scheduling: Framework, modeling, and
Some simulation and experiment results have been algorithms. Real Time Systems, 23(1):85–126, 2002.
given, which emphasises the interest of this approach [11] M. Ryu, S. Hong, and M. Saksena. Streamlining real-
and a software prototype has been designed to assess time controller design: from performance specifications
the feasibility of the approach using an off-the-shelf to end-to-end timing constraints. In IEEE Real Time
real-time operating system. Systems Symposium, 1997.
Further works concern the improvement of robust [12] K. Sandström and C. Norström. Managing complex
control schemes for both the process and scheduler con- temporal requirements in real-time control systems. In
trollers. A better insight in control w.r.t. timing un- 9th IEEE Int. Conf. and Workshop on the Engineering
certainties will be necessary to efficiently shape the of Computer-Based Systems (ECBS’02), Lund, Sweden,
weighting between control and computing constraints. 2002.
Implementation feasibility must be taken into account [13] M. Schinkel, W.-H. Chen, and A. Rantzer. Optimal con-
trol for systems with varying sampling rate. In Proceed-
and the system’s supervision must be improved. Fi-
ings of American Control Conference, Anchorage, May
nally choosing strategies and tuning parameters lead-
2002.
ing to an effective trade-off which fit with the end-user’s
[14] O. Sename, D. Simon, and D. Robert. Feedback schedul-
requirements needs a common understanding and co- ing for real-time control of systems with communication
operation between control and computer scientists and delays. In ETFA’03 9th IEEE International Conference
engineers. on Emerging Technologies and Factory Automation, Lis-
bonne, september 2003.
References [15] D. Simon, E. Castillo, and P. Freedman. Design and
analysis of synchronization for real-time closed-loop
[1] K. Åström and B. Wittenmark. Computer-Controlled control in robotics. IEEE Trans. on Control Systems
Systems. Information and systems sciences series. Pren- Technology, 6(4):445–461, july 1998.
tice Hall, New Jersey, 3rd edition, 1997. [16] D. Simon, K. Kapellos, and B. Espiau. Control laws,
[2] G. Bernat, A. Burns, and A. Llamosı́. Weakly hard tasks and procedures with orccad: Application to the
real-time systems. IEEE Transactions on Computers, control of an underwater arm. Int. Journal of Systems
50(4):308–321, 2001. Science, 29(10):1081–1098, 1998.
[3] G. Buttazzo and L. Abeni. Adaptive rate control [17] D. Simon, O. Sename, D. Robert, and O. Testa. Real-
through elastic scheduling. In 39th Conference on Deci- time and delay-dependent control co-design through
sion and Control, Sydney, Australia, 2000. feedback scheduling. In CERTS’03 Workshop on Co-
[4] A. Cervin. Integrated Control and Real-Time Schedul- design in Embedded Real-time Systems, Porto, july 2003.
ing. PhD thesis, Department of Automatic Control, ECRTS.
Lund Institute of Technology, Sweden, Apr. 2003. [18] M. Törngren. Fundamentals of implementing real-time
[5] A. Cervin and J. Eker. Feedback scheduling of contol control applications in distributed computer systems.
tasks. In Proceedings of the 39th IEEE Conference on Real Time Systems, 14(3):219–250, 1998.
Decision and Control, Sydney, Australia, Dec. 2000. [19] K. Zhou, J. C. Doyle, and K. Glover. Robust and optimal
[6] A. Cervin, J. Eker, B. Bernhardsson, and K.-E. Årzén. control. Prentice-Hall Inc., 1996.
Feedback-feedforward scheduling of control tasks. Real-
Time Systems, 23(1), 2002.

10

You might also like