Table Of ContentIEEETRANSACTIONSONAUTOMATICCONTROL,VOL.56,NO.3,MARCH2011 571
Design and Stability Analysis for Anytime
Control via Stochastic Scheduling
LucaGreco,Member,IEEE, DanieleFontanelli,Member,IEEE,and Antonio Bicchi,Fellow,IEEE
Abstract—In this paper, we consider the problem of designing plementingcontrol algorithms areusually highly time critical,
controllers for linear plants to be implemented in embedded and have traditionally imposed very conservative scheduling
platforms under stringent real-time constraints. These include approaches,wherebyexecutiontimeisallottedstatically.This
preemptive scheduling schemes, under which the execution time
makestheoverallarchitectureextremelyrigid,hardlyreconfig-
allowedforcontrolsoftwaretasksisuncertain.Inaconservative
urableforadditionsorchangesofcomponents,andoftenunder-
HardReal-Time(HRT)designapproach,onlyacontrolalgorithm
that (in the worst case) is executable within the minimum time performing.
slotguaranteedbytheschedulerwouldbeemployed.Inthespirit Modern multitasking Real-Time Operating Systems
of modern Soft Real-Time (SRT) approaches, we consider here (RTOSs), running, e.g., on embedded Electronic Control
an ”anytime control” design technique, based on a hierarchy of Units (ECUs) in the automotive domain, schedule their tasks
controllersforthesameplant.Highercontrollersinthehierarchy
dynamically,adaptingtovaryingloadconditionsandQualityof
providebetterclosed-loopperformance,whiletypicallyrequiring
Service(QoS)requirements.Real-timepreemptivealgorithms,
longer execution time. Stochastic models of the scheduler and
of algorithm execution times are used to infer probabilities that such as, e.g., Rate Monotonic (RM) and Earliest Deadline
controllers of different complexity can be executed at different First (EDF) [1]–[3] can suspend the execution of a task in the
periods. We propose a strategy for choosing among executable presenceofrequestsbyother,higherprioritytasks.
controllers, maximizing the usage of higher controllers, which
Tomakeagivensetoftasksschedulableandtoavoiddeadline
affordsbetterexploitationofthecomputationalplatformthanthe
misses, conservative assumptions are made in so-called Hard
HRT designwhileguaranteeingstability(inasuitablestochastic
Real-Time systems [1], including Worst Case Execution Time
sense).
Resultsontherobustnesswithrespecttouncertaintiesaffecting (WCET)estimatesfortasks.Theseentail underexploitationof
theschedulermodel,andonbumplesstransferfortrackingprob- thecomputationalplatformand,ultimately,costinefficiencies.
lems are also reported. Simulation results on the control of two Conversely,whenthecomputationalpowerbudgetisgivenand
prototypical mechanical systems show that performance is sub-
fixed(ascommoninindustrialpractice),thencontrolalgorithms
stantiallyenhancedbyouranytimecontroltechniquew.r.t.worst
may have to be drastically simplified to be computable within
case-basedscheduling.
the allotted time. This clearly reflects in a degradation of the
Index Terms—Anytime algorithms, embedded control, sto- overallperformanceoftheensuingclosed-loopsystem.
chasticscheduling,switchedsystems.
Substantialperformanceimprovementwouldbegainedifless
conservativeusage could bemade of the platform.Indeed, as-
sumingthattheRTOSguaranteesaminimumtime forthe
I. INTRODUCTION
executionofthecontroltask,itisoftenthecasethat,formost
A general tendency can be observed in embedded systems oftheCPUcycles,atime couldbemadeavailablefor
towards implementation of a great variety of concurrent control.
real-timetasksonthesameplatform,thusreducingtheoverall A current trend in embedded system design is to relax hard
HW cost and development time. Among such tasks, those im- schedulability constraints and introduce “softer” models of
computation (viz. “resource reservations” [4], “weakly hard”
[5] and “firm” [6] RTOSs). Here, occasional deadline misses
ManuscriptreceivedAugust19,2008;revisedMay06,2009;acceptedJune
are tolerated for tasks whose execution time may largely vary
14,2010.DateofpublicationJuly15,2010;dateofcurrentversionMarch09,
2011.ThisworkwassupportedinpartbytheEuropeanCommissionunderFP7 (duee.g.,todata-drivenbranchingand/ortheuseofcachesand
withContractCHAT–ControlofHeterogeneousAutomationSystems:Tech- pipelines). Instead of using gross WCET bounds, the random
nologiesforscalability,reconfigurabilityandsecurityISTFP7-2007-2-224428
distributionpatternandaverageofsuchmissesarequantifiedby
andContractHYCON2NetworkofExcellence,Highly-complexandnetworked
QoSmetrics,intermsofwhichdesignconstraintsaretypically
controlsystemsICTFP7–2009–5–257462.RecommendedbyAssociateEditor
J.Lygeros. set [7].
L.GrecoiswiththeDIIMA,UniversityofSalerno,Fisciano(SA)84084, In this paper, we propose a strategy to design and schedule
Italy and with the LSS – Supélec, Gif sur Yvette 91192, France (e-mail
linear controllers in a soft RT environment, so that the limits
lucagrc@gmail.com;lgreco@ieee.org).
D.Fontanelli is withthe InterdepartmentalResearch Center”E. Piaggio,” ofcurrentpracticeareovercomeandbetterexploitationcanbe
UniversityofPisa,Pisa,ItalyandwiththeDepartmentofInformationEngi- obtainedofthesameresources.
neeringandComputerScience(DISI),UniversityofTrento,Povo(TN),Trento
38100,Italy,(e-mail:fontanelli@disi.unitn.it).
A. AnytimeControlAlgorithms
A.BicchiiswiththeInterdepartmentalResearchCenter”E.Piaggio”,Univer-
sityofPisa,Pisa56100,ItalyandwiththeIIT–IstitutoItalianodiTecnologia, The key idea is to design controllers which can be imple-
Genova,Genova,Italy(e-mail:bicchi@ing.unipi.it). mented so that a useful result is guaranteed whenever the al-
Colorversionsofoneormoreofthefiguresinthispaperareavailableonline
gorithm is run for at least ; however, better results can be
athttp://ieeexplore.ieee.org.
DigitalObjectIdentifier10.1109/TAC.2010.2058497 providediflongertimesareallowed.
0018-9286/$26.00©2010IEEE
572 IEEETRANSACTIONSONAUTOMATICCONTROL,VOL.56,NO.3,MARCH2011
The idea of anytime algorithms is borrowed from the field B. PriorWorkandOutline
of imprecise computation, that has been proposed in the real-
A first attempt to apply the anytime computation paradigm
time systems literature [8], [9]. The characteristic of anytime
to control is reported in [11], [12], where standard system
algorithmsistoalwaysreturnananswerondemand;however,
reduction methods (balanced truncation or modal decompo-
the longer they are allowed to compute, the better (e.g., more
sition) are used to decompose a target controller in simpler
precise)ananswertheywillreturn.Thus,ananytimealgorithm
ones. If the simplified controllers are individually stabilizing,
canbeinterruptedprematurely,stillprovidingavalidresultand
stabilityunderswitchingisguaranteedby[11],[12]onlyunder
improving the output accuracyas the availabletimeincreases.
the implicit assumption that a long enough (but unquantified)
A periodic task is split in a mandatory part and one or more
dwelling time is allowed by the scheduler between switches.
optional parts. Functionallycritical subtasks are consideredin
Veryrecentlyaspecularapproach,usingasequenceofincreas-
themandatorypart.Ifallmandatorypartsofasetoftasksare
inglymoreaccuratemodelsoftheopenloopsystem,hasbeen
schedulable,thefeasiblemandatoryconstraintissatisfied[8].
presentedin[13].
Indigitalfilterdesign[10],thisphilosophyhasbeenpursued
On the other hand, the substantial literature on switching
by decomposing the full-order filter in a series of lower order
system stability (see e.g., [14]–[17] and references therein)
filterswhoseexecutionisprioritized.Executionofcodeimple-
provides much inspiration and ideas for the problem at hand,
mentingthefirstblockisalwaysguaranteedwithin ;code
but few results can be used directly. For instance, application
for blocks in the cascade is then executed sequentially, until a
of the important results of [18] would provide state-space
deadlineeventtakesover.Thelatestcomputedblockoutputis
realizations of different stabilizing controllers such that the
usedastheanytimefilteroutput.Theoverallperformanceofthe
overall closed-loop systems would remain stable under any
filterwasshownin[10]tobesuperiortotheconservativesolu-
switching law. Unfortunately, however, the method is thought
tionofalwaysusingonlythefirstfilterblock.
fora differentapplication, andassumesthatallcontrollersare
Toadopttheanytimeapproachinthecontroldomain,aclas-
designedbytheinternal-modelapproach,thushavingthesame
sicalmonolithiccontroltaskshouldbereplacedbyahierarchy
(rather heavy) computational complexity. Most importantly,
ofcontroltasksofincreasingcomplexity,eachprovidingacor-
at each switching instant, a state-space transformation has to
respondinglyincreasingperformanceofthecontrolledsystem.
be applied, whose complexity is comparable to that of the
Forinstance,thesimplestcontroltaskinthehierarchy,couldbe
controllers themselves. By the same practicality argument,
designedtoguaranteeonlystabilityoftheclosedloopsystem,
algorithms for switched system stabilization (such as e.g.,
while whenever the scheduler provides ”surplus” time, other
[19]–[22]) requiring the computation of complex functions of
moresophisticatedcontrolalgorithmscouldbeexecutedtoob- the state to ascertain which subsystem can be activated next
tainbetterqualityofcontrol. time, are not applicable to the anytime control problem as we
However, application of the anytime algorithm idea to con- considerithere.
trolismuchmorechallengingthanitmaysuperficiallyappear. Thethreadofworkclosesttooursisprobablythatrelatedto
Themainconceptualroadblockisthat,asopposedtomostany- FirmRealTimeSystems(FRTSs)[5],[6].Inaseriesofpapers
timecomputationand filteringalgorithms, anytimecontrollers [7],[23]–[25],Lemmonandco-workersconsiderperformance
interact in feedback with dynamic systems, which fact entails ofNetworked ControlSystems (NCSs)inaFRTS framework,
issuessuchas: introduce a stochastic model to describe the task dropout
(cid:129) Switched System Performance: unpredictable preemption process, and provide a general QoS constraint encompassing
events introduce stochastic switching among different classical metrics such as average- or window-based dropout
closed-loop systems, which can subvert naïve expecta- measures.
tions—e.g.,switchingbetweenstabilizingcontrollersmay Probabilistic modeling of real-time systems is by now a
wellresultinoverallinstability.Moregenerally,closed-loop widely accepted approach to avoid overconservatism of de-
performanceisstronglyinfluencedbyswitching; terministic (WCET-based) models, to which an ample and
(cid:129) Practicality: implementation of both control and sched- growing literature [26]–[28] is devoted. Within stochastic
uling algorithms must be numerically accurate, yet very models of RT systems, the use of Markov chains (cf. e.g.,
simple and noninvasive, not to contradict the very nature [25], [29], [30]) is one of the most promising avenues to ac-
ofthelimited-resource,embeddedcontrolproblem; curately compute the response time distribution (and deadline
(cid:129) Hierarchical Design: the design of a set of controllers as miss probabilities) of different tasks in systems ranging from
progressiveapproximationstowardsagiventargetdesign fixed-priority(e.g.,RM)todynamic-priority(e.g.,EDF).
does not typically provide the desired performance hier- Inthispaper,whichbuildsupon[31],wealsoadoptaMarkov
archy.Indeed,performanceofclosed-loopsystemsarenot Chainmodeltodescribethesequenceoftimeslotsallottedby
triviallyrelatedtohowclosecontrollerapproximationsare aschedulerforthe executionofa controltask(formethods to
tothetarget,asitise.g.,infilterdesign; infer the parameters of the stochastic model of the scheduler,
(cid:129) Modularity: the computational structure of control algo- see e.g., [28], [29]). Our model differs from the one used in
rithmsshouldbeinheritedthroughthehierarchylevels,so theFRTSsliteraturecitedabove,aswedefineourprobabilities
thatthecomputationofhighercontrollersinthehierarchy onthespaceofexecutiontimesratherthanondeadlinemisses.
exploits results of computations executed for lower con- A more substantial difference, however, is that we regard the
trollers. Although this property is not strictly required, it scheduler characteristics to be a given in our problem, rather
cangreatlyenhanceeffectivenessofanytimecontrol. thanadesignobjective.Inouranytimecontrolsetup,different
Wewilldiscusstheseissuesfurtherintherestofthepaper. control subroutines can be alternatively activated in different
GRECOetal.:DESIGNANDSTABILITYANALYSISFORANYTIMECONTROL 573
periods to control the same plant, and we developa switching The following sufficient condition for AS-stability was
policythataffordsbetterexploitationofthecomputationalplat- provenin[32]:
form while guaranteeing overall closed-loop stability. As the Theorem1(1–StepAverageContractivity): [32]Ifthereex-
systemresultingfromswitchingunderstochasticconstraintsisa istsamatrixnorm ,suchthat
MarkovJumpLinearSystem(MJLS),stabilityisstudiedinthe
probabilisticsenseof“AlmostSure”(AS)stability[32],[33]. (4)
II. BACKGROUNDMATERIAL
thentheMJLS(2)isAS-stable.
Let be a given linear, discrete time, in- Inequality (4) can be interpreted as an averagecontractivity
variantSISOplantandlet , ,beafamily ofthestatenormoveraone-stephorizon.Aconditionlessre-
ofcontrollersfor suchthatthefeedbackconnectionof with strictive than (4), and involving the average contractivity over
isasymptoticallystableforall .Lettheclosed-loopsystem amulti-stephorizonhasbeenpresentedin[33].Namely,anew
thusobtainedbedenotedas andletitsdynamicsbe MJLS, called “lifting of period ”,is associated to the MJLS
(2).Sucha systemrepresentsthe sampling ofthe originalone
at timeinstants , , andits stabilitypropertiesmirror
(1)
thoseoftheoriginalsystem.Moreprecisely, theliftedversion
ofperiod ofsystem(2)isdefinedby
The set of controllers is assumed to provide a hierarchy of
performance and complexity. In other terms, we assume
that application of controller provides better closed-loop
performancethancontroller if ,andthatitssoftwareim-
with , ,
plementation typically requires longer execution time. Which
. Moreover,
controller will be actually executedat eachperiod depends on
isaMarkovprocesstakingvaluesin
the time allotted by the RTOS scheduler and on the execution
time of different controllers, both nondeterministic quantities. andcharacterizedasfollows:for and
The main tool used in this paper to address stability of the , the transition probability matrix
switchingsystemensuingfromprobabilisticschedulingmodels has elements given by
isthetheoryofAlmostSurestability. . This process has i.p.d. given by
.
A. AlmostSureStability The 1–step average contractivity condition applied to the
liftedsystemyields
Inthissection,abriefreviewofresultsonAlmostSuresta-
Theorem2( –StepAverageContractivity): [33]If
bility (AS-stability) for discrete-time systems is reported fol-
lowing [33]. Consider the discrete-time Markov Jump Linear
(5)
System(MJLS)
(2)
thentheMJLS(2)isAS-stable.
Theimportanceofcondition(5)isrelatedtothefactthatfor
where , , ,and is increasingvaluesof itprovidesasequenceofsufficientcon-
a finite-state discrete-time homogeneous irreducible aperiodic ditionsand,mostimportantly,tothefollowingresult
(FSHIA) Markov chain taking values in the finite state space Theorem3: [33]System(2)isAS-stableifandonlyif
, with transition probability matrix , suchthatcondition(5)holds.
, and with initial proba-
bilitymeasure .Theevolutionoftheprobabilitydistribu- III. STOCHASTICMODELINGOFTHESCHEDULINGPROCESS
tion oftheprocess attime isgivenby
Weconsiderasingle-processorplatformwithamultitasking
RTOS, and a periodic control task with period . We further
(3)
assume that control inputs and outputs are time-triggered and
synchronized,i.e.,measurementsareacquiredatthebeginning
We will denote by the unique invariant probability distri-
of each period and control inputs are released at the end. As
bution (i.p.d.) of the irreducible and aperiodic Markov chain,
a consequence, the control task is not affected by jitter, while
correspondingtothesteady-stateprobabilitydistributionforthe
the constant unit delay can be easily accounted for directly in
process (i.e., forany ).
the design of the individual controllers [34]. Assume the pe-
Definition 1: The MJLS (2) is said exponentially almost
riod tobe dividedin timeslices oflength ,and
surely stable (AS-stable) if there exists such that, for
thateachcontroller isimplementedbyahomonymoussoft-
any andanyinitialdistribution ,thefollowing
waresubroutine.Boththetimeallottedbytheschedulertothe
conditionholds:
controltask,andtheexecutiontimesofanysubroutine,are fi-
nitemultiplesof .Let ,with ,
and .
574 IEEETRANSACTIONSONAUTOMATICCONTROL,VOL.56,NO.3,MARCH2011
Letthetimeallottedtothecontroltaskduringthe -thsam- with
plingperiodbedescribedbythediscreterandomvariable
takingonvaluesintheset .Asimplestochasticdescription
.
oftherandomsequence canbegivenintermsofan .
.
independently and identically distributed (i.i.d.) process, with
probabilitydistributiondenotedby .Moti-
vated by the stochastic model of RT systems in [29], [30], we
adoptinwhatfollowsamoregeneralmodelbasedonMarkov astochasticmatrix.If isaMarkovchain,then istime
chains. Accordingly, will denote a FSHIA Markov chain dependent,thoughnotnecessarilyaMarkovchain.
taking values in , with transition probability matrix and Remark 1: The assumption can be easily
i.p.d. . dropped. Indeed, if , it is sufficient to add to
Sinceitisassumedthatnodeterministicinformationisavail- the event , with the meaning “ iff in the -th
ableinadvanceontheeffectivetimeallowanceforthecontrol periodnocontrollerscanbeexecuted.”Inthiscase,matrix
task, subroutines must be computed sequentially, i.e., the ismodifiedbyaddingonitstoparow ,where
computationof cannotstartuntilthecomputationof has isthecumulativedistributionthatnocontrollercanbe
terminated.Therefore,theexecutiontimefrom to ismod- executed.
eledasadiscreterandomvariable definedon ,withprob- Remark2: Inourpreviouswork[31],adeterministicmodel
ability distribution , with of the controller execution time was considered. This can be
and .The(time-independent)probabilitydistribu- regardedasaparticularcaseofthepresenttreatment,where
tionof isdescribedby . ischosenasavectorhavinga1in -thpositionif ,
We now combine the probabilistic models above into a sto- and0elsewhere.Moreover,if islimitedtothesetofallthe
chastic description of the highest-index executable controller WCETs, namely , then
in each period. This will be referred to as the (unconditioned) becomestheidentitymatrixand coincideswiththeFSHIA
schedulerprocess .Indeed, representsthehighestindexofa Markovchain .
schedulablecontroller,i.e.,thecontrollersuchthatitsexecution
timeisthelargestamongthoseshorterthantheavailabletime.
IV. PROBLEMFORMULATION
Assumefirstthatthesimplestcontroller (whoseworst-case
execution time is ) is considered to be mandatory in Given a set of controllers , the associated closed loop
theanytimescheme,andthatthefeasiblemandatoryconstraint dynamics ,andaprobabilisticdescriptionoftheprocess
modeling the maximum schedulable controller, a degree of
issatisfied.Lettherandomprocess
freedomislefttothecontroltaskdesignertomakeanexplicit
takingonvaluesin bedefinedas“
choiceofthecontrollertobeactuallyexecutedineachperiod.
iffinthe -thperiodallcontrollers butnocontroller
We will refer to such choice as the switching policy, which is
canbeexecuted.”Becausecontrollersarecomputed
definedasamap , determiningtheupper
sequentially, this is equivalent to stating that “ iff in
bound to the index of the controller to be executed
the -thperiod canbeexecutedbut cannot.”.
attime .Inotherterms,attime ,thecontroltaskcomputes
Let . From
controllers until ,unlessadeadlineeventoccurs
,itfollows:
forcing it to provide only , the highest controller computed
beforethedeadline.
Applicationofaswitchingpolicy toasetoffeedbacksys-
tems underagivenscheduler generatesaswitched
Toexpress intermsofdistributions linear system which, under general hypotheses, is a
,letuswrite stochastic JLS with a conditioned i.p.d. . As an example,
themostconservativepolicyistoset ,i.e.,forcingal-
waystheexecutionofthesimplestcontroller ,regardlessof
the probable availability of more computational time (
).Ifthefeasiblemandatoryconstraint
is satisfied, this (non-switching) policy guarantees stability
because the two events are mutually exclusive. oftheresultingclosedloopsystem.
Recalling that controllers are computed sequen- On the opposite, a “greedy” strategy would set ,
tially, implies , hence whichleadstocomputing forall (hence ). Al-
and thoughthispolicyattemptsatmaximizingtheutilizationofthe
mostperformingcontroller,itiswellknownthatswitchingar-
Defining the cumulative distribution of as bitrarilyamongasymptoticallystablesystems mayeasilyre-
, we can write sultinanunstablebehavior[35].Asufficientconditionforthe
. The relation greedyswitchingpolicytoprovideanAS-stablesystemispro-
betweenthestochasticprocesses and isthengivenby vided by Theorem 1, where and . Notice
thathereweassumethatallclosed-loopsystemshavethesame
(6) number of states, which coincide with the sum of the number
GRECOetal.:DESIGNANDSTABILITYANALYSISFORANYTIMECONTROL 575
ofstatesoftheplantandofthelargestcontroller(theactualar- Inconclusion,westatethefollowingproblem
rangementofthestatevectorsforclosed-loopsystemsisillus- Problem 1 (Optimal SwitchingPolicy (OSP) Problem): For
tratedindetailintheimplementationSectionVII). agivenplant ,asetofcontrollers ,withassociatedperfor-
Ifthisconditionisnotverified,itisimportanttoinvestigate manceindex andprobabilisticexecutiontime ,andaprob-
whether there exist scheduling policies which can ensure abilistic scheduler process , find a switching policy that
AS-stability other than the over-conservative non-switching maximizes ,subjectto .
choice.Todoso,assumethattheset
V. INDEPENDENTSTOCHASTICSWITCHINGPOLICY
In this section, we tackleproblem 1 abovebyintroducing a
switchinglawwhichisitselfstochastic,andisbasedonthecon-
is not empty for some matrix norm. Given a scheduler i.p.d. ceptofaconditioningMarkovchain.Thestochasticproperties
,inorderforacompatibleandstabilizingconditionedi.p.d. oftheschedulerprocessandconditioningchaininteracttopro-
to exist, further constraints have to be satisfied. In- ducearesultingswitchedsystem.Tostudysuchinteraction,we
deed,let .Foraswitchingpolicytoexistwhichcanalter willmakeuseoftheoperationsofmergingandaggregatingsto-
a given scheduler probability distribution into , chasticprocesses.
thefollowingmusthold: ThemergingoftwofinitestateMarkovchains and ,
definedonthestatespaces and ,respectively,isthesto-
chastic process defined on such that
.Thefollowingholds:
. Theorem 4: For two independent, FSHIA Markov
.
.
chains and with transition probability matrices
and , and initial probability
distributions and , let and denote their
where ,and . respective (unique) invariant probability distributions. Then,
Inequalities – take into account the fact that no forthemerging ,itholds
switching law can alter the scheduler so as to give more com- i) is a FSHIA Markov chain whose statis-
putationaltimetocontroltasksthanitismadeavailablebythe tics are given by the transition probability matrix
scheduler.Furthermore,constraints – modelthefact and by the initial
that the probability of the -th controller can be increased
probability distribution (
onlyattheexpensesofareductionoftheprobabilities ,
denotestheKroneckerproduct);
ofmorecomplexcontrollers.
ii) theevolutionofthechain isgivenby
Definition2: Givenasetofmatrices , ,andasched-
uleri.p.d. ,thesetoffeasibleAS-stabilizingschedulingprob-
(8)
abilitiesisdefinedas ,with
with . Moreover, converges to the unique
i.p.d.
(9)
foranyinitialdistribution .
Proof: SeetheAppendix.
Considerfurtherastochasticprocess definedonthefinite
state space and a function mapping in
anotherfinitestatespace .Theaggregationof withrespect
to is the stochastic process defined on the quotient space
Assuming that , it is natural to consider a Quality of by the equivalence relation iff .
of Control (QoC) metric within the set of feasible stabilizing NoticethattheaggregatedprocessisnotnecessarilyMarkovian
schedules. Based on the hypothesis that controllers are hierar- eveniftheoriginalprocessis.
chically ordered by their closed-loop performance, so that use Coming back to the stochastic processes describing the
ofcontroller providesbetterresultsthan , ,anatural scheduling and execution of controllers, consider an indepen-
QoCmetricfortheproblemathandcanbesimplygivenas dent FSHIA Markov chain defined ona finite statespace
. We will associate a switching law to the
stochasticprocess inthefollowingexplicitsense:
(7)
IndependentStochasticSwitchingPolicy(ISSP).
Atthe –thperiod,thecontroltaskproducestheresultsofthe
i.e.,thesecondmomentofarandomvariable -thcontroller iff
withi.p.d. ,where istheperformanceindexassociatedwith 1) and ;or
, , . 2) and .
576 IEEETRANSACTIONSONAUTOMATICCONTROL,VOL.56,NO.3,MARCH2011
The fact that process may not be a Markov chain im- and inDefinition2areautomaticallysatisfiedbyani.p.d.
pliesthatthemergedprocess isalsonota asin(13).Furthermore,forsuch ,constraint canbe
Markovchainingeneral.However,theprobabilitydistribution rewritten(withtheprovisothat )as
of islinearlyrelatedtothedistribution of
themergedMarkovchain .Indeed,fromtheindependence
of the random variables and , by the mixed
productrulewecanwrite
By introducing the QoC vector , , such that
(10)
, using (13) and rearranging
with theidentitymatrix. terms,theOSPproblemrestrictedtotheISSPclasscanbestated
Weidentifystatesof resultingintheexecutionofthesame asaclassicallinearprogrammingproblemintheunknown :
controllerbyintroducingtheaggregatingfunction OSPProblem
with . The switching law choice above
amountstosettingtheconditionedprobabilitydistribution
equalto ,whichistheprobabilitydistributionoftheaggre-
gatedprocess .Itcanbeeasilyverifiedthattheevolution
of isgivenby
(11)
with suchthat and
where and .
Noticethat indicateshereadesiredcontractivitymargin,
whiletheuseofnon-strictinequalitiesin2)impliesthatanon-
irreducibleMarkovchain isacceptedasapossiblesolution.
Remark3: Becauseofthelinearmappings(10)and(11)the ItisalsoworthnotingthatanecessaryconditionforOSPtobe
process admitsani.p.d.towhicheachinitialdistribution feasibleisthat suchthat .Thismayeasilynotbe
oftype converges.Inparticular, thecaseforanarbitrarymatrixnorm.Ontheotherhand,ifama-
we have trixnormforwhich ischosen,and
(whichisreasonabletoassume),thenfeasibilityisguaranteed.
(12) Whilefindingsuchanormisalwayspossibleif isSchur,
thechoiceofsuchan –adaptednormtendstobiassolutions
with . Hence the contractivity condition of the
ofOSPtowardsusingthesimplestcontrollermoreoften.This
AS-stabilityanalysisappliesto .
inturntendstoproducelowperformanceindex .Therefore,it
Remark4: Itcanbeobservedthatthechoiceofaswitching
canbeusefultoconsideramoregeneralpositionofthesched-
law by a Markov chain independent from the scheduler
ulingproblem,whichisdescribednext.
process isnotthemostgeneralpossiblechoice.However,
besides simplifying the analysis considerably, this choice has B. Multi-StepAverageContractivityCondition
the advantage of not requiring on-line computations. Indeed,
Theadvantageofusing -stepcontractivityisillustratedby
an arbitrary realization of the process can be computed
thefollowingLemma:
off-lineandusedasaswitchinglaw ,whichfactiscrucial
Lemma1: If suchthat isSchur,thenforanygiven
fromapracticalitypointofview.
matrixnorm , and suchthatthesolution
A. One-StepAverageContractivityCondition setisnotempty,i.e.
Basedonresultsoftheprevioussection,weseekasolutionof
Problem1withastructuresuchasin(12).Theconditionedi.p.d.
,whichfornotationalsimplicitywewilldenotehenceforth
as ,canbewrittenmoreexplicitlyas
Proof: If isSchur,then suchthat .
(13)
Let and .Hence suchthat,
forallprobabilitydistributionswith ,
where . , .
Itactuallyturnsoutthatthestructureof describedin(13), This result guarantees that a -step stabilizing switching
resultingfromthechoiceofanindependentconditioningchain, policy exists, for large enough : by the assumption that
simplifies the formulation of the synthesis problem substan- , it is indeed sufficient to choose in
tially.Indeed,itcanbeprovenbysimpleiflengthyarguments the Lemma above. To exploit the more general -step con-
(see Lemma 2 in the Appendix), that constraints , , tractivity condition (5), we introduce a switching law such
GRECOetal.:DESIGNANDSTABILITYANALYSISFORANYTIMECONTROL 577
that some control patterns, i.e., sequences of symbols in , VI. ROBUSTSYNTHESIS
are preferentially used with respect to others. This may imply
We consider now the case that an exact stochastic model of
associating to a matrix sequence a steady-state probability of
the scheduler is not available, rather it is subject to Unknown
occurrence different from the product of the probabilities of
But Bounded (UBB) uncertainties. For the sake of simplicity,
each matrix. Accordingly, an unconstrained chain will be
we limit our robustness analysis to the one-step average con-
used for conditioning (as opposed to using a lifted version of
tractivitycondition.
the one-step conditioning chain ), which can be interpreted
Assume first that UBB uncertainties affect the steady-state
assuggestingthesequenceofcontrollerstobeexecutedinthe
probabilities that a time is allotted to the control task, but
next steps.
thattheprobabilisticcomputationalmodelofthedifferentcon-
Let denotetheliftedMarkovchaindescribingthetimeal-
trollersisknown.Inotherterms,weassumethatthematrix
lottedtocontroltaskcomputationinthenext periods,whose
isgiven,while isonlyconstrainedtobelongtoapolytopic
states are sequences of the original symbols defined in the
setwithafinitenumberofvertices,i.e., ,with
new statespace with cardinality . Alsolet denote the
( denotestheconvexhulloperator).
liftedschedulerprocessand itsstates( ).
Due to the linearity of the mapping between and
To compute the distribution of the lifted process defined
, is mapped in the polytopic set
on , consider the matrix , whose entry is
, ,where ,
, with the sequence
.
and . Recallingthe meaning ofthe process ,
Thisuncertaintydescriptionlendsitselftoaverysimplero-
thisprobabilitycanbewrittenas
bustnessproblemformulation.Indeed,beingthatproblemOSP
islinear,henceconvex,w.r.t. ,thesetof solvingOSPfor
every can be characterized simply by replacing the
firstinequalityinOSPwith inequalities,oneforeachvertex
.Hence,thenewsolutionsetisthepolytope
where we used the stationarity of the random variables .
Fromtheindependenceofthevariables and
with . Exploiting the lin-
,wehave
earity of the index function in OSP w.r.t. both and , the
searchforarobustoptimalswitchingpolicycanbecastasabi-
linearprogrammingproblemwithdisjointconstraints:
ROSPProblem
(14)
Suchaproblemadmitsanoptimalsolution where
where , times. and [36] (with denoting
Thedistributionof and arehencelinearlyrelatedthrough the set of vertices of ). Applying von Neumann’s minimax
.ConsidertheconditioningMarkovchain with states theorem[37],anequivalentformulationofROSPisgivenby
takingvaluesinafinitestatespace .Fornotationalsimplicity,
let denoteasequenceofsymbols ,sothatwe
have . A -step equivalent of Problem 1 is directly
obtainedbyreplacing , and with , and ,re- An optimal solution to ROSP can then be found by
spectively. thefollowingalgorithm:
If a set of steady-state probability distributions exists 1) , solve the linear
solvingthe -stepversionofProblem1,thesynthesisproblem program
isagaintofindasteady-stateprobabilitydistribution forthe
chain suchthattheaggregatedprocess hassteady-state
distribution , with the aggregation induced by the
element-wiseminimumfunction. andbuildtheset ;
Finally,aQoCmetricgeneralizing(7)isobtainedbysetting 2) Exhaustivelysearch andfind
,with ( times).Indeed,in
thiscaseanyweight istheproductofweightsrelatedtothe
sequence .Withthesestipulations,anoptimal
multistep switching problemfor fixed can be formulatedin Considernowthemorerealisticcasethatthetransitionprob-
theparameters inthesametermsastheOSP. abilitymatrix oftheMarkovchain isalsoaffectedbyUBB
578 IEEETRANSACTIONSONAUTOMATICCONTROL,VOL.56,NO.3,MARCH2011
uncertainties, described by a polytope of stochastic matrices
TABLEI
suchthat ,andlet COMPUTATIONALCOMPLEXITY(CONSIDEREDASTHENUMBEROF
MULTIPLICATIONSEXCEPTBY0OR1)ANDNUMERICALRELIABILITYOF
DIFFERENTSTATE-SPACEREALIZATIONSOFASTRICTLYPROPERTRANSFER
FUNCTION(cid:0)(cid:0)(cid:2)(cid:2)WITH(cid:3) POLES.THEGENERICCASEASSUMES
NOPARTICULARSTRUCTUREINTHESYSTEMSMATRICES
denote the simplex of probability distributions. The set of
steady-statedistributions correspondingto ,i.e.
isunfortunatelynotconvexingeneral.Infact,if denotethe
according to the switching policy proposed
steady-statevectorscorrespondingtovertexmatrices ,there above.
isnoguaranteethat isincludedin . ForASstabilityanalysispurposesonly,itisconvenienttoset
AnumericallytractableconditionforrobustAS-stabilitycan upa compoundstate vector ,with
beobtainedbyconstructingapolytope providinganouter , which includes the states of the plant and those of
(conservative)approximationof ,i.e., . eachcontroller.Thecorrespondingclosed-loopmatrices
Consider the image under of a set , de- arecomputedasfollows:
noted as . As a conse-
quence of the linearity of the map, if is a polytope (16)
, then also is a polytope,
described by . Because
where,assumingthatthe“sleeping”statescorrespondingtoin-
activecontrollers , areresettozero,wehave
is the set of all fixed points for the map , i.e., ,
suchthat ,itholds .Forthesame
reason,for ,itholds .Itisworthnotingthat
ingeneral ,but,being and ,
clearly .Thissuggeststhefollowingiterative
algorithm:
withthe non-zeroblocks in the –th block positions.It should
be noticed that this independent controller design approach is
the simplest but does not provide any modularity: indeed, in
such a mutually exclusive scheme, all computation results for
providing a non-increasing sequence of outer polytopic areeventuallydiscarded.
approximations for as desired. If UBB uncertain- To obtain a modular design for anytime control, one could
ties also affect the mapping , i.e., if we assume pursueatop-downapproach,startingwiththedesignofacom-
, then the approximating plex,high-performancecontroller (by,e.g.,a technique
polytope ismapped bymeansofallthemappingsin in applied to the full set of performance requirements). Progres-
thepolytope .Thegeneral sively simpler controllers , may then be
obtained by e.g., model reduction techniques. As already re-
ROSP problem is therefore restated by simply replacing the marked, however, this approach does not systematically guar-
polytope with . anteeclosed-loopperformanceunderswitching.
Moreover, most model reduction techniques require
VII. IMPLEMENTATIONOFANYTIMECONTROLSYSTEMS
state-space realizations with full dynamic matrices , which
Inthissectionwediscusstheproblemofdesigninganordered makes them impractical in real-time embedded applications.
setoffeedbackcontrolalgorithmsforthegivenplant ,whose Indeed, practicality requirements imply careful consideration
state andoutput evolvewiththeinput as of algorithmic implementations of control laws [38]. Table I
reports a comparison among three different state space repre-
sentationsforSISOsystems.
(15)
We propose a simple, bottom-up design technique which
is suitable for addressing the main requirements of anytime
A first, straightforward approachconsists of designinga set
control algorithms. The method is based on classical cascade
of independentcontrollers
design. Consider the two design stages illustrated in Fig. 1,
in which controllers are designed to ensure increasing per-
formance by any classical synthesis technique. The scheme
in Fig. 1 cannot be implemented as a modular anytime con-
where . A hierarchical design, with trol, because after computation of the a) scheme, the input
and increasing performance, can be made e.g., by adopting to the block needs to be recomputed completely if the
a sequence of design procedures of increasing sophistication b) scheme is to be applied. However, by simple block ma-
and/orbyintroducingsuccessiverefinementsofdesignspecifi- nipulations, the scheme in Fig. 2 can be obtained, where we
cations.Controllersarethencomputedsequentiallyintheorder set The scheme in Fig. 2 is suitable
GRECOetal.:DESIGNANDSTABILITYANALYSISFORANYTIMECONTROL 579
A. TrackingControlandBumplessTransfer
ThescheduleconditioningtechniqueofSectionVisableto
address the switched system performance issue satisfactorily
whenaregulationproblemisconsidered.Inreference-tracking
tasks, however, performance can be severely impaired by
switching between different controllers. Indeed, some of the
controllers may remain idle for a certain number of periods,
withtheirstatesina“sleeping”condition.Suddenre-activation
of sleeping states may produce ”bumps” in the states and out-
puts,anddegradeperformance,iftheactivepartofthesystem
hasgonethroughsignificantchangesinthemeantime.
The design of bumpless-control techniques has been exten-
sivelyconsideredintheliteraturesinceatleastthe80’s([39]),
Fig.1. Stagesofaclassicalcascadedesignprocedure.
andisstillanactiveareaofresearch([40]–[42]).However,most
oftheexistingresultsarenotmeantforresource-limitedappli-
cationsasthosetargetedhere,anddonotcomplywiththeprac-
ticality requirements which are at a premium in anytime con-
trol.Wedescribebelowasimplemethodforbumplesscontrol
thatappliestothemodularanytimestructureinFig.2,andthat
generalizesittotrackingproblemsforset-pointreferences
whichvaryslowlywithrespecttotheschedulingswitches.
Weassumeinwhatfollowsthattheinputreferenceisscaled,
ascustomaryintrackingproblems,intheprefilterblock (see
Fig.2. Switchedcontrolschemesuitableforanytimecontrolimplementation. Fig.2),bythesteady-stategainofthecorrespondingclosedloop
TheschemeisequivalenttoFig.1(a)whentheswitchesareinthe(cid:0)(cid:0)(cid:2)position,
andtoFig.1(b)for(cid:0) (cid:0) (cid:3). systemwithcontroller , .Let denotethestateof
thecontrolledplant,and bethestateofthe –thcontroller
component .Supposenowthat,atsomeinstantintime ,
the –th level controller is active and the system components
for anytime implementation. Indeed the series of and
havereachedasteady-stateequilibriumunderaconstantrefer-
is in open-loop (hence equivalent to an anytime filter
ence .Let , ,and denotethecorrespondingequi-
),whiletheparallelconnectioninthefeedbackloop
libriumvaluesofthestatesandoutput.
is simply obtained by summing the value computed in
Consider the event that, at time , the execution
to the value computed previously in . Using
of the –th level controller is imposed, by either the occur-
Jordanformrealizationsoftheblocksprovidesgoodnumerical
renceofadeadlineoraconditionedscheduleswitch,whilethe
accuracyaswellaslowcomputationalcomplexity.Thecascade
reference remains unchanged from . If (high-to-low
designmethodcanbeappliediterativelytoprovideacomplete
level switching), it can be easily verified that the active parts
hierarchy of controllers, satisfactorily addressing the issues
ofthesystemstateremainat .Ifinstead
ofhierarchicaldesign,practicality,andmodularity.
(low-to-highlevelswitching),theevolutionofthewholesystem
ForASstabilityanalysis,considerthesequenceoffeedback
for dependsuponthevaluesofthesleepingstatesattime
controllers .
,i.e., , .Thedynamicsofcontrollerstates
Let the dynamics of the component controllers be realized
during their idle periods is therefore an important degree-of-
in a –dimensional state space with .
freedom in switching control design. Straightforward policies
Astate-spacerealizationfor isthengivenby
for managing sleeping states, such as e.g., keeping them con-
stantduringsleep,maybeadequatefortheregulationproblem,
butnotfortracking(ifthereferencechangesevenslowlyduring
theidletimeofacontrollercomponent,outputbumpswillnec-
essarily result at re-activation of that component). It is worth-
whilenoticingexplicitlythatzeroingthesleepingstates,either
instantaneously–asassumedintheprevioussection–orpro-
gressively with a simple and computationally inexpensive dy-
Accordingly,andassumingagainthatthestatesofinactivecon-
trollersareresettozero,thecorrespondingclosed-loopmatrices namics as e.g., in [11], effectively avoid bumps only for zero-
havethesamestructureasin(16)withthenew regulationproblems.
blockdefinitions When the active part of the system is at steady state in
under a constant reference , perfectly smooth low-to-high
switchingwouldbeachievedifandonlyifthestateofthe -th
(17)
componentcontroller( )isre-initializedas
(18)
(19) (20)
580 IEEETRANSACTIONSONAUTOMATICCONTROL,VOL.56,NO.3,MARCH2011
TABLEII
SAMPLED-TIMETRANSFERFUNCTIONSFORSYSTEMSINFIGS.3AND7,ANDHIERARCHICALCONTROLLERSUSEDINSIMULATIONS
Observingthat andsetting ,
onecanrewrite(20)as
(21)
Wereplacethisre-initializationformulawiththefollowingone:
(22)
whichisequivalentto(20)providedthat Fig.3. ModelofFurutapendulumwithzerooffset([43]).
. This holds true under the hypothesis that the system is at
steady-state before the switch. Indeed, using the definition of
andanuncertainschedulermodel.AconditioningMarkovchain
and Woodbury’s matrix inversion lemma, it is straightfor-
solvingtheOSPandROSPproblems,respectively,isobtained
wardtoprovethat .Ifthesystemisnot
which satisfies the 1-step average contractivity condition. The
exactlyatsteady-stateat ,butthereferenceisvaryingslowly,
second example illustrates application of -step average con-
thedifference issmallandapplicationofthe
tractivesolutionstotheOSPproblem,andtheeffectivenessof
twoformulaswillslightlydiffer.
the proposed bumpless transfer technique to track piecewise-
Fromacomputationalviewpoint,thisre-initializationscheme
constant references. In both cases, the unit delay between the
introduces negligible overhead, because matrices can be
output sampling instant and the application of the control ac-
easilypre-computed,and(22)needstobeevaluatedonlyonce
tionhasbeenexplicitlyconsidered.
when a low-to-high transition occurs for the reactivated con-
Forthesakeofbrevity,intheexamplesweconsideradeter-
trollers.However,forthesakeofASstabilityanalysis,itisin-
ministicWCETmodelofcontrollerexecutiontime,sothat,in
strumentaltoconsideranequivalentsystemwhereallsleeping
the light of Remark 2, the process is described by a FSHIA
statesarere-initializedateverytimeinstantas
Markov chain. The same transition probability matrix of the
nominal scheduler process will be assumed in both examples,
which is
(the re-initialization of states clearly has no effect on the
closed-loop system until they remain inactivated). Therefore,
(24)
theclosed-loopmatrices havethesamestructure
asin(16),(17)and(18),butwith(19)replacedby
Thecorrespondingsteady-stateprobabilitydistributionisgiven
(23) by .
In the application of the contractivity condition for solving
Inconclusion,thesolutionoftheOSP(ROSP)problemwith
(R)OSPproblems,asuitablechoiceoftheadoptedmatrixnorm
matricescomputedasin(16),(17),(18),and(23),providesthe
canconsiderablyhelp.Inourexamplesweusethemethodpro-
(robust)optimalswitchingpolicyfortheintendedcontrollerhi-
posedby[32]tochooseavectornorm andinduced
erarchy ,whilealsoguaranteeingASstabilityofthebumpless
matrixnorm ,where isanon-singularma-
transfertechnique(22).
trixsatisfyingtheconditionthat suchthat
(thisconditiongeneralizesdirectlytothemultistepproblem).
VIII. EXAMPLES Example 1 (One-Step Contractivity With Robustness): A
The control of two mechanical systems will be used to il- model of Furuta pendulum with zero offset ([43]) is depicted
lustrate the application of the proposed technique. In the first inFig. 3and its sampled-time linearized dynamics is reported
example we consider a regulation problem for both a nominal inTableII.WithreferencetotheconnectionschemeinFig.2,
Description:Modern multitasking Real-Time Operating Systems. (RTOSs), running, e.g., on . algorithms for switched system stabilization (such as e.g.,. [19]–[22])