0% found this document useful (0 votes)
12 views

Introduction

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
0% found this document useful (0 votes)
12 views

Introduction

Copyright
© © All Rights Reserved
We take content rights seriously. If you suspect this is your content, claim it here.
Available Formats
Download as PDF, TXT or read online on Scribd
You are on page 1/ 16

CPSC-663 Real-Time Systems

Introduction

Real-Time Systems: Examples / Case Studies

• Simple Control System


• Sampling Periods
• Quality of the Control vs. Processing Cost
• Protection of Resources in Integrated Systems
• Multimedia / Real-Time Communication
• Anomalies in Asynchronous Systems
– Example: Advanced Fighter Technology Integration (AFTI) F16
• Priority Inversion

• Real-Time Systems
• Hard and soft deadlines; operational definition

© R. Bettati

Application Areas: Control Systems

• Example: Water Tank

• In other words

plant sensor
system
state
equation

control law

regulator estimator

© R. Bettati

1
CPSC-663 Real-Time Systems
Introduction

Control Systems (cont)

• Control Loop:

DO FOREVER
wait_for_delay
h := fluid_height
theta := valve_position
r := table_lookup(h, theta)
IF r = left THEN turn_left
ELSE IF r = right THEN turn_right
ELSE do_nothing
ENDDO

© R. Bettati

Example: Avionics System

© R. Bettati

2
CPSC-663 Real-Time Systems
Introduction

Quality of Control vs. Processing Cost


Example: Open-Loop Temperature Control
[Simplified from : Setol, Lehoczky, Sha, and Shin, “On Task Schedulability in Real-Time Control Systems”,
Proceeding of the 1996 IEEE Real-Time Systems Symposium]

System: Temperature of Dynamic equation:


a unit is controlled by a
burner.
x - difference between unit and
ambient temperature, x(0) = 0
u - control input (rate of heat)

Control Problem: change temperature of unit to xd within time tf;


consume minimum amount of fuel. Allow for a tolerance δ.

Performance Index J(u) of control system: measure of total cost of


control and accuracy generated in time period [0, tf] by control u.
Generally:

Optimal control u*(t) with performance index J*.

© R. Bettati

Open-Loop Temperature Control (cont)

Our case: minimize fuel.

Resulting optimal control:

Final State:

© R. Bettati

3
CPSC-663 Real-Time Systems
Introduction

Open-Loop Temperature Control (cont)


Discretize control input u:
Sampling period P.
ẋ (t) = ax (t) + bu (kP ) kP ⇥ t ⇥ (k + 1)P

Performance index for discrete optimal control:


n 1 ⇥ (k+1)P

JD (P )=S(x
˜ ⇥
(tf ), tf ) + L(x⇥ (t), u⇥ (kP ), t)dt
k=0 kP

In our case: ⇥
1 1 e aP

JD (P )=
˜ pxd
2 1+e aP

Constraints: |x(tf ) xd | ⇥

1 e aP
1 xd +
xd ⇥ ⇤ P ⇥ ln
1+e aP a xd
© R. Bettati

Open-Loop Temperature Control (cont)


• Effect of sampling period on performance index.

performance index
JD*(1/P)

J*

frequency
1/Pmax 1/P

© R. Bettati

4
CPSC-663 Real-Time Systems
Introduction

Quality of Control vs. Processing Cost (cont)

Task frequencies must be determined to optimize the performance indices


without overloading the available processing capabilities.

Notation: J (P ) := JD (P ) J

Optimization problem:

Given a set of tasks, Τ1, …, Τn, with given ΔJ*i(•) and execution times Ci,
find a set of periods Pi , such that
1. Pi <= Pi max // Maintain stability
n
2. Minimize (maximize) Ji (Pi ) // Optimize total
i=1 // performance index
n
1
3. Resource Constraint: Ci U // CPU capacity
i=1
Pi

© R. Bettati

Example: Multimedia

Example: Teleseminars
© R. Bettati

5
CPSC-663 Real-Time Systems
Introduction

Example: Intensive Care Computing


(Ken Birman, “The Next-Generation Internet: Unsafe at any Speed?”, IEEE Computer Aug 2000)

Traditional medical-critical-care systems:


users
internet
IV pump dialysis ...
IEEE-1073

monitoring clinical
alarm database

Medical-critical-care systems over shared network:


users
internet
IV pump dialysis ...

IP clinical
database
monitoring
alarm

© R. Bettati

Example: Industrial Applications

Spectral Sensor Data


Control Actions Analyzer sent to
deployed Storage FCCU
Tank Controllers
via IRN Spectral
Blending Unit over IRN
Analyzer

Batch
Processing
Plant
Plant Discrete
Manufacturing
Refining Plant Host Plant
IRNS
Host Host
IRNS IRNS

Network (IRNS)
Clients
Intrusion Resilient Network (IRN)
Network (IRNS)
Servers

Ho IR Control Ho IR Control Ho IR Control


st NS Center st NS Center st NS Center

© R. Bettati

6
CPSC-663 Real-Time Systems
Introduction

Example: Internet of Things

© R. Bettati

Internet of Things (II)

© R. Bettati

7
CPSC-663 Real-Time Systems
Introduction

Example: Cars as Systems-of-Systems

© R. Bettati

Cars as System of Systems (II)

© R. Bettati

8
CPSC-663 Real-Time Systems
Introduction

Cars as SoS (III)

© R. Bettati

Cars as SoS (IV)

© R. Bettati

9
CPSC-663 Real-Time Systems
Introduction

Cars as SoS

(www.autofieldguide.com)

© R. Bettati

Example:
Asynchronous Design of Digital Flight Control Systems
(J. Rushby, SRI-CSL-93-07, Nov. 1993)

• Advanced Fighter Technology Integration (AFTI) F-16 DFCS:

redundant digital
control channels output selection

sensor output

analog backup

© R. Bettati

10
CPSC-663 Real-Time Systems
Introduction

Asynchronous Design of Digital Flight Control Systems

‘‘... The asynchronous design of the [AFTI-F16] DFCS introduced a


random, unpredictable characteristic into the system. The system
became untestable in that testing for each of the possible time
relationships between the computers was impossible. This random
time relationship was a major contributor to the flight test
anomalies. Adversely affecting testability and having only
postulated benefits, asynchronous operation of the DFCS
demonstrated the need to avoid random, unpredictable, and
uncompensated design characteristics.’’
D. Mackall, flight-test engineer AFTI-F16 flight tests

© R. Bettati

Example: Mars Pathfinder Incident


• Landing on July 4, 1997
• “experiences software glitches”
• Pathfinder experiences repeated
RESETs after starting gathering of
meteorological data.

• RESETs generated by watchdog


process.
• Timing overruns caused by priority
inversion.

• Resources:
http://research.microsoft.com/en-
us/um/people/mbj/Mars_Pathfinder/
Mars_Pathfinder.html

© R. Bettati

11
CPSC-663 Real-Time Systems
Introduction

Priority Inversion on Mars Pathfinder


Task bc_sched
blocks on mutex detects overrun
becomes active
high priority
Task bc_dist

other tasks

Task ASI/MET
low priority
starts
gets preempted
locks mutex

© R. Bettati

Real-Time vs. Non-Real-Time Systems

Q: What distinguishes RT systems from non-RT systems?

A: Timing Constraints!

© R. Bettati

12
CPSC-663 Real-Time Systems
Introduction

Players in Real-Time Systems

Jobs and Processors:


– Job: Unit of work executed by the system
– Processor: Jobs require resource to execute (CPU, disk,
network link)
(We don’t distinguish between types of processors!)

Timing constraints:
– Release Time: time when job becomes available for
execution
– Deadline: time when execution must be completed
– Relative Deadline: maximum response time

© R. Bettati

Hard vs. Soft Deadlines


• Hard Deadline: Late result may be a fatal flaw, of little use,
or cause disastrous consequences
• Soft Deadline: Timely completion desirable.
Late results useful to some degree.
• Quantitative measure: Overall system performance as function of
tardiness of jobs.
performance

“rather hard”
“rather soft” system
Overall

system

Overall
tardiness

Operational Definition: A job has a hard deadline whenever the


system designer must prove that the job never misses its deadline.

© R. Bettati

13
CPSC-663 Real-Time Systems
Introduction

Hard Real-Time Systems

Definition: A real-time system is hard-real-


time when a large portion of the deadlines is
hard.

• Examples:
– Embedded systems
– Recovery procedures in high-availability systems
– many others …

© R. Bettati

Hard Real-Time Systems

Q: Does real-time mean fast ?

© R. Bettati

14
CPSC-663 Real-Time Systems
Introduction

Hard Real-Time Systems

Q: Why not use commercial (general purpose) OSs?

A: Verification, Certification

© R. Bettati

Hard Real-Time Systems

Q: Why do we need to meet deadlines 100% of the


time?
A:
• Validation of probabilistic timing
requirements.
• Assessment of compound effect of
missed deadlines with other
factors.

© R. Bettati

15
CPSC-663 Real-Time Systems
Introduction

Soft Real-Time Systems


Definition: A real-time system is soft-real-time
when jobs have soft deadlines.

u usefulness
Non-stringent timing requirements
on-line transaction system
telephone switches d
t
u
More stringent timing requirements
Stock price quotation system
d
t
u
Stringent timing requirements
Multimedia
d
Requirements often specified in t
probabilistic terms; validation is
often done by simulation, trial use.
© R. Bettati

16

You might also like