RELIABLE SOFTWARE TECHNOLOGIESRELIABLE SOFTWARE TECHNOLOGIESADAADA--EUROPE 2010EUROPE 2010
Control Co-design: Algorithms and Control Co-design: Algorithms and g gtheir Implementation
g gtheir Implementation
P. Albertos, A. P. Albertos, A. CrespoCrespo, J. , J. SimóSimóDpt. Dpt. IngIng. de . de SistemasSistemas y y AutomáticaAutomática
I iI i dd A á iA á i I f á iI f á i I d i lI d i l
P. AlbertosP. Albertos A. A. FernándezFernándezDpt. Dpt. AutomáticaAutomática y y ComputaciónComputación
C A b C bC A b C bInstitutoInstituto de de AutomáticaAutomática e e InformáticaInformática IndustrialIndustrialUniversidad Universidad PolitécnicaPolitécnica de Valenciade Valencia
[email protected]@aii.upv.es
CUJAE, Habana. CubaCUJAE, Habana. [email protected]@electrica.cujae.edu.cu
VALENCIA, SPAIN, VALENCIA, SPAIN, 1414--18 18 JUNE JUNE 20102010
Thanks to:Thanks to:n
Thanks to:Thanks to:m
enta
tion My My CoCo--workers workers ::
KarlKarl--Erik Erik ÅrzénÅrzénMy My CoCo--authorsauthors::AlfonsAlfons CrespoCrespo
heir
Impl
em
AntonAnton CervinCervinJosé José SimóSimóAdelAdel FernándezFernández
hms a
nd th Marina VallésMarina Vallés
AngelAngel ValeraValera
n: A
lgor
ith Raúl Raúl SimarroSimarroPatricia Patricia BalbastreBalbastre
l Co-
desi
gn
Pedro GarcíaPedro García
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
MotivationMotivationn
human/machine
MotivationMotivationm
enta
tion
monitoredvariables
referencevariables
machineinterfaceClassical control loopClassical control loop
Control
heir
Impl
em
measuredvariablesControl
variables information flow
Controlsystem
hms a
nd th
sensorsMass transfer &
energy flowinformation flow
actua-
n: A
lgor
ith
sensorsenergy convertertors
l Co-
desi
gn
energysupply
energycon-
sumer
auxiliaryenergysupply
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
mechanicalhydraulicthermal
electrical
MotivationMotivationn
human/machine
MotivationMotivationm
enta
tion
monitoredvariables
referencevariables
machineinterfaceClassical control loopClassical control loop
i f ti
heir
Impl
em
measuredvariablesControl
variables information flow
informationprocessing
hms a
nd th
sensorsMass transfer &
energy flowinformation flow
actua-
Basic DT ControllerBasic DT Controller
n: A
lgor
ith
sensorsenergy convertertors
l Co-
desi
gn
energysupply
energycon-
sumer
auxiliaryenergysupply
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
mechanicalhydraulicthermal
electrical
Basic Control LoopBasic Control Loopn
Basic Control LoopBasic Control Loopm
enta
tion
f rk Regulator
heir
Impl
em
ControlAlgorithm
D/A
referencer(t) uk
yk
rkA/DRegulator
hms a
nd th A/D Algorithmk
DTDT
n: A
lgor
ith
y(t) u(t)CT
DTDT
l Co-
desi
gn Sensor ActuatorProcess
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Disturbance
Control System Development TodayControl System Development Todayn
Control System Development TodayControl System Development Todaym
enta
tion
heir
Impl
emhm
s and
thn:
Alg
orith
l Co-
desi
gnC
ontr
ol
© P. Albertos, 2010© P. Albertos, 2010
RegulatorRegulatorn
RegulatorRegulatorm
enta
tion Control viewpoint: Control viewpoint:
Signal processorSignal processor RegulatorRegulator
heir
Impl
em
Dynamic behaviorDynamic behaviorProcess interactionProcess interaction
RegulatorRegulatoruu yy
hms a
nd th
Computer viewpoint: Computer viewpoint:
rr
n: A
lgor
ith
p pp pSet of tasksSet of tasksResourceResource allocationallocation RegulatorRegulator
l Co-
desi
gn
RT constraintsRT constraints
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
ProblemsProblemsn
ProblemsProblemsm
enta
tion
The control engineer does not care about implementationsThe control engineer does not care about implementations
heir
Impl
em “trivial”“trivial”“buy a faster computer”“buy a faster computer”
hms a
nd th The software engineer does not understand controller The software engineer does not understand controller
timingtiming
n: A
lgor
ith
gg“ = (T“ = (Tii, D, Dii, C, Cii)”)”“hard deadlines”“hard deadlines”
iτ
l Co-
desi
gn
Control theory and realControl theory and real--time scheduling theory have time scheduling theory have evolved as separate subjects for thirty yearsevolved as separate subjects for thirty years
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
evolved as separate subjects for thirty yearsevolved as separate subjects for thirty years
OutlineOutlinen
OutlineOutlineIntroduction: Basic Digital ControlIntroduction: Basic Digital Control
men
tatio
n ggMain assumptions, Main concernsMain assumptions, Main concerns
Computing requirements for control applicationsComputing requirements for control applications
heir
Impl
em Computing requirements for control applicationsComputing requirements for control applicationsControl requirements for RT implementationControl requirements for RT implementationNew control scenariosNew control scenarios
hms a
nd th
New control scenariosNew control scenariosEmbedded, networked, eventEmbedded, networked, event--drivendriven
Algorithmic issuesAlgorithmic issues
n: A
lgor
ith
ggAsynchronous sampling, Delays, Control effortAsynchronous sampling, Delays, Control effortHybrid systemsHybrid systems
l Co-
desi
gn Implementation issuesImplementation issuesControl KernelControl Kernel
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
ConclusionsConclusions
IntroductionIntroductionn
IntroductionIntroductionm
enta
tion Digital control comes from SD ControlDigital control comes from SD Control
Discretization of CT controllersDiscretization of CT controllers
heir
Impl
em
Control is applied to CT plants Control is applied to CT plants Plants are discretized for control design purposesPlants are discretized for control design purposes
hms a
nd th DC implies plant in open loop between samplingsDC implies plant in open loop between samplings
DC is implemented in ComputersDC is implemented in Computers
n: A
lgor
ith Controller is no more one single deviceController is no more one single deviceSerial operation Serial operation –– Tasks conflictsTasks conflicts
l Co-
desi
gn
Sharing resourcesSharing resourcesControl design Control design implementationimplementation
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
gg pp
Basic Digital ControlBasic Digital Controln
Basic Digital ControlBasic Digital Controlm
enta
tion
The plant is without control between sampling/updatingThe plant is without control between sampling/updatingSampling and updating should be as fast as possibleSampling and updating should be as fast as possible
heir
Impl
em Sampling and updating should be as fast as possibleSampling and updating should be as fast as possibleControl is computed (updated) periodicallyControl is computed (updated) periodicallyC t l t kC t l t k
hms a
nd th Control task Control task
parameters are stored in the memoryparameters are stored in the memoryt l l i lit l l i li
n: A
lgor
ith control law sequence is cycliccontrol law sequence is cycliccontrol law is validated in CT operationcontrol law is validated in CT operation
P t d t iblP t d t ibl
l Co-
desi
gn Past data are accessible Past data are accessible Communication channels are continuously operatingCommunication channels are continuously operating
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
DT controller emulates CT controllerDT controller emulates CT controller
Real Time Task modelReal Time Task modeln
Real Time Task modelReal Time Task modelm
enta
tion A task (TA task (Tkk) is defined by four parameters:) is defined by four parameters:
CCkk: Worst Case Execution Time (WCET): Worst Case Execution Time (WCET)Ck
heir
Impl
em
DDkk: Deadline: Deadline
PPkk: Period: Period
Ck
hms a
nd th ΦΦκκ:: PhasePhase Pk
DkΦk
n: A
lgor
ith
k
Computation timeCk 3 C1 + C2 + C4 = Ck
Jitter on input Jitter on output
l Co-
desi
gn
Tt
Taskk 1 2 41 23
4C1 + C2 + C4 Ck
5
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
kT
Period
Deadline
Phase
Control Loop TimingControl Loop Timingn
Control Loop TimingControl Loop Timingm
enta
tion
•• Classical control assumes deterministic samplingClassical control assumes deterministic samplingi t i dii t i di
heir
Impl
em –– in most cases periodicin most cases periodic•• Classical Classical control assumes negligible or constant inputcontrol assumes negligible or constant input--output output
latency (from sampling to actuation )latency (from sampling to actuation )
hms a
nd th latency (from sampling to actuation )latency (from sampling to actuation )
–– if the latency is small compared to the sampling interval it can if the latency is small compared to the sampling interval it can be ignoredbe ignored
n: A
lgor
ith be ignoredbe ignored–– if the latency is constant it can be included in the control designif the latency is constant it can be included in the control design
too long latency or too much latency jitter give poortoo long latency or too much latency jitter give poor
l Co-
desi
gn –– too long latency or too much latency jitter give poor too long latency or too much latency jitter give poor performance or instabilityperformance or instability
•• Not always possible to achieve with limited computing resourcesNot always possible to achieve with limited computing resources
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Not always possible to achieve with limited computing resources Not always possible to achieve with limited computing resources that are shared with other applicationsthat are shared with other applications
Sampling rate selectionSampling rate selectionn
Sampling rate selectionSampling rate selection
Regular Sampling:Regular Sampling: Influences and is determined by desired closed loopInfluences and is determined by desired closed loop
men
tatio
n Regular Sampling: Regular Sampling: Influences and is determined by desired closed loop Influences and is determined by desired closed loop performanceperformance
Fast sampling converges to CT but …Fast sampling converges to CT but …
heir
Impl
em Computation load increases, Computation load increases, Numerical errorsNumerical errorsSame sampling rate for all processes?Same sampling rate for all processes?
MultirateMultirate controllerscontrollers
hms a
nd th MultirateMultirate controllerscontrollers
Control computation is not required anytime: Control computation is not required anytime: EventEvent based control Hybrid controlbased control Hybrid control
n: A
lgor
ith EventEvent--based control, Hybrid controlbased control, Hybrid control
Classical control assumes negligible or constant inputClassical control assumes negligible or constant input--output delaysoutput delays
l Co-
desi
gn
p yp ysmall delays can be ignored, included in the control designsmall delays can be ignored, included in the control designdifficult to predict the required time (WCET)difficult to predict the required time (WCET)
WARNINGSWARNINGS
Con
trol
© P. Albertos, © P. Albertos, 20102010
WARNINGSWARNINGSlong sampling interval or delay may cause poor performance or instability …long sampling interval or delay may cause poor performance or instability …Resources infraResources infra--useuse
Main Concerns in Computer ControlMain Concerns in Computer Controln
Main Concerns in Computer ControlMain Concerns in Computer Controlm
enta
tion Unavoidable delays between sampling & updatingUnavoidable delays between sampling & updating
Sampling period may be changedSampling period may be changed
heir
Impl
em
Signal transmission may be delayed (or missing)Signal transmission may be delayed (or missing)Time sequencing may depend on other tasksTime sequencing may depend on other tasks
hms a
nd th Additional tasks may change the allocated resources: Additional tasks may change the allocated resources:
computation time, memory, data accesscomputation time, memory, data access
n: A
lgor
ith as a result as a result Non conventional sampling/updating patternNon conventional sampling/updating pattern
l Co-
desi
gn
Delays and missing dataDelays and missing dataModes and sampling rate changes (alternatives)Modes and sampling rate changes (alternatives)
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Modes and sampling rate changes (alternatives)Modes and sampling rate changes (alternatives)EventEvent--based controlbased control
ApplicationsApplicationsn
ApplicationsApplicationsm
enta
tion
Automotive IndustryAutomotive IndustryMany, distributedMany, distributed
heir
Impl
em y,y,
hms a
nd th
Aerospace and Fly ControlAerospace and Fly Control
n: A
lgor
ith Safety, reliabilitySafety, reliability
l Co-
desi
gn
Industrial ProcessesIndustrial ProcessesMM ff iff i
Con
trol
© P. Albertos, © P. Albertos, 20102010
Many many, costMany many, cost--effectiveeffective
Computer-based controlComputer-based controln
Computer based controlComputer based controlm
enta
tion
heir
Impl
em
face
face
hms a
nd th
ProcessProcessComputerComputer
nter
fnt
erf
n: A
lgor
ith InIn
l Co-
desi
gnC
ontr
ol
© P. Albertos, 2010© P. Albertos, 2010
Control loop implementationControl loop implementationn
p pp pm
enta
tion
SpecificationSpecification
heir
Impl
em SpecificationSpecification
hms a
nd th
n: A
lgor
ithl C
o-de
sign ComputationComputation
Con
trol
© P. Albertos, © P. Albertos, 20102010
Computer Control TaskComputer Control Taskn
Computer Control TaskComputer Control Task
I iti li tiI iti li ti
men
tatio
n InitializationInitialization……
looploop
heir
Impl
em
convert _sensor _analog_ digital (y); read reference (r);convert _sensor _analog_ digital (y); read reference (r);compute _control _action (u); compute _control _action (u);
hms a
nd th compute _error (e)compute _error (e)
compute _control _action (u) compute _control _action (u)
n: A
lgor
ith send _ converted _ control_ action (u); send _ converted _ control_ action (u); update_internal_variablesupdate_internal_variables (y,u, …); (y,u, …);
l Co-
desi
gn Next _Iteration:= Next _Iteration + Period; Next _Iteration:= Next _Iteration + Period; delay until Next _Iteration;delay until Next _Iteration;
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
end loop;end loop;……
Computing Requirementsf l li iComputing Requirementsf l li i
n
for Control Applicationsfor Control Applicationsm
enta
tion
To have a quick an secure dispatch of a control actionTo have a quick an secure dispatch of a control action
heir
Impl
em
To get a basic “picture” of the current situationTo get a basic “picture” of the current situation
T i l d f l i b i dT i l d f l i b i d
hms a
nd th To compute a simple and fast control action to be improved To compute a simple and fast control action to be improved
if resources are availableif resources are available
n: A
lgor
ith
To switch to the appropriate control mode, based on the To switch to the appropriate control mode, based on the resources availabilityresources availability
l Co-
desi
gn
yy
To reconfigure under detected faultsTo reconfigure under detected faults
Con
trol
© P. Albertos, © P. Albertos, 20102010
Some RT OptionsSome RT Optionsn
Some RT OptionsSome RT Options
SubSub--task modelstask models
men
tatio
n SubSub--task modelstask modelsSample & deliver, compute, refineSample & deliver, compute, refine
Imprecise task modelImprecise task model
heir
Impl
em Imprecise task modelImprecise task modelmandatory + optional partmandatory + optional part
i l i h l i l ii l i h l i l i
hms a
nd th anytime algorithms or multiple versionsanytime algorithms or multiple versions
only applicable to control in special casesonly applicable to control in special cases
n: A
lgor
ith Alternatives for deadline overruns?Alternatives for deadline overruns?Continue with the computations of the controller jobContinue with the computations of the controller job
l Co-
desi
gn
p jp jAbort the job (lost sample Abort the job (lost sample doubled samp. interval)doubled samp. interval)Postpone remaining computations until the beginningPostpone remaining computations until the beginning
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Postpone remaining computations until the beginning Postpone remaining computations until the beginning of the next sample (increased latency)of the next sample (increased latency)….….
New Trends in Control ImplementationNew Trends in Control Implementationn
New Trends in Control ImplementationNew Trends in Control Implementationm
enta
tion RT Operating SystemRT Operating System
RT MiddlewareRT Middleware
Secure Systems and isolation. Secure Systems and isolation. Hypervisor SystemHypervisor System
Dynamic load managementDynamic load management
heir
Impl
em
Communication SystemsCommunication SystemsDDSDDS
QoSQoS management according management according to the to the QoCQoC observed (Quality observed (Quality
of Control)of Control)
hms a
nd th Virtual machinesVirtual machines
Objects and AgentsObjects and Agents
of Control)of Control)
Distributed execution Distributed execution environments.environments.
n: A
lgor
ith Control MiddlewareControl MiddlewareLocal, emergency, switchingLocal, emergency, switching
environments.environments.Physical MetaphorPhysical Metaphor
Environment where control Environment where control
l Co-
desi
gn services are provided.services are provided.Control MetaphorControl Metaphor
Con
trol
© P. Albertos, © P. Albertos, 20102010
Control requirements for RT implementations: Basic AssumptionsControl requirements for RT implementations: Basic Assumptions
nimplementations: Basic Assumptionsimplementations: Basic Assumptions
men
tatio
n The Data Acquisition system provides the required dataThe Data Acquisition system provides the required dataThe actuators’ drivers deliver the control actionsThe actuators’ drivers deliver the control actions
heir
Impl
em
The CPU is fully available for the control taskThe CPU is fully available for the control taskThe CPU computes onThe CPU computes on--time (no errors) the control actiontime (no errors) the control action
hms a
nd th
pp ( )( )The required data are stored in the memoryThe required data are stored in the memoryThe sampling pattern is regular (constant synchronousThe sampling pattern is regular (constant synchronous
n: A
lgor
ith The sampling pattern is regular (constant, synchronous The sampling pattern is regular (constant, synchronous and uniform for any control task)and uniform for any control task)The control algorithm is well definedThe control algorithm is well defined
l Co-
desi
gn The control algorithm is well definedThe control algorithm is well definedAlternative controllers are independentAlternative controllers are independentPower supply is guaranteedPower supply is guaranteed
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Power supply is guaranteedPower supply is guaranteed
Control activities’ priorityControl activities’ priorityn
Control activities priorityControl activities prioritym
enta
tion
Backup CA CAuser
bu
kr
heir
Impl
em
kvkuCACA
hms a
nd th
Plantdelivcomputation
x y
n: A
lgor
ith kx
kmky
DA
l Co-
desi
gn
Safe operation in any condition
Con
trol
© P. Albertos, © P. Albertos, 20102010
Safe operation in any condition
Control activities’ priorityControl activities’ priorityn
Control activities priorityControl activities priority
Ensure control action (CA) deliveringEnsure control action (CA) delivering
men
tatio
n Ensure control action (CA) deliveringEnsure control action (CA) deliveringSafe (backSafe (back--up) CA computationup) CA computationSafe CA computation based on previous dataSafe CA computation based on previous data
heir
Impl
em p pp pData acquisition of major signalsData acquisition of major signals
Safe CA computation based on current dataSafe CA computation based on current data
hms a
nd th
ppTransfer to new control structureTransfer to new control structure
Basic control structure parameters computationBasic control structure parameters computation
n: A
lgor
ith CA computation CA computation
Full DA Full DA
l Co-
desi
gn
Control Control structuresstructures evaluation and selectionevaluation and selectionCA computation (different levels)CA computation (different levels)
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
p ( )p ( )Communication facilitiesCommunication facilitiesCoordination facilitiesCoordination facilities
Highest priorityHighest priorityn
Highest priorityHighest prioritym
enta
tion
Control action deliveringControl action deliveringDetect missing dataDetect missing data
heir
Impl
em Detect missing dataDetect missing dataEvaluate control performanceEvaluate control performanceE l t lt ti t l tiE l t lt ti t l ti
hms a
nd th Evaluate alternative control optionsEvaluate alternative control options
Determine the best CADetermine the best CA
n: A
lgor
ith Detect faulty conditionsDetect faulty conditionsChange the operating modeChange the operating mode
l Co-
desi
gn Compute backCompute back--up signalsup signals
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Influence on Control PerformanceInfluence on Control PerformancenScheduling &Scheduling & C lC l
men
tatio
nScheduling &Scheduling &NetworkNetwork
ParametersParametersTask TimingTask TimingParametersParameters
ControlControlPerformancePerformance
( i i i( i i i
heir
Impl
em ParametersParameters(T,D,Prio, (T,D,Prio,
Protocol )Protocol )
ParametersParameters(latencies, jitter, …)(latencies, jitter, …) (variance, rise time, (variance, rise time,
overshoot, ….)overshoot, ….)
hms a
nd th
In general:In general:
Protocol,…)Protocol,…)Complex relationshipComplex relationship Complex relationshipComplex relationship
n: A
lgor
ith sampling jitter has a negative effect on performancesampling jitter has a negative effect on performancea short latency is better than a long latencya short latency is better than a long latencylatency jitter is bad, but a short jittery latency is in most cases better latency jitter is bad, but a short jittery latency is in most cases better
l Co-
desi
gn
y j j y yy j j y ythat a longer constant latency, also if the latter is compensated forthat a longer constant latency, also if the latter is compensated for
However, anomalies existsHowever, anomalies existssampling jitter may improve performancesampling jitter may improve performance
Control Effort ConceptControl Effort Concept
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
sampling jitter may improve performancesampling jitter may improve performancelatency can sometimes have a stabilizing effectlatency can sometimes have a stabilizing effecta shorter varying latency can be worse than a longer constant latencya shorter varying latency can be worse than a longer constant latency
Performance degradingPerformance degradingn
Performance degradingPerformance degradingm
enta
tion
The maximum allowable time delay is given by the The maximum allowable time delay is given by the phase margin derived from the frequency analysis ofphase margin derived from the frequency analysis of
heir
Impl
em phase margin, derived from the frequency analysis of phase margin, derived from the frequency analysis of the open loop output feedback controlled systemthe open loop output feedback controlled systemTheThe Control EffortControl Effort defined as the shift indefined as the shift in
hms a
nd th The The Control EffortControl Effort, defined as the shift in , defined as the shift in
damping from the open loop poles to the closed damping from the open loop poles to the closed loop poles provides a useful way to obtain theloop poles provides a useful way to obtain the
n: A
lgor
ith loop poles, provides a useful way to obtain the loop poles, provides a useful way to obtain the maximum allowable time delay, for both, maximum allowable time delay, for both, continuous and discrete systemscontinuous and discrete systems
l Co-
desi
gn continuous and discrete systems.continuous and discrete systems.The longer the sampling period T is, the more The longer the sampling period T is, the more
i i h i d l h d i ii i h i d l h d i i
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
sensitive to the time delay the design is.sensitive to the time delay the design is.
MIMO controlled plant:Signals relevanceSignals relevanceMIMO controlled plant:Signals relevanceSignals relevancen
men
tatio
n
yiujProcess
)()( K
heir
Impl
em
H ....
)()( tKxtu =
hms a
nd th Hj
.... .... ........ Si
n: A
lgor
ith
⎤⎡ k
vj ziControl
l Co-
desi
gn
[ ]⎥⎥⎥⎤
⎢⎢⎢⎡
==kk
kkkK L 2
1
21ref
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
[ ]⎥⎥
⎦⎢⎢
⎣ k
kkkK
m
nM
21
Reactor: modelReactor: modeln
Reactor: modelReactor: modelm
enta
tion
; 216.89-200.3020.928.71-23.088
00.2519- 1.705-
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡=A
heir
Impl
em
415.29-0
028.6-0 2.918
⎥⎥⎥
⎦
⎤
⎢⎢⎢
⎣
⎡=
⎦⎣
B
hms a
nd th
⎦⎣
n: A
lgor
ithl C
o-de
sign
[ ] [ ]
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
[ ] [ ]TjT
ja FFuTTCx == ;
Reactor: controlReactor: controln
Reactor: controlReactor: controlm
enta
tion
{ } { } { }987.236,73.7,5878.2)( −−−== Aeigai 3.247−=nA
C l G lC l G l {{ 320320 340340 360360}}
heir
Impl
em Control Goal: Control Goal: pp = {= {--320320, , --340340, , --360360} ; } ; PPnn= = --10201020
⎤⎡
hms a
nd th
..⎥⎦
⎤⎢⎣
⎡−−−
=5505.02238.4463.40
6683.45676.685.858K
AA FF ti dti d FF
n: A
lgor
ith Assume Assume FF active and active and FFjj open open
{ } { };5.49,1.336,7.405).( 11 −−−=− kbAeig 4.7912 −=→ S
l Co-
desi
gn
7.2282 =− nPS{ } { };,,)( 11g 2
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Give highest priority to most degrading signal failure Give highest priority to most degrading signal failure
New Control ScenariosNew Control Scenariosn
New Control ScenariosNew Control Scenariosm
enta
tion
E b dd d C l SE b dd d C l S
heir
Impl
em Embedded Control SystemsEmbedded Control Systems
hms a
nd th Networked Control SystemsNetworked Control Systems
n: A
lgor
ith
NonNon--regular sampling regular sampling EventEvent--driven controldriven control
l Co-
desi
gnC
ontr
ol
© P. Albertos, 2010© P. Albertos, 2010
Embedded systemsEmbedded systemsn
men
tatio
nhe
ir Im
plem
hms a
nd th
n: A
lgor
ithl C
o-de
sign
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Embedded systemsEmbedded systemsn
men
tatio
nhe
ir Im
plem
hms a
nd th
n: A
lgor
ithl C
o-de
sign
Control is present in 99% of the Control is present in 99% of the embedded applicationsembedded applications
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
embedded applicationsembedded applications
Embedded systemsEmbedded systemsn
Embedded systemsEmbedded systemsm
enta
tion Device:Device:
StandStand--alonealone
heir
Impl
em
NetworkedNetworkedRT operationRT operation
hms a
nd th ES:ES:
Compact and reduced size Compact and reduced size A tA t
n: A
lgor
ith AutonomyAutonomyMissing data operationMissing data operationFaultFault toleranttolerant
l Co-
desi
gn DEVICEFaultFault--toleranttolerantReconfigurabilityReconfigurabilitySafetySafety
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
SafetySafetyEmbedded control systemsEmbedded control systems
Embedded systemsEmbedded systemsn
yym
enta
tion Information processing systems embedded into a larger Information processing systems embedded into a larger
productproduct
heir
Impl
em
Main purpose of the product is Main purpose of the product is notnot information information processingprocessing
hms a
nd th Must be Must be
DependableDependable
n: A
lgor
ith DependableDependableEfficientEfficient
l Co-
desi
gn Interactive with its environmentInteractive with its environmentRT constrainedRT constrained
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
RT constrainedRT constrainedApplication orientedApplication oriented
ES Ch llES Ch lln
ES ChallengesES Challenges
M i i f E b dd dM i i f E b dd d S fS f
men
tatio
n Main issues refer to Embedded Main issues refer to Embedded SoftwareSoftware(not microelectronics / mechatronics)(not microelectronics / mechatronics)
heir
Impl
em Most requirements / applications involve Most requirements / applications involve controlcontrolReactive systemsReactive systems
hms a
nd th
yyRT constraintsRT constraintsEnergy consumptionEnergy consumption
n: A
lgor
ith
Energy consumptionEnergy consumptionEnvironmental adaptationEnvironmental adaptationES controlES control
l Co-
desi
gn ES controlES controlPure control Pure control applicationsapplications
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Strong interaction: control and its SW implementationStrong interaction: control and its SW implementation
Embedded Control SystemsEmbedded Control Systemsn
Embedded Control SystemsEmbedded Control Systemsm
enta
tion Embedded systems with:Embedded systems with:
hard RT constraintshard RT constraints
heir
Impl
em
guarantee of safe operationbest possible performances
hms a
nd th best possible performances
Additional issues from viewpoint of:Additional issues from viewpoint of:
n: A
lgor
ith implementationimplementationcomputationcomputation
l Co-
desi
gn
ppalgorithmicalgorithmic
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
ECSECSn
ECSECSm
enta
tion
heir
Impl
em
ComputerControl under
hms a
nd th
pRT issues
under uncertaintyECS
n: A
lgor
ith
NetworkedSystems
l Co-
desi
gnC
ontr
ol
© P. Albertos, 2010© P. Albertos, 2010
Embedded Control CharacteristicsEmbedded Control Characteristicsn
Embedded Control CharacteristicsEmbedded Control Characteristicsm
enta
tion What distinguishes embedded control?What distinguishes embedded control?
Limited computing and communication resourcesLimited computing and communication resources
heir
Impl
em
Often massOften mass--market products, market products, e.ge.g, automobiles, automobilesCPU time, communication bandwidth, memory, energy, …CPU time, communication bandwidth, memory, energy, …
hms a
nd th Autonomous operationAutonomous operation
No human ”operator”No human ”operator”
n: A
lgor
ith
ppComplex functionalityComplex functionalityOften large amounts of softwareOften large amounts of software
l Co-
desi
gn
ggNeed for formal approachesNeed for formal approachesNeed for design methodologyNeed for design methodology
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
g gyg gy
Networked Control SystemsNetworked Control Systemsn
Networked Control SystemsNetworked Control Systemsm
enta
tion
heir
Impl
emhm
s and
thn:
Alg
orith
l Co-
desi
gn
Networked Control SystemsNetworked Control Systems
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Networked Control SystemsNetworked Control Systems
N k d C l SN k d C l Sn
Networked Control SystemsNetworked Control Systemsm
enta
tion
11 Identification of control tasks and mapping betweenIdentification of control tasks and mapping between
Basic Approach:Basic Approach:
heir
Impl
em 11. Identification of control tasks and mapping between . Identification of control tasks and mapping between tasks and processing nodes.tasks and processing nodes.
After this mapping the worst case execution time (WCET) of each taskAfter this mapping the worst case execution time (WCET) of each task
hms a
nd th After this mapping, the worst case execution time (WCET) of each task After this mapping, the worst case execution time (WCET) of each task
can be computed as resulting from the target processing architecture.can be computed as resulting from the target processing architecture.
22. Identification of shared information and bus scheduling.. Identification of shared information and bus scheduling.
n: A
lgor
ith
22. Identification of shared information and bus scheduling. . Identification of shared information and bus scheduling. Once the bus access protocols and scheduling have been determined the Once the bus access protocols and scheduling have been determined the worst case for communication delays can be obtained.worst case for communication delays can be obtained.
l Co-
desi
gn 33. Tasks scheduling for each node. . Tasks scheduling for each node. If some task cannot meet its deadline, return to Step If some task cannot meet its deadline, return to Step 1 1 and reassigand reassignn tasks tasks
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
to nodes.to nodes.
N k d C l SN k d C l Sn
Networked Control SystemsNetworked Control Systemsm
enta
tion
1 Off1 Off line schedulingline scheduling too rigid and not optimaltoo rigid and not optimal
DrawbacksDrawbacks
heir
Impl
em 1. Off1. Off--line scheduling line scheduling too rigid and not optimaltoo rigid and not optimalNeighbor nodes, memory overNeighbor nodes, memory over--consumption. consumption. Control problems in switching between nodes.Control problems in switching between nodes.
hms a
nd th
Control problems in switching between nodes.Control problems in switching between nodes.
2. Resources infra2. Resources infra--utilizationutilizationEverything should be scheduled for the worst case condition withEverything should be scheduled for the worst case condition with
n: A
lgor
ith
Everything should be scheduled for the worst case condition, with Everything should be scheduled for the worst case condition, with random and multiple switchingrandom and multiple switching
3. Control delays over estimation. 3. Control delays over estimation.
l Co-
desi
gn
yyControl algorithms should be design for the longest communication delay,Control algorithms should be design for the longest communication delay,
not being able to change under switching.not being able to change under switching.
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
… and Improvements: under development!… and Improvements: under development!
Event-driven controlEvent-driven controln
Event driven controlEvent driven controlm
enta
tion
heir
Impl
emhm
s and
thn:
Alg
orith
EventEvent--driven as opposite to timedriven as opposite to time--driven:driven:Event generator (regular sampling data)Event generator (regular sampling data)
l Co-
desi
gn Event generator (regular sampling data)Event generator (regular sampling data)Event processor (data preprocessor)Event processor (data preprocessor)Control action generator (controller)Control action generator (controller)
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
E D i C lE D i C ln
Event-Driven ControlEvent-Driven Controlm
enta
tion
Natural in networked embedded systemsNatural in networked embedded systems
heir
Impl
em describes the reality (e.g., networked control loops)describes the reality (e.g., networked control loops)a possible modeling formalism for analyzing jittera possible modeling formalism for analyzing jitter
hms a
nd th
p g y g jp g y g jMode changesMode changesDiscrete (binary sensors)Discrete (binary sensors)
n: A
lgor
ith Discrete (binary sensors)Discrete (binary sensors)Can it be combined with Can it be combined with aperiodicaperiodic schedulabiliyschedulabiliy theory?theory?
l Co-
desi
gnC
ontr
ol
© P. Albertos, 2010© P. Albertos, 2010
Event-driven controlEvent-driven controln
men
tatio
nhe
ir Im
plem
hms a
nd th
F
n: A
lgor
ith F
l Co-
desi
gn
θ
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Networked Embedded Control TimingNetworked Embedded Control Timingn
Networked Embedded Control TimingNetworked Embedded Control Timingm
enta
tion
heir
Impl
em
b dd d l f i li lb dd d l f i li l d i id i i
hms a
nd th Embedded control often implies temporal nonEmbedded control often implies temporal non--determinismdeterminism
resource sharing resource sharing preemptions blocking varying computation times nonpreemptions blocking varying computation times non--deterministicdeterministic
n: A
lgor
ith
preemptions, blocking, varying computation times, nonpreemptions, blocking, varying computation times, non deterministic deterministic kernel primitives, …kernel primitives, …
Networked control often implies temporal nonNetworked control often implies temporal non--determinismdeterminism
l Co-
desi
gn network interface delay, queuing delay, transmission delay, propagation network interface delay, queuing delay, transmission delay, propagation delay, link layer resending delay, transport layer ACK delay, ...delay, link layer resending delay, transport layer ACK delay, ...lost packetslost packets
Con
trol
© P. Albertos, 2010© P. Albertos, 2010How should we handle this?How should we handle this?
Design ApproachesDesign Approachesn
Design ApproachesDesign Approaches
SeparationSeparation--ofof--concernsconcerns
men
tatio
n SeparationSeparation--ofof--concernsconcernsTimeTime--triggered approachestriggered approachesSimple, deterministic, dependability, …Simple, deterministic, dependability, …
Control ConcernsControl Concerns
heir
Impl
em
p , , p y,p , , p y,But, difficult to achieve in practice due toBut, difficult to achieve in practice due to
Lack of resourcesLack of resourcesI iI i
hms a
nd th Incorrect assumptionsIncorrect assumptions
Technology incompatibilityTechnology incompatibility
IntegrationIntegration
Computing & Computing & CommunicationCommunication
ConcernsConcerns
n: A
lgor
ith
IntegrationIntegrationOptimize performance subject to limited resourcesOptimize performance subject to limited resourcesCodesign of control computing and communicationCodesign of control computing and communication
l Co-
desi
gn Temporal robustness analysis techniquesTemporal robustness analysis techniquesImplementationImplementation--aware control techniquesaware control techniquesControlControl--aware computing and communication techniquesaware computing and communication techniques
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
ControlControl--aware computing and communication techniquesaware computing and communication techniquesNew analysis and design toolsNew analysis and design tools
ECS DesignECS Designn
ggm
enta
tion
Taking into account resources constraints
(d l i i d t h i th i d )
heir
Impl
em (delays, missing data, changes in the period …)
the goal of the temporal design methods is to
hms a
nd th
g p g
maintain/maximize the control performance :
n: A
lgor
ith Maximize the time determinismMaximize the time determinismRobust DesignRobust Design
l Co-
desi
gn Active Robust designActive Robust designPrioritize control subtasks: Control KernelPrioritize control subtasks: Control Kernel
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
RT constraintsRT constraintsn
RT constraintsRT constraints
E i l ithE i l ith
men
tatio
n Economic algorithmsEconomic algorithmsOptional tasks Optional tasks
heir
Impl
em
ppHybrid systems Hybrid systems CPU d i i iCPU d i i i
hms a
nd th CPU use measurement and optimisationCPU use measurement and optimisation
OnOn--line schedulingline scheduling
n: A
lgor
ith
ggMemory saving Memory saving
l Co-
desi
gn Economic hardware redundancyEconomic hardware redundancyFault detection and isolationFault detection and isolation
Con
trol
© P. Albertos, © P. Albertos, 20102010
Fault detection and isolationFault detection and isolation
Control algorithm designControl algorithm design
Models, signals and controllersModels, signals and controllersn
, g, g
d d d d ld d d d l
men
tatio
n Reduced order models Reduced order models NonNon--conventional sampling and updating patternsconventional sampling and updating patterns
heir
Impl
em
Missing data controlMissing data controlEventEvent--triggered controltriggered control
hms a
nd th Decision and supervisory controlDecision and supervisory control
Hybrid control systems Hybrid control systems
n: A
lgor
ith Multimode controlMultimode controlSampling rate changesSampling rate changes
F ltF lt t l t t lt l t t l
l Co-
desi
gn FaultFault--tolerant control tolerant control Degraded and backDegraded and back--up (safe) control strategiesup (safe) control strategies
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Battery monitoring and controlBattery monitoring and control
Reduced Order Modeln PP
men
tatio
n ProcessProcess
heir
Impl
em
S1S1KK
hms a
nd th
S2 S3S2 S3S2 S3S2 S3
n: A
lgor
ithl C
o-de
sign
Con
trol
Reduced Order ModelReduced Order Modeln
Reduced Order ModelReduced Order Modelm
enta
tion Model reduction:Model reduction:
Partial control (parts of Partial control (parts of S1
heir
Impl
em the plant)the plant)u y
hms a
nd th
Partial phenomena (fast/slow dynamics)Partial phenomena (fast/slow dynamics)
S2
n: A
lgor
ith -- Partial phenomena (fast/slow dynamics)Partial phenomena (fast/slow dynamics)
[ ] xCC
BxAAx⎥⎤
⎢⎡
⎥⎤
⎢⎡
⎥⎤
⎢⎡⎥⎤
⎢⎡
⎥⎤
⎢⎡ 11112111
l Co-
desi
gn [ ]k
kkkk x
CCuBxAAx ⎥
⎦⎢⎣
=⎥⎦
⎢⎣
+⎥⎦
⎢⎣⎥⎦
⎢⎣
=⎥⎦
⎢⎣ + 2
121
2
1
2
1
2221
1211
12
1 y ;
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
modes slow : modes;fast : 21 xx •• Flexible Flexible armarm•• NavigationNavigation
Reduced Order Models: ExampleReduced Order Models: Examplen
ppm
enta
tion No obstacles: manipulator control
Obstacle detection. Navigation controlFinal position: manipulator control
heir
Impl
em Final position: manipulator control
mEnd
hms a
nd th m
n: A
lgor
ith
ECS
l Co-
desi
gn M
Con
trol
© P. Albertos, © P. Albertos, 20102010
Ini
InterventionsInterventionsn
InterventionsInterventions
BrakingBraking
men
tatio
n BrakingBraking
heir
Impl
em
SteeringSteering
hms a
nd th
n: A
lgor
ith
CombinedCombined
l Co-
desi
gn CombinedCombinedsteering andsteering andbrakingbraking
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
55
ECS: Control Algorithm viewpointECS: Control Algorithm viewpointn
ECS: Control Algorithm viewpointECS: Control Algorithm viewpoint
d d d d ld d d d l
men
tatio
n Reduced order models Reduced order models NonNon--conventional sampling and updating patternsconventional sampling and updating patterns
heir
Impl
em
Missing data controlMissing data controlEventEvent--triggered controltriggered control
hms a
nd th Decision and supervisory controlDecision and supervisory control
Hybrid control systems Hybrid control systems
n: A
lgor
ith Multimode controlMultimode controlSampling rate changesSampling rate changes
F ltF lt t l t t lt l t t l
l Co-
desi
gn FaultFault--tolerant control tolerant control Degraded and backDegraded and back--up (safe) control strategiesup (safe) control strategies
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Battery monitoring and controlBattery monitoring and control
Non-uniform samplingNon-uniform samplingn
Non uniform samplingNon uniform samplingm
enta
tion
YkSampling patternSampling pattern
heir
Impl
em
y1k y2
k yskys
k-1
hms a
nd th kT0 (k+1)T0
u1k u2
k urk
n: A
lgor
ith
Uk
l Co-
desi
gn
Irregular samplingIrregular samplingTi d lTi d l
k
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Time delaysTime delaysRelevance of variablesRelevance of variables
Non- Conventional Sampling & UpdatingNon- Conventional Sampling & Updatingn
Non Conventional Sampling & UpdatingNon Conventional Sampling & Updatingm
enta
tion Non synchronismNon synchronism
Different timingDifferent timingEnvironment
heir
Impl
em
ggCPU sharing &CPU sharing &Communication channelsCommunication channels
ECS
S1 A1
hms a
nd th Communication channels Communication channels
V i bl tiV i bl ti d ld lProcess to
controlSi Ai
n: A
lgor
ith Variable timeVariable time--delaysdelaysDelay counteractionDelay counteraction
B tt
Memory
l Co-
desi
gn Multirate controlMultirate controlCPUBattery
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Small changes in the code
Missing data & Event-triggeredMissing data & Event-triggeredn
Missing data & Event triggeredMissing data & Event triggeredm
enta
tion
heir
Impl
em
Sensors failureSensors failureC Ch lC Ch l
Output predictionOutput predictionParameter estimationParameter estimation
hms a
nd th Com. ChannelsCom. Channels
congestioncongestion
Parameter estimationParameter estimation“Virtual sensors”“Virtual sensors”
n: A
lgor
ith Convergence, stabilityConvergence, stability
l Co-
desi
gn
SteadySteady--statestate Compute nothingCompute nothing
Con
trol
© P. Albertos, © P. Albertos, 20102010
Missing DataMissing Datan Th t t i l il bl t ti i t t { }10;1 rr
Missing DataMissing Datam
enta
tion
uk yk
The output is only available at some time instants:
KALMAN Filter
{ }1,0;1 == kk rr
heir
Impl
em
ek +G(q)
L
KALMAN Filter
hms a
nd th
-$kx̂
rkL1ˆ +kx
n: A
lgor
ith
rk1r
ykk
b Iq-1 C
l Co-
desi
gn
yk
rk1-rkA
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
yk
ECS: Control Algorithm viewpointECS: Control Algorithm viewpointn
ECS: Control Algorithm viewpointECS: Control Algorithm viewpoint
d d d d ld d d d l
men
tatio
n Reduced order models Reduced order models NonNon--conventional sampling and updating patternsconventional sampling and updating patterns
heir
Impl
em
Missing data controlMissing data controlEventEvent--triggered controltriggered control
hms a
nd th Decision and supervisory controlDecision and supervisory control
Hybrid control systems Hybrid control systems
n: A
lgor
ith Multimode controlMultimode controlSampling rate changesSampling rate changes
F ltF lt t l t t lt l t t l
l Co-
desi
gn FaultFault--tolerant control tolerant control Degraded and backDegraded and back--up (safe) control strategiesup (safe) control strategies
Con
trol
© P. Albertos, © P. Albertos, 20102010
Battery monitoring and controlBattery monitoring and control
Decision & supervisory controlDecision & supervisory controlnp yp y
Decision based onDecision based on
men
tatio
n
PerformancesPerformancesProcess modelProcess modelOperating conditionsOperating conditionsdecision O ti
heir
Impl
em Operating conditionsOperating conditionsChanges in controllersChanges in controllersChanges in stored dataChanges in stored dataTransientTransient
decisionlogic
Operating conditions
hms a
nd th
TransientTransientHybrid controlHybrid controlStability issuesStability issuesPerformance degradingPerformance degrading
n: A
lgor
ith
Performance degradingPerformance degrading… CPU optimization… CPU optimization
σswitch signalπ
Param. updating
Goalsdisturbance
l Co-
desi
gn multi-controller process
ucontrol
i l
y measuredoutput
Goals
HT
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
signalT
Controller commuting: Stability issuesController commuting: Stability issuesn
Controller commuting: Stability issuesController commuting: Stability issuesm
enta
tion
Each controller may stabilize the plant under control
heir
Impl
em Each controller may stabilize the plant under control,But ... what under commuting?
hms a
nd th
Common Lyapunov functionCommon Lyapunov function
n: A
lgor
ith
y py pController initializationController initializationController resettingController resetting
l Co-
desi
gn
gg
Not a problem if seldom changesNot a problem if seldom changes
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
p gp g
Supervision: Sampling rateSupervision: Sampling raten
men
tatio
nhe
ir Im
plem CPU availabilityCPU availability
Battery levelBattery level
hms a
nd th
Commuting problemsCommuting problemsSt bilitSt bilit
Battery levelBattery levelMode changes Mode changes
n: A
lgor
ith StabilityStabilityTransientTransientChanges in sampling rateChanges in sampling rate
l Co-
desi
gn Changes in sampling rateChanges in sampling rate
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
ECS: Control Algorithm viewpointECS: Control Algorithm viewpointn
ECS: Control Algorithm viewpointECS: Control Algorithm viewpoint
d d d d ld d d d l
men
tatio
n Reduced order models Reduced order models NonNon--conventional sampling and updating patternsconventional sampling and updating patterns
heir
Impl
em
Missing data controlMissing data controlEventEvent--triggered controltriggered control
hms a
nd th Decision and supervisory controlDecision and supervisory control
Hybrid control systems Hybrid control systems
n: A
lgor
ith Multimode controlMultimode controlSampling rate changesSampling rate changes
F ltF lt t l t t lt l t t l
l Co-
desi
gn FaultFault--tolerant control tolerant control Degraded and backDegraded and back--up (safe) control strategiesup (safe) control strategies
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Battery monitoring and controlBattery monitoring and control
Fault tolerant controlFault tolerant controln
Fault-tolerant controlFault-tolerant controlm
enta
tion Use the control design freedom toUse the control design freedom to
Ensure stability under sensors/actuators failureEnsure stability under sensors/actuators failure
heir
Impl
em yyGuarantee minimal performancesGuarantee minimal performances
Supervision based faultSupervision based fault tolerant controltolerant control
hms a
nd th Supervision based faultSupervision based fault--tolerant control tolerant control
FDIFDI
n: A
lgor
ith Controller commutingController commutingSafe (backSafe (back--up) operationup) operation
l Co-
desi
gn
(( p) pp) pPower awarenessPower awareness
P il bilit i iP il bilit i i
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Power availability supervisionPower availability supervisionMode changesMode changes
RT control implementationRT control implementationn
RT control implementationRT control implementationm
enta
tion The same resources must be The same resources must be sharedshared between between
different tasksdifferent tasks
heir
Impl
em
AlternativeAlternative control control algorithmsalgorithms should be ready to should be ready to get the control of the processget the control of the process
hms a
nd th
g pg pWorking conditionsWorking conditions, such as priority, allocated time , such as priority, allocated time and memory or signals availability may changeand memory or signals availability may change
n: A
lgor
ith and memory or signals availability may changeand memory or signals availability may changeVariable delaysVariable delays should be consideredshould be consideredP i iP i i ff kk
l Co-
desi
gn Priority to Priority to safetysafety taskstasksValidationValidation and certificationand certification
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
nm
enta
tion
heir
Impl
em
ControlControl KernelKernelControlControl KernelKernel
hms a
nd th Control Control KernelKernelControl Control KernelKernel
n: A
lgor
ithl C
o-de
sign
Con
trol
Kernel ConceptKernel Conceptn
Kernel ConceptKernel Concept
Basic services:Basic services:OS kernel:OS kernel:
men
tatio
n Basic services:Basic services:Task and time managementTask and time managementInterrupt handlingInterrupt handling
OS kernel:OS kernel:
heir
Impl
em Interrupt handlingInterrupt handlingInterface to the applications (API) Interface to the applications (API) Mode changesMode changesOS Kernel str ct reOS Kernel str ct re
hms a
nd th Mode changesMode changes
Fault toleranceFault toleranceAdditional servicesAdditional servicesApplicat ion Tasks
OS Kernel structureOS Kernel structure
n: A
lgor
ith Additional servicesAdditional servicesFile managementFile managementQuality of serviceQuality of service
API
l Co-
desi
gn
Qua ty o se v ceQua ty o se v ceTracing and debuggingTracing and debugging
I t t iTask m anagem ent
M ode t asks
Con
trol
© P. Albertos, 2010© P. Albertos, 2010Hardware
Int errupt services
Kernel ConceptKernel Conceptn
Kernel ConceptKernel Concept
B i iB i iOS kernel:OS kernel:
men
tatio
n Basic services:Basic services:Task and time managementTask and time management
OS kernel:OS kernel:
heir
Impl
em
Interrupt handlingInterrupt handlingInterface to the applications Interface to the applications
hms a
nd th
e ce o e pp c o se ce o e pp c o s(API) (API) Mode changesMode changesMode changesMode changes
n: A
lgor
ith Mode changesMode changesFault toleranceFault tolerance
Additi l iAdditi l i
Mode changesMode changesFault toleranceFault tolerance
l Co-
desi
gn Additional servicesAdditional servicesFile managementFile managementQ lit f iQ lit f i
Con
trol
© P. Albertos, © P. Albertos, 20102010
Quality of serviceQuality of serviceTracing and debuggingTracing and debugging
OS Kernel for controlOS Kernel for controln
OS Kernel for controlOS Kernel for controlm
enta
tion The OS Kernel provides the minimal services that should The OS Kernel provides the minimal services that should
be included in any embedded be included in any embedded controlcontrol system.system.
heir
Impl
em
Fault toleranceFault toleranceDegrade task activity (when a task does not guarantee some timingDegrade task activity (when a task does not guarantee some timing
hms a
nd th Degrade task activity (when a task does not guarantee some timing Degrade task activity (when a task does not guarantee some timing
constraints, the degraded behavior is executed)constraints, the degraded behavior is executed)Change mode events raised when some faults can not be managed.Change mode events raised when some faults can not be managed.
n: A
lgor
ith Mode changesMode changesMode definition (set of tasks associated to a mode) Mode definition (set of tasks associated to a mode)
d h ( h f d h )d h ( h f d h )
l Co-
desi
gn Mode change events (event to change from one mode to another) Mode change events (event to change from one mode to another) Mode change protocolMode change protocol
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
The control kernel conceptThe control kernel conceptn
The control kernel conceptThe control kernel conceptm
enta
tion
Backup CA Backup CA CACAuseruser
bu
kr
heir
Impl
em
kvkuCACACACA
hms a
nd th
PlantPlantdelivdelivcomputationcomputation
x y
n: A
lgor
ith kx
kmky
DADA
l Co-
desi
gn
Safe operation in any conditionSafe operation in any condition
Con
trol
© P. Albertos, © P. Albertos, 20102010
Safe operation in any conditionSafe operation in any condition
Control KernelControl Kerneln
Control KernelControl Kernelm
enta
tion Ensures control action (CA) deliveringEnsures control action (CA) delivering
Safe (backSafe (back--up) CA computationup) CA computationSafe CA computation based on previous dataSafe CA computation based on previous data
heir
Impl
em Safe CA computation based on previous dataSafe CA computation based on previous dataData acquisition of major signalsData acquisition of major signals
Safe CA computation based on current dataSafe CA computation based on current data
hms a
nd th Transfer to new control structureTransfer to new control structure
Basic control structure parameters computationBasic control structure parameters computationCA t tiCA t ti
n: A
lgor
ith CA computation CA computation
Full DA Full DA
Control KernelControl Kernel
ControllerController
l Co-
desi
gn
Control structures evaluation and selectionControl structures evaluation and selectionCA computation (different levels)CA computation (different levels)
C i ti f ilitiC i ti f iliti
ControllerController
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
Communication facilitiesCommunication facilitiesCoordination facilitiesCoordination facilities
Control ApplicationControl Applicationn controllercontroller
men
tatio
n
definedefinesend actionssend actions
ControllerController
heir
Impl
em
APIAPIeventseventssend actionssend actions
hms a
nd th DATDAT OATOAT
PeriodPeriodValue, TimeValue, Time
PeriodPeriodOffsetOffset Control KernelControl Kernel
n: A
lgor
ith
Value, TimeValue, TimeThresholdThreshold
Max_latencyMax_latencySafe ValueSafe Value
BackupBackupCurrentCurrent
l Co-
desi
gn
RTOSRTOS
Con
trol
© P. Albertos, 2010© P. Albertos, 2010
RTOSRTOS
Layers and Interactions of the CKLayers and Interactions of the CKn
Layers and Interactions of the CKLayers and Interactions of the CKm
enta
tion
heir
Impl
em
–– ADQ: Samples of variables.ADQ: Samples of variables.–– REF: Control references.REF: Control references.
hms a
nd th –– ESM: Outputs, references and ESM: Outputs, references and
inputs estimation.inputs estimation.CO: Control commands includingCO: Control commands including
n: A
lgor
ith –– CO: Control commands, includingCO: Control commands, including• Controller commuting• Controller commuting• Change of controllers’• Change of controllers’
l Co-
desi
gn
ggparameters.parameters.
–– SCA: Sending of control actions.SCA: Sending of control actions.d di i fd di i f
Con
trol
© P. Albertos, © P. Albertos, 20102010
–– SDI: State and diagnostic ofSDI: State and diagnostic ofinputs.inputs.
CK MiddlewareCK MiddlewareController
n
Control Kernel
Controllerm
enta
tion
Ap p lic a t io n
heir
Impl
em Ap p lic a t io n
hms a
nd th
N e t w o rk CK
Co m m . M id d le w a re CK M id d le w a re
n: A
lgor
ith
OS
s u p p o rt s u p p o rt
l Co-
desi
gn
H w
Con
trol
© P. Albertos, © P. Albertos, 20102010
CK Middleware functionalitiesCK Middleware functionalitiesn
CK Middleware functionalitiesCK Middleware functionalitiesm
enta
tion
Provides object classes for sensors, actuators, Provides object classes for sensors, actuators,
heir
Impl
em
controllerscontrollers
Remote communication through Comm. MiddlewareRemote communication through Comm. Middleware
hms a
nd th
Remote communication through Comm. MiddlewareRemote communication through Comm. Middleware
Pool of threads at different priority levels (acquisition, Pool of threads at different priority levels (acquisition, data acquisition basic computation)data acquisition basic computation)
n: A
lgor
ith data acquisition, basic computation)data acquisition, basic computation)
Admission control (negotiation)Admission control (negotiation)
l Co-
desi
gn Mode change (task + controllers commutation)Mode change (task + controllers commutation)
Con
trol
© P. Albertos, © P. Albertos, 20102010
CK Middleware functionalities (II)CK Middleware functionalities (II)n
CK Middleware functionalities (II)CK Middleware functionalities (II)m
enta
tion Definition of controller parameters:Definition of controller parameters:
Reduced model controller Reduced model controller
heir
Impl
em
Backup actuationBackup actuation
Sensor characteristics (virtual/real, range, acquisition Sensor characteristics (virtual/real, range, acquisition
hms a
nd th
( / , g , q( / , g , qperiod, filter, threshold, ...period, filter, threshold, ...
Actuator characteristicsActuator characteristics
n: A
lgor
ith
CallCall--back functionback function
Compute RMController (locally)Compute RMController (locally)
l Co-
desi
gn Compute RMController (locally)Compute RMController (locally)
Con
trol
© P. Albertos, © P. Albertos, 20102010
CK Middleware structureCK Middleware structure Controllern
CK Middleware structureCK Middleware structureControl Kernel
men
tatio
nhe
ir Im
plem
hms a
nd th
n: A
lgor
ithl C
o-de
sign
Con
trol
© P. Albertos, © P. Albertos, 20102010
Controllern
CK Middleware structureCK Middleware structure Control Kernel
Data acquisitionData acquisition
men
tatio
n Data acquisitionData acquisition
heir
Impl
emhm
s and
thn:
Alg
orith
l Co-
desi
gnC
ontr
ol
© P. Albertos, © P. Albertos, 20102010
CK Middleware structureCK Middleware structuren
men
tatio
n
Each physical sensor S has: Each physical sensor S has:
heir
Impl
em
S = {T, B, C, E}, S = {T, B, C, E}, T: sampling period, T: sampling period,
hms a
nd th B: buffer n last values, B: buffer n last values,
C: the controller functionC: the controller function
n: A
lgor
ith E: the sensor state {fail, event, E: the sensor state {fail, event, no_failno_fail}}Acquisition qualityAcquisition quality
l Co-
desi
gn
Via data acquisition interval (DAI) conceptVia data acquisition interval (DAI) concept
Con
trol
© P. Albertos, © P. Albertos, 20102010
CK Middleware structureCK Middleware structure Controllern
CK Middleware structureCK Middleware structureControl Kernel
men
tatio
n ActuationActuation
heir
Impl
emhm
s and
thn:
Alg
orith
l Co-
desi
gnC
ontr
ol
© P. Albertos, © P. Albertos, 20102010
CK Middleware structureCK Middleware structuren
C dd ew e s uc u eC dd ew e s uc u em
enta
tion Each physical actuator A has: Each physical actuator A has:
A= {T, O, B, R, C, E} A= {T, O, B, R, C, E} ActuationActuation
heir
Impl
em
T: sampling period,T: sampling period,O: Offset between delivering of the action and O: Offset between delivering of the action and
hms a
nd th
ggacquisition of data. acquisition of data. B: buffer n last values.B: buffer n last values.
n: A
lgor
ith R: To store the n future references values. R: To store the n future references values. C: the controller function.C: the controller function.
l Co-
desi
gn
E: the sensor state {fail, event, E: the sensor state {fail, event, no_failno_fail}}
Delivering actions quality Delivering actions quality
Con
trol
© P. Albertos, © P. Albertos, 20102010
e ve g act o s qua tye ve g act o s qua tyVia data acquisition interval (CAI) conceptVia data acquisition interval (CAI) concept
Control Kernel structureControl Kernel structuren
Control Kernel structureControl Kernel structurem
enta
tion
heir
Impl
emhm
s and
thn:
Alg
orith
S:{T,B,C,E}S:{T,B,C,E}E: FailE: Fail
l Co-
desi
gn E: FailE: FailRepeatRepeatNormalNormal
Con
trol
© P. Albertos, © P. Albertos, 20102010
Control Kernel structureControl Kernel structuren
Control Kernel structureControl Kernel structurem
enta
tion
heir
Impl
emhm
s and
th
A {T O B R C E}A {T O B R C E}
n: A
lgor
ith
S:{T,B,C,E}S:{T,B,C,E}E: FailE: Fail
A:{T,O,B,R,C,E}A:{T,O,B,R,C,E}E: FailedE: FailedRepeatedRepeated
l Co-
desi
gn E: FailE: FailRepeatRepeatNormalNormal
NormalNormal
Con
trol
© P. Albertos, © P. Albertos, 20102010
CK layoutCK layoutn
CK layoutCK layoutm
enta
tion
heir
Impl
emhm
s and
thn:
Alg
orith
l Co-
desi
gnC
ontr
ol
© P. Albertos, © P. Albertos, 20102010
CK detailCK detailn
CK detailCK detailm
enta
tion
AnalyzeAnalyze
S ervice node
C t l K l
heir
Impl
em
R T OS
C ontrol K ernelMiddleware
hms a
nd th
C ontrol K ernel Middleware
L ight nodeuo(k)us(k)
n: A
lgor
ith R untime
S witching
uf(k)P lant
l Co-
desi
gn
S implecontroller
us(k)
Con
trol
© P. Albertos, © P. Albertos, 20102010
Scheduling PoliciesScheduling Policies Controllern
Scheduling PoliciesScheduling PoliciesControl Kernel
men
tatio
n
Several scheduling policies can Several scheduling policies can coexist depending on the thread level.coexist depending on the thread level.
heir
Impl
em
Kernel threads (Kernel threads (DAThreadDAThread and and OAThreadOAThread) are executed ) are executed as part of the RTOS Both are periodic and ser eas part of the RTOS Both are periodic and ser e
hms a
nd th as part of the RTOS. Both are periodic and serve as part of the RTOS. Both are periodic and serve
acquisition and delivery actionsacquisition and delivery actions
n: A
lgor
ith
Both have a Both have a queuequeue were requests are served on deadline were requests are served on deadline basis. basis.
l Co-
desi
gn
Values are written/read to/from control kernel Values are written/read to/from control kernel
Con
trol
© P. Albertos, © P. Albertos, 20102010
middleware. middleware.
ImplementationImplementationn
ImplementationImplementationm
enta
tion
Current version of the CK Middleware has been implemented Current version of the CK Middleware has been implemented in Cin C
heir
Impl
em
The RTOS used is The RTOS used is PartiKlePartiKle and openand open--source source rtosrtos which is the which is the new core ofnew core of RTLinux GPLRTLinux GPL
hms a
nd th
new core of new core of RTLinux_GPLRTLinux_GPL
It can be executed in x86 or ARM processorsIt can be executed in x86 or ARM processors
n: A
lgor
ith
Different execution platformsDifferent execution platforms
l Co-
desi
gnC
ontr
ol
© P. Albertos, © P. Albertos, 20102010
CONCLUSIONSCONCLUSIONSn
CONCLUSIONSCONCLUSIONSm
enta
tion
Need of Codesign of Control algorithms and their implementationNeed of Codesign of Control algorithms and their implementationFlexibility in the control scenariosFlexibility in the control scenarios
heir
Impl
em Embedded, networked, eventEmbedded, networked, event--drivendrivenDistribution of the computing resourcesDistribution of the computing resourcesLi it ti i C i ti d C tiLi it ti i C i ti d C ti
hms a
nd th Limitations in Communication and ComputingLimitations in Communication and Computing
Control safetyControl safetyDifferent treatment of:Different treatment of:
n: A
lgor
ith Different treatment of:Different treatment of:Signals: Relevance and Control EffortSignals: Relevance and Control EffortTasks: Control KernelTasks: Control Kernel
l Co-
desi
gn
s s: Co o e es s: Co o e eModels and goals: resource availabilityModels and goals: resource availability
Integration of the control algorithm in the computing activitiesIntegration of the control algorithm in the computing activities
Con
trol
© P. Albertos, © P. Albertos, 20102010
CoCo--DesignDesign
RELIABLE SOFTWARE TECHNOLOGIESRELIABLE SOFTWARE TECHNOLOGIESADAADA--EUROPE 2010EUROPE 2010
nm
enta
tion
Control Co-design: Algorithms and Control Co-design: Algorithms and
heir
Impl
em
g gtheir Implementation
g gtheir Implementation
hms a
nd th
n: A
lgor
ith P. Albertos, A. P. Albertos, A. CrespoCrespo, J. , J. SimóSimóDpt. Dpt. IngIng. de . de SistemasSistemas y y AutomáticaAutomática
I iI i dd A á iA á i I f á iI f á i I d i lI d i l
P. AlbertosP. Albertos A. A. FernándezFernándezDpt. Dpt. AutomáticaAutomática y y ComputaciónComputación
C A b C bC A b C b
l Co-
desi
gn InstitutoInstituto de de AutomáticaAutomática e e InformáticaInformática IndustrialIndustrialUniversidad Universidad PolitécnicaPolitécnica de Valenciade Valencia
[email protected]@aii.upv.es
CUJAE, Habana. CubaCUJAE, Habana. [email protected]@electrica.cujae.edu.cu
Con
trol
VALENCIA, SPAIN, VALENCIA, SPAIN, 1414--18 18 JUNE JUNE 20102010
Top Related