realtime systems chapter 1

37
Prepared by: Binay Ghimire REAL TIME SYSTEMS Binay Ghimire, course Instructor, RTS 1

Upload: binay-ghimire

Post on 12-Apr-2017

40 views

Category:

Engineering


1 download

TRANSCRIPT

Page 1: Realtime systems chapter 1

Prepared by:

Binay Ghimire

REAL TIME SYSTEMS

Binay Ghimire, course Instructor, RTS 1

Page 2: Realtime systems chapter 1

Books:

Text Book(RTS Bible):

Real Time Systems - Jane W S Liu

Reference Materials:

-The Concise Handbook of Real-Time

Systems : Timesys Corporation

- Lecture notes/slides

- Internet resources

Binay Ghimire, course Instructor, RTS 2

Page 3: Realtime systems chapter 1

INTRODUCTION

Any system in which a timely response by the computer to the external stimuli is vital

RT System must not only produce right answer but also meet time constraints

System that must satisfy explicit or bounded response time constraint or risk severe consequences including system failure

A failed system is one which cannot satisfy one or more of the requirements laid out in the formal system specification

Page 4: Realtime systems chapter 1

INTRODUCTION

RTS

Schedulability -Performance must be schedulable

Responsiveness:

-Must respond in worst case by each task

Non RTS

Throughput

Average case response time

Fairness is more important than deadline

Binay Ghimire, course Instructor, RTS 4

Page 5: Realtime systems chapter 1

Facts about RTS

Predictable computing rather than fast computing

RT Programming is not hand coded

- A number of automated tools can be used to generate

efficient codes for Real-time programs

RT system performance engineering emphasizes more on

timeliness than the raw performance

RT systems not necessarily work in static environment

- Rather there are a number of situations where RTS are

deployed in environment were the operating condition

changes dynamically

Binay Ghimire, course Instructor, RTS 5

Page 6: Realtime systems chapter 1

EXAMPLES OF RTS

Cell phones, Digital camera , Microwave

oven

Avionics, Radar Control System, Industrial

Process Control

Command and Control

Multimedia system

Electronics Warhead Control System

Missile Tracking System

Binay Ghimire, course Instructor, RTS 6

Page 7: Realtime systems chapter 1

EXAMPLE

Missile Tracking System: System

responsiveness is faulty but calculations are

correct so target is missed

Binay Ghimire, course Instructor, RTS 7

Page 8: Realtime systems chapter 1

Logical / Temporal Correctness

If a system misses its deadline the resultant action could be abort, continue, abandon depending upon system option

Real-time System is a system whose specification includes logical / temporal correctness

Logical correctness:

- Indicates that system must produce correct output (must be verifiable)

Temporal correctness

- Implies that system must produce output at correct or right time

Binay Ghimire, course Instructor, RTS 8

Page 9: Realtime systems chapter 1

Characteristics of Real-time

Systems: i. Event driven, reactive in nature (continual

interaction with the environment)

ii. Cost of failure is high

iii. Require concurrency or multiprogramming

iv. Standalone / Continuous operations

v. Reliability and fault tolerant requirements

vi. Predictable behavior

Binay Ghimire, course Instructor, RTS 9

Page 10: Realtime systems chapter 1

EXAMPLE: Driving a Car

Mission: To reach destination safely

Controlled system: car

Operation environment: road, traffic, other cars

Real-time controller : driver

Controls: accelerator, steering wheel, brake paddle

Actuators: wheels, engine , brake

Critical Tasks: braking system, steering

Non Critical Task: radio, cassette player

Binay Ghimire, course Instructor, RTS 10

Page 11: Realtime systems chapter 1

EXAMPLE: Thermo Nuclear Power

Plant

Two events signaled by interrupts:

i. Event is triggered by any of several signals at

various security points that will indicate a

security breach.

-The system must respond within one second

ii. Event indicates that nuclear core has

reached an over temperature

-The signal must be dealt within 1 millisecond

-Danger of meltdown if deadline is missed

Binay Ghimire, course Instructor, RTS 11

Page 12: Realtime systems chapter 1

Types of Real-time Systems

Depending upon temporal behavior of

Real-time system they can be

characterized as

hard,

soft and

firm Real-time system

Binay Ghimire, course Instructor, RTS 12

Page 13: Realtime systems chapter 1

Hard Real-time System

A system crashes if the deadline is not met by the

tasks

A hard deadline is imposed on a job as a late result

produced by the job after the deadline may have

disastrous consequences

Binay Ghimire, course Instructor, RTS 13

Page 14: Realtime systems chapter 1

Hard Real-time System

e.g. an Onboard computer of a moving aircraft:

- Measures the velocity , altitude, position , acceleration wind pressure etc

- Collects data with sensor within fixed amount of time say 20 ms

- Compares these data against the stored values

There’s a stiff deadline for all these computations

Binay Ghimire, course Instructor, RTS 14

Page 15: Realtime systems chapter 1

Firm Real-time System

System doesn’t fail but throws the

results (ignores) in case of failure

Binay Ghimire, course Instructor, RTS 15

Page 16: Realtime systems chapter 1

Firm Real-time System

Every 1/30th of sec 1 frame has to arrive

Destination will not wait for frame to arrive but switch over to next frame if 6th frame does not arrive

Hard RTS are not periodic

Most periodic hard Real-time systems are firm RT systems

Reset clock

Wait 20 m/s

Capture frame

If capture buffer ok (picture captured)

store frame

else repeat

Binay Ghimire, course Instructor, RTS 16

Page 17: Realtime systems chapter 1

Soft Real-time System

Here utility value becomes less/drops with time

e.g. exam hall: Delay by 30 minutes allowed. More

delay, you will not be allowed to write the exam.

e.g. Word processors,Airline reservation system,

games, simulations

Binay Ghimire, course Instructor, RTS 17

Page 18: Realtime systems chapter 1

Digital control

Real-time systems are usually control systems

embedded in sensors and actuators and

function as digital controllers

Binay Ghimire, course Instructor, RTS 18

Page 19: Realtime systems chapter 1

Digital control

The plant is a controlled system e.g. engine, brake, an aircraft or a patient

The state of the plant is monitored by sensors and can be changed by actuators

The Real-time (computing) system estimates from the sensor reading the state of the plant

Computes a control output based on the difference between the current state and the desired state (reference input)

This computation is called the control law computation of the controller

The output thus generated activates the actuator, which brings the plant closer to the desired state

Binay Ghimire, course Instructor, RTS 19

Page 20: Realtime systems chapter 1

Sampled Data Systems

A sampled data system typically reads and digitizes the analog sensor readings periodically and carries out its control law computation every period

The sequence of digital outputs thus produced is then converted back to an analog form, needed to activate the actuators

Analog sensor reading y(t) gives the measured state of the plant at time “t‟

If e(t) = r(t) – y(t) denote the difference between the desired state r(t) and the measured state y(t) at time “t‟ then:

ek = rk - yk is the kth sample value of e(t)

Binay Ghimire, course Instructor, RTS 20

Page 21: Realtime systems chapter 1

Multi-Rate Systems

A plant typically has more than one degree

of freedom

Its state is defined by multiple state variables

(e.g. rotation, speed , temperature etc)

These are monitored by multiple sensors

and controlled by multiple actuators

Binay Ghimire, course Instructor, RTS 21

Page 22: Realtime systems chapter 1

High Level Controls

Controllers in a complex monitor and control

system are typically organized hierarchically.

One or more digital controllers at the lowest level

directly control the physical plant.

Each output of a higher-level controller is a

reference input of one or more lower-level

controllers.

Examples: Flight Management System(FMS), Air

Traffic Control(ATC), assembly robots in a factory,

patient monitoring system in an ICU.

Binay Ghimire, course Instructor, RTS 22

Page 23: Realtime systems chapter 1

Hierarchical Control System

Binay Ghimire, course Instructor, RTS 23

Page 24: Realtime systems chapter 1

Reference of Hierarchical control

system Controllers in complex monitors and control systems are typically

organized hierarchically

One or more digital controllers at the lowest level directly controls the physical plant while the controller at higher level provide reference inputs to the controller at lower level

Controllers at high level may have interface with the operator

Example: Patient Care System

◦ LLCs are micro-processor based controllers to monitor and control patients blood pressure, respiratory glucose and so on

◦ HLCs are expert system with operator (nurse/doctor) and provides reference value of the health indications

Computation done by LLC are simple accurate and deterministic while computations done by HLC are more complex and variable.

Periods of control law computations for LLC may range from milliseconds to seconds

Period of control law computations for HLC may range from minutes to hours

Binay Ghimire, course Instructor, RTS 24

Page 25: Realtime systems chapter 1

Guidance and Control

In Flight Management System(FMS), the control activity is handled by low level digital controller while a second level controller performs the guidance activity such as path planning, finding the most desirable trajectory out of the trajectories that meet the system constraints

The guidance function takes the constraints into consideration such as air craft characteristics max/min, cruise speed, descent/ascent rates etc) and environmental characteristics (ground track, altitude, profile weather condition)

It may also impose various cost functions such as fuel consumption, constrained fixed time of arrival

Binay Ghimire, course Instructor, RTS 25

Page 26: Realtime systems chapter 1

Real-time Command and Control

In control hierarchy, controllers at highest level

is a command and control system

Air Traffic Control (ATC) system is a command

and control system

ATC system monitors the air-crafts in its coverage

area and weather condition and provide necessary

information required by the ATC system operators

Output of ATC system goes to the on board Flight

Management System. so ATC system indirectly

controls the lowest level embedded controllers

Binay Ghimire, course Instructor, RTS 26

Page 27: Realtime systems chapter 1

ATC Example

Binay Ghimire, course Instructor, RTS 27

Page 28: Realtime systems chapter 1

ATC Example

Binay Ghimire, course Instructor, RTS 28

Page 29: Realtime systems chapter 1

ATC Example

ATC collects information about aircrafts through radar

Radar asks aircraft for state info and aircrafts send data for state variables (identifier, position, altitude, (track record) and current trajectory (track)

ATC processes these data and stores in DB which is picked up by display processor and surveillance processor to inform the operator about the potential hazards if any (collision)

Timing requirements of command control system are less stringent

Low level controllers run on one or few computers with the small network of dedicated links

Command and control system may be a large distributed system with hundreds of heterogeneous computers

Binay Ghimire, course Instructor, RTS 29

Page 30: Realtime systems chapter 1

Signal Processing System

Most signal processing applications

have Real-time requirements

Response time few millisecond to few

seconds

e.g. Digital filtering (audio and video),

Voice and video compression and

decompression

Binay Ghimire, course Instructor, RTS 30

Page 31: Realtime systems chapter 1

Radar signal processing

Binay Ghimire, course Instructor, RTS 31

Page 32: Realtime systems chapter 1

Subsystems

I/O Subsystem: Samples and digitizes the radar echo signal and places the sampled values in a shared memory buffer called bin

DSP Subsystem: An array of DSP processors processes these sample values

Data Processing Subsystems: Processes and analyses the DSP output to produce output to interface with the display system commands to control (move) the radar, and signal processing parameters for the next cycle

Binay Ghimire, course Instructor, RTS 32

Page 33: Realtime systems chapter 1

Working of a Radar System:

For object search , radar points antenna in

one direction at a time and sends a short RF

pulse, then it collects and analyzes the echo

signal

The echo signal having background noise

only indicates no object hit

If the signal hits any object at distance “x‟

and echo arrives after 2x/c

where c = 3 x 108 ie. Speed of light

Binay Ghimire, course Instructor, RTS 33

Page 34: Realtime systems chapter 1

Tracking

An application that examines all the track records in order to sort out false returns (wrong data of presence of object) from real ones and update the trajectories of detected objects is called a tracker

The tracker assigns each measured value(position and velocity)to a trajectory. If the trajectory is an existing one, the measured value assigned to it

gives the current position and velocity of the object moving along the trajectory.

If the trajectory is new, the measured value gives the position and velocity of a possible new object.

Tracking is carried out in two steps: i. Gating

ii. Data Association

Binay Ghimire, course Instructor, RTS 34

Page 35: Realtime systems chapter 1

Gating and Data Association

Gating is the process of putting each measured value into one of two categories established trajectories or new one. The gating process assigns a measured value to an established

trajectory if it is within a threshold distance G away from the predicted current position and velocity of the object moving along the trajectory.

Under adverse conditions, the assignment produced by gating may be ambiguous, that is, some measured value is assigned to more than one trajectory or a trajectory is assigned more than one measured value.

The Data Association step is then carried out to complete the assignments and resolve ambiguities. E.g. the nearest neighbor algorithm

Binay Ghimire, course Instructor, RTS 35

Page 36: Realtime systems chapter 1

Further Reading

Refer Textbook for some more examples

on Real Time systems and their

applications

Binay Ghimire, course Instructor, RTS 36

Page 37: Realtime systems chapter 1

THANK YOU

Binay Ghimire, course Instructor, RTS 37