RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task...

34
Jinkyu Lee Sungkyunkwan University (SKKU) Closing the Gap between Stability and Schedulability: A New Task Model for Cyber-Physical systems Hoon Sung Chwa and Kang G. Shin University of Michigan

Transcript of RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task...

Page 1: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

Jinkyu LeeSungkyunkwan University(SKKU)

ClosingtheGapbetweenStabilityandSchedulability:ANewTaskModelforCyber-Physicalsystems

Hoon SungChwa andKangG.ShinUniversityofMichigan

Page 2: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Operationofphysicalsubsystem inaCPSismonitored&controlledbycyber/computational subsystem.▫ Examples:autonomousvehicles,medicaldevices,smartbuildings

Cyber-PhysicalSystems

Page 3: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

Cyber-PhysicalSystemsFeedbackcontrolloop

Physical plant

Controllerreference

SensorActuatorstate

outputinput

Periodictaskmodel(T,C,D):Period,Worst-caseexecutiontime,Deadline

State-spacerepresentation

Real-timescheduling

Stability

Schedulability

PhysicalpartCyberpart Gap

Page 4: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

• Stability• Mostphysicalsubsystemsaredesignedtotolerateoccasionalcontrolupdatemisses.• Trade-offbetween samplingrateand updatemisses

• Stability,controlperformance,resourceutilization

Motivation

Feedbackcontrolloop

Physical plant

Controller

SensorActuatorSampling

rate

Controlupdatemiss

Page 5: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ AdaptiveCruiseControl(ACC)▫ Goal:maintainasafedistance▫ Input:inter-vehicledistance(𝛿),velocity(∆𝑣)▫ Output:vehicleacceleration(𝑎)<speedcontrol>

▪ Periodic(feedback)controlloop▫ Samplingperiod:𝑇

CaseStudy:ADASsystem

Page 6: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ State-spacerepresentation

▪ Stabilityanalysis[Astrom andWittenmark 97]

CaseStudy:ADASsystem

𝑥 𝑘 + 1 = 𝐴𝑥 𝑘 + 𝐵𝑢(𝑘 − 𝑚 𝑘 )𝑢 𝑘 = −𝐾𝑥(𝑘)𝑥 𝑘 = 𝛿∆𝑣𝑎 T

𝑚 𝑘 : # of consecutive update misses at 𝑡5

Astrom andWittenmark.Computer-controlledsystems.Prentice-HallInc.,1997.

Page 7: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Stabilityregion

Observation

Page 8: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Stabilityregion

Observation

(100ms,3misses)

(40ms,10misses)

• Shorter samplingperiod->moretolerable consecutivecontrolupdatemisses

Page 9: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Stabilityregion

Observation

• Shorter samplingperiod->moretolerable consecutivecontrolupdatemisses

• Shorterperiodallowingmoreupdatemisses->Stabilityguaranteewithmuchfewerresources

Whenm=0,171ms

Whenm=1,(1+1)140 = 280ms

Whenm=10,(10+1) 40 = 440ms

Effective control update period

(m:consecutivecontrolupdatemisses)

40ms

140ms

171ms

Page 10: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Stabilityregion

Observation

Page 11: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Controlperformance(standardquadraticperformanceindex)▫ Deviationfromthedesiredstate

▪ Controlperformancedegradesasboththesamplingperiodand#updatemissesincrease.

Observation

Page 12: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Periodiccontroltaskbehaviorwithcontrolupdatemisses▫ Case1:controltaskwithperiodT,consecutivemisses2

▫ Case2:controltaskwithperiod3T,consecutivemisses0

Observation

Page 13: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Therelationbetweensamplingperiod andupdatemissescanbeexploitedtoimprovebothcontrolperformance andresourceefficiency withoutlosingstability

▪ OurGoal

Implication

Page 14: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Control-scheduleco-design▫ Optimalperiodassignmenttomaximizecontrolperformance▫ Onlineperiod-adjustmentschemes▫ Assumption:stricthardguaranteeofeverydeadline

▪ Fault-tolerantscheduling▫ Relaxationofstricthardreal-timeguarantees

▪ (m,k)-firmdeadline,skip-overmodel,weakly-hardtaskmodel▪ Allowoccasionalcontrolsignaldropsorskippingjobs

▫ Assumption:fixedorgiventaskperiods

StateoftheArt

Noconsiderationoninteractionbtw.taskperiod anddeadlinemisses

[Seto etal. 96][BiniandCervin 08][Xuetal. 15][Cervin etal. 04][Wuetal. 10][Aminifar etal. 12][Palopoli etal. 02][Khatib etal. 17]

[Cervin etal. 02][Martietal. 04][Castane etal. 06]

[Palopoli etal. 00][Branicky etal. 02][Kauer etal. 14][Goswami etal. 14][Soudbakhsh etal. 13][Majumdar etal. 11][Yoshimotoetal. 11]

Page 15: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

OurApproach

NewCPStaskmodel

Newschedulingmechanism

• capturesthetrade-offbetweensamplingperiod andcontrolupdatemissesü Stability,controlperformance

• Determinestaskperiods andmanagedeadlinemissesü Improvescontrolperformancewithoutlosingstabilityü Utilizeslimitedresourcesefficiently

Page 16: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Foreachcontroltask𝜏7

NewCPSTaskModel

(𝑇7, 𝐶7, 𝐷7)

Classicalreal-timetaskmodel

({(𝑚7, [𝑇7=7> 𝑚7 , 𝑇7=?@(𝑚7)])}, 𝐶7, 𝐷7)

NewCPStaskmodel

𝑚7:maximumtolerableconsecutivedeadlinemisses

Generalize

Stablepair

Page 17: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Foragivensetofcontroltasks,▪ Step1[offlineparameterassignment]▫ Determine𝜏7: 𝑚7, 𝑇7, 𝐶7, 𝐷7 ({(𝑚7, [𝑇7=7> 𝑚7 , 𝑇7=?@(𝑚7)])}, 𝐶7, 𝐷7)

guaranteeingstability

▪ Step2[onlinestate-awarescheduling]▫ Generateactualschedulebydynamicallycontrollingdeadlinemisses(≤ 𝑚7)▫ Considerplantstatetomaximizecontrolperformancewithoutlosingstability

Problem

Page 18: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Howtofindastable parameterassignment?

▪ Howtofindaperformance-optimal parameterassignmentamongstableparameterassignments?

OfflineParameterAssignment

Page 19: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Howtofindastableparameterassignment?▫ Derivenecessaryconditions foratasksettobestable▪ Notionofcritical job

▫ Ajobissaidtobecritical,ifitisreleasedaftermissing𝑚7 consecutivejobdeadlines

▪ Ifallcriticaljobsareschedulable,thephysicalplantisstable

OfflineParameterAssignment

Time

𝐽7F 𝐽7G 𝐽7H 𝐽7I 𝐽7J 𝐽7K 𝐽7L 𝐽7M 𝐽7N

Criticaljob Jobrelease Deadlinemiss𝑇7

𝑚7 = 2

Stabilityofitsphysicalplant

Schedulabilityofacontroltask

Page 20: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Howtofindastableparameterassignment?▫ Schedulability ofallcriticaljobs▪ Difficult todeterminetheschedulability▪ ∵ Criticaljobdynamicallychanges▪ ∵ Interferenceonacriticaljob varies

OfflineParameterAssignment

Time

𝐽7F 𝐽7G 𝐽7H 𝐽7I 𝐽7J 𝐽7K 𝐽7L 𝐽7M 𝐽7N

𝐽7F 𝐽7G 𝐽7H 𝐽7I 𝐽7J 𝐽7K 𝐽7L 𝐽7M 𝐽7N

miss miss miss miss

miss miss miss miss miss

Criticaljob

dependingonthescheduleofnon-criticaljobs

Page 21: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Howtofindastableparameterassignment?▫ Assume astaticminimal jobschedule

▪ Onlycriticaljobsarescheduled

▫ Applyresponse-timeanalysis

OfflineParameterAssignment

Time

𝐽7F 𝐽7G 𝐽7H 𝐽7I 𝐽7J 𝐽7K 𝐽7L 𝐽7M 𝐽7N

𝑚7 + 1 ⋅ 𝑇7 = 3 ⋅ 𝑇7

Period

Deadline

𝑇7

Page 22: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Howtofindaperformance-optimalparameterassignmentamongstableparameterassignments?▫ Optimizationproblem

▫ Exponentiallyincreasingsearchspace▪ Two-stepapproach

OfflineParameterAssignment

control performance index

stability region

schedulability of critical jobs

Page 23: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

State-awareOnlineScheduling

▪ UponJOB-RELEASEorJOB-COMPLETION▫ Maintaintwotypesofqueue:readyqueueandwaitqueue▫ Checkthepossibilityofexecutingnon-criticaljobs

Page 24: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

State-awareOnlineScheduling

▪ Howtoensuredeadlineguaranteesofallcriticaljobs?▫ Challenge

▪ Infinitenumber ofcriticaljobswillbereleasedinfuture▪ Synchronousreleaseisnolongerthecriticalinstant

▫ Ourapproach▪ Provethatsufficienttocheckonlyonecriticaljobthatwillbereleasedearliest▪ Developschedulability analysis

Page 25: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Autonomousvehiclecontrolsystem▫ Adaptivecruisecontrol,lanekeepingcontrol,DC-servocontrol▫ 3controltasks+hardreal-timetasks

Evaluation

Page 26: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Comparison

Evaluation

[Martietal. 04]

Ournewtaskmodel({(m,T)},C,D)

Traditionaltaskmodel(T,C,D)

Parameter assignment

Periodassignmentwithharddeadline

(m,T)assignment[Our-PA]

Online scheduling

State-awarescheduling

[Our-PA-SAS]

Critical-job-onlyscheduling[Our-PA]

Dynamic periodadjustmentunderEDF

[DPA-EDF]

Static periodassignmentunderRM[SPA-RM]

Martietal.Optimalstatefeedbackbasedresourceallocationforresource-constrainedcontroltasks.InRTSS,2004.

Page 27: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Evaluationcriteria▫ Schedulingperformance(cyberpart)

▪ Thenumberoftasksetsschedulablebytheproposedtechnique

Evaluation

54%

39%Accommodatemorecontroltasks

withoutlosingstability

Page 28: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Evaluationcriteria▫ Controlperformance(physicalpart)

▪ Cumulativeerrorfromdesiredstateforcontroltasks

Evaluation

32%

Page 29: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

Summary

Static viewonstability

GAP

<Physicalpart> <Cyberpart>

Stability ofphysicalpart

Tolerable updatemisses Nodeadlinemissallowed

Identifykeyparameters andtheirrelationship

Propose anewtaskmodelthatcapturestherelationship

Improvebothcontrolperformance andresourceutilization

Page 30: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

ReferenceSeto etal.Ontaskschedulability inreal-timecontrolsystems.InRTSS,1996.

BiniandCervin.Delay-awareperiodassignmentincontrolsystems.InRTSS,2008.

Xuetal.Exploitingjobresponse-timeinformationintheco-designofreal-timecontrolsystems.InRTCSA,2015.

Cervin etal.Thejittermarginanditsapplicationinthedesignofreal-timecontrolsystems.InRTCSA,2004.

Wuetal.Parameterselectionforreal-timecontrollersinresource-constrainedsystems.InIEEETransactionsonIndustrialInformatics, 2010.

Aminifar etal.Designinghigh-qualityembeddedcontrolsystemswithguaranteedstability.InRTSS,2012.

Palopoli etal.Synthesisofrobustcontrolsystemsunderresourceconstraints.InHSCC,2002.Khatib etal.Schedulingofembeddedcontrollersundertimingcontracts.InHSCC,2017.

Cervin etal.Feedback-feedforwardschedulingofcontroltasks.InReal-TimeSystems,2002.Martietal.Optimalstatefeedbackbasedresourceallocationforresource-constrainedcontroltasks.InRTSS,2004.

Castane etal.Resourcemanagementforcontroltasksbasedonthetransientdynamicsofclosed-loopsystems.InECRTS,2006.Palopoli etal.Real-timecontrolsystemanalysis:anintegratedapproach.InRTSS,2000.

Branicky etal.Schedulingandfeedbackco-designfornetworkedcontrolsystems.InCDC,2002.Kauer etal.Fault-tolerantcontrolsynthesisandverificationofdistributedembeddedsystems.InDATE,2014.

Goswami etal.Relaxingsignaldelayconstraintsindistributedembeddedcontrollers.InIEEETransactionsonControlSystemsTechnology,2014.Soudbakhsh etal.Co-designofcontrolandplatformwithdroppedsignals.InICCPS,2013.

Majumdar etal.Performance-awareschedulersynthesisforcontrolsystems.InEMSOFT,2011.

Yoshimotoetal.Optimalarbitrationofcontroltasksbyjobskippingincyber-physicalsystems.InICCPS,2011.

Page 31: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7
Page 32: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Alinearsystemisasymptoticallystable ifalltrajectoriesconvergetotheorigin▫ Foranyinitialstate𝑥 𝑘S ,

Stability

𝑥 𝑘 → 0𝑎𝑠𝑘 → ∞

Page 33: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

State-awareOnlineScheduling

▪ Whichnon-criticaljobtoexecute?▫ Considercurrentstateerrors

▪ Insteadystate,nobenefitbyexecutinganon-criticaljob▪ Intransientstate,controlperformanceimprovementbyquickreactiontoperturbation

▫ Chooseajobwiththelargesterrorfirst

Time

Transient SteadyOutpu

t

Page 34: RTAS new task model Chwa2018.rtas.org/wp-content/uploads/2018/05/S9.3.pdf · For each control task 6 7 New CPS Task Model (% 7,9 7,: 7) Classical real-time task model ({(0 7,[% 7

▪ Evaluationcriteria▫ Schedulingperformance(cyberpart)

▪ Thenumberoftasksetsschedulablewithoutlosingstability▫ Controlperformance(physicalpart)

▪ Thesumofperformancemeasuresforcontroltasks

▪ Tasksetgeneration▫ 3controltasks+hardreal-timetasks

Evaluation