Real Time Systems and Control

Real Time Systems and Control Introduction

Today

  1. House-keeping (also available on KEATS).
  2. Introduction to real time systems.

Housekeeping

 

Course Delivery

Lectures: 12pm-2pm Tuesdays, Microsoft Teams.

I Combination of synchronous/asynchronous delivery.

I A suggested schedule will be posted for the asynchronous parts. I Mix of video lectures and discussion/Q&A sessions.

Tutorials: 12pm-2pm Thursdays, Microsoft Teams.

I Problem solving based on course content and discussion.

I You will work in small groups.

I Teaching assistants will be available to help.

For any issues regarding timetabling, please e-mail: ug-engineering@kcl.ac.uk or pgt-engineering@kcl.ac.uk.

Lecture Capture

Where appropriate, live sessions will be recorded through the Teams recording facility.

I Recordings appear automatically in the Teams chat shortly after the session ends.

Recordings are not a substitute for attendance.

I Not everything is recorded, and you will get more out of the sessions by attending in person!

Course Delivery

Lecture Timetable

19th January 2021 Introduction
26th January 2021 Concurrent Programming
2nd February 2021 Shared Resources
9th February 2021 Interrupts
16th February 2021 Timers
23rd February 2021 Scheduling
2nd March 2021 Schedulability
9th March 2021 Discrete Systems
16th March 2021 Laplace and Z-Transforms
23rd March 2021 Controllability and Observability

KEATS

Lots of useful information and resouces. http://keats.kcl.ac.uk

Textbooks

I A. Burns and A. Wellings. Real Time Systems and

Programming Languages: Ada, Real-Time Java and

C/Real-Time POSIX. 4th ed. Pearson, 2009

I B. Kuo. Digital Control Systems. 2nd ed. Oxford University Press, 1995

I A. C. Shaw. Real-Time Systems and Software. Wiley, 2001

I L. Null and J. Lobur. The Essentials of Computer Organization and Architecture. 4th ed. Jones and Bartlett, 2015

Copies available in the library.

Older/newer editions are also suitable, but note there may be small changes between editions.

Real Time Systems “Stack Exchange”

A place to discuss course material, ask questions and share knowledge with your classmates.

Access through Yammer (you should receive an invitation).

You could also visit the real Stack Exchange.

http://stackexchange.com

Office Hours

Opportunity to ask questions, get help with understanding.

Dr Matthew Howard                                     Tuesdays 9-10am                   Microsoft Teams

Don’t leave it to the last week of term!

View my availability by following this link:

http://tinyurl.com/mjh-office-hours

Assessment

Exam                                                         Coursework

I 60% of total credit.    I 30% of total credit.

I Held in May exam period. I 2 assignments (see later for details).

Engagement

I Problem solving with multiple choice      I 10% of total credit. answers.

I Weekly quiz on KEATS.

Past papers can be found here:

internal.kcl.ac.uk/nms/depts/informatics/stu/ug/exampapers.aspx internal.kcl.ac.uk/nms/depts/informatics/stu/pg/exampapers.aspx

Coursework

  Release Date Deadline Credit
Real-time

Programming with pthreads

11am, 2nd February 2021 5pm, 22nd February 2021 15%
Linear Systems

Control

11am, 16th March 2021 5pm, 5th April 2021 15%

These dates are subject to change!

 

 

I Take notes (slides/videos are not enough when you try to revise).

I Take notes (slides/videos are not enough when you try to revise). I Make use of the course materials.

I Take notes (slides/videos are not enough when you try to revise).

I Make use of the course materials.

I Read around the subject/try things for yourself.

I Take notes (slides/videos are not enough when you try to revise).

I Make use of the course materials.

I Read around the subject/try things for yourself. I Plan your time carefully: the more you leave things until later, the more likely you are to struggle.

I Take notes (slides/videos are not enough when you try to revise).

I Make use of the course materials.

I Read around the subject/try things for yourself. I Plan your time carefully:

the more you leave things until later, the more likely you are to struggle. I Do as much learning on your own as you can

(but know that sometimes you may have to ask for a bit of help).

I Take notes (slides/videos are not enough when you try to revise).

I Make use of the course materials.

I Read around the subject/try things for yourself. I Plan your time carefully:

the more you leave things until later, the more likely you are to struggle. I Do as much learning on your own as you can

(but know that sometimes you may have to ask for a bit of help).

This is a 15 credit module, expecting 150 hours study.

We have approximately 40 contact hours.

Therefore, you should be spending 110 hours on self-directed learning.

 

  1. Ask a question during synchronous teaching sessions.
  2. Ask a question during synchronous teaching sessions.
  3. Ask a question on the stack exchange.
  4. Ask a question during synchronous teaching sessions.
  5. Ask a question on the stack exchange.
  6. Ask a question during office hours.
  7. Ask a question during synchronous teaching sessions.
  8. Ask a question on the stack exchange.
  9. Ask a question during office hours.
  10. When all else fails ask us a question by e-mail.
  11. Ask a question during synchronous teaching sessions.
  12. Ask a question on the stack exchange.
  13. Ask a question during office hours.
  14. When all else fails ask us a question by e-mail.

Be realistic about the speed and level of detail you can expect from e-mail.

I We aim to answer all reasonable queries within 3 working days.

I We will not be checking e-mail in the evenings, on weekends, or during holidays.

  1. Ask a question during synchronous teaching sessions.
  2. Ask a question on the stack exchange.
  3. Ask a question during office hours.
  4. When all else fails ask us a question by e-mail.

Be realistic about the speed and level of detail you can expect from e-mail.

I We aim to answer all reasonable queries within 3 working days.

I We will not be checking e-mail in the evenings, on weekends, or during holidays.

If the issue still isn’t resolved, contact your Student-Staff Liaison Committee (SSLC) representative.

 

 

Learning Outcomes

I Identify the characteristics of real-time systems.

I Understand what is a control system.

I Know the distinction between time-aware and reactive systems.

I Be able to characterise different kinds of response time constraints.

Week of 19th January 2021

What Are Real-time Systems?

 

Real-time systems are computer systems that monitor, respond to, or control an external environment subject to time constraints imposed by that environment.

Real-time systems are computer systems that monitor, respond to, or control an external environment subject to time constraints imposed by that environment.

What imposes the deadline for computation in a ticket gate?

The need for correct results at correct times is common in everyday life.

For example,

I It is equally useless to be told the wrong weather forecast before you leave as it is to be told the right information after you leave.

I Both incorrect and late responses are equally bad when submitting your coursework.

Note that, real-time does not mean real-fast!

I A real-time system only needs to operate quickly enough to meet its deadlines.

I If deadlines are far apart, the real-time system can actually operate quite slowly.

 

A Typical Real Time System

Source: Burns and Wellings

Real-time Vs Traditional Computer Systems

A traditional computer system requests inputs when required by the program. I A computer simulation, for example, might request a file name when needed for saving outputs.

A real-time computer system reacts to inputs (taking time into consideration). I The system performs operations initiated by inputs from the environment (i.e., from the user, a sensor, or the clock).

Real-time and Control

A control system reacts to inputs by acting in its environment.

Real-time systems engineering occurs at the intersection between control engineering and computer engineering.

Need for Reliability

A common characteristic of real-time systems is the need for reliability.

Many operate in environments where failure could be catastrophic.

Such systems are called safety-critical systems:

I For a traditional computer program, failure generally results in nothing more serious than loss of data.

I For a real-time computer system, failure could result in the loss of life or damage to equipment.

Real-time Systems are often Embedded Systems

The computer system is physically connected to the external environment through sensors, actuators, and other input-output interfaces.

 

Typical Vs Embedded OS Configurations

Typical OS Configuration               Typical Embedded Configuration

Source: Burns and Wellings, RTS, 3rd ed.

Example: Manufacturing

The physical system consists of several devices, e.g., machine tools, manipulators, cameras, which all need to be controlled and coordinated by the computer.

Example: Driver Assistance System

Many modern cars contain real-time driver assistance systems.

Example: Mercedes S-class contains 144 ECUs, 65 million lines of code, 200 microprocessors.

 

 

 

Event or Time-driven Systems

Real-time Classifications

Time-aware — system makes explicit reference to time ex. Start vacuum cleaning at 8.00 pm.

Reactive — system must produce output within deadline

(as measured from input)

 

 

I Release activity at 9.00am.

I Release activity at 9.00am.

I Release activity every 25ms (a periodic activity).

I Release activity at 9.00am.

I Release activity every 25ms (a periodic activity).

Event-triggered: computation is triggered by an external or internal event.

The released activity is called:

I Release activity at 9.00am.

I Release activity every 25ms (a periodic activity).

Event-triggered: computation is triggered by an external or internal event.

The released activity is called:

I Periodic if there is a bound on the minimum arrival interval of the event.

I Release activity at 9.00am.

I Release activity every 25ms (a periodic activity).

Event-triggered: computation is triggered by an external or internal event.

The released activity is called:

I Periodic if there is a bound on the minimum arrival interval of the event.

I Sporadic if the minimum arrival interval between events has random jitter.

I Release activity at 9.00am.

I Release activity every 25ms (a periodic activity).

Event-triggered: computation is triggered by an external or internal event.

The released activity is called:

I Periodic if there is a bound on the minimum arrival interval of the event.

I Sporadic if the minimum arrival interval between events has random jitter.

→ Sporadic events may occur at any time, but two successive events must be separated by at least T time units.

I Release activity at 9.00am.

I Release activity every 25ms (a periodic activity).

Event-triggered: computation is triggered by an external or internal event.

The released activity is called:

I Periodic if there is a bound on the minimum arrival interval of the event.

I Sporadic if the minimum arrival interval between events has random jitter.

→ Sporadic events may occur at any time, but two successive events must be separated by at least T time units.

I Aperiodic if there is no such bound.

I Release activity at 9.00am.

I Release activity every 25ms (a periodic activity).

Event-triggered: computation is triggered by an external or internal event.

The released activity is called:

I Periodic if there is a bound on the minimum arrival interval of the event.

I Sporadic if the minimum arrival interval between events has random jitter.

→ Sporadic events may occur at any time, but two successive events must be separated by at least T time units. I Aperiodic if there is no such bound.

→ Aperiodic tasks have irregular arrival times

 

 

 

Deadlines

A Hard Deadline must always be met since failure to do so will result in failure of the entire system.

A Hard Deadline must always be met since failure to do so will result in failure of the entire system.

A Firm Deadline may be missed, but if so, then the result is useless.

A Hard Deadline must always be met since failure to do so will result in failure of the entire system.

A Firm Deadline may be missed, but if so, then the result is useless.

A Soft Deadline may be missed occasionally (although late completion is undesirable).

 

A Hard Deadline must always be met since failure to do so will result in failure of the entire system.

A Firm Deadline may be missed, but if so, then the result is useless.

A Soft Deadline may be missed occasionally (although late completion is undesirable).

A real-time system will usually contain a mixture of tasks with different types of

A Hard Deadline must always be met since failure to do so will result in failure of the entire system.

e.g., deploying the airbags in a car has a hard deadline.

A Firm Deadline may be missed, but if so, then the result is useless.

A Soft Deadline may be missed occasionally (although late completion is undesirable).

A real-time system will usually contain a mixture of tasks with different types of

A Hard Deadline must always be met since failure to do so will result in failure of the entire system.

e.g., deploying the airbags in a car has a hard deadline.

A Firm Deadline may be missed, but if so, then the result is useless.

e.g.,    a radar reading that is needed to correct the path of an aeroplane.

A Soft Deadline may be missed occasionally (although late completion is undesirable).

A real-time system will usually contain a mixture of tasks with different types of

A Hard Deadline must always be met since failure to do so will result in failure of the entire system.

e.g., deploying the airbags in a car has a hard deadline.

A Firm Deadline may be missed, but if so, then the result is useless.

e.g.,    a radar reading that is needed to correct the path of an aeroplane.

A Soft Deadline may be missed occasionally (although late completion is undesirable).

e.g.,    the drinks vending machine might have a soft deadline for dispensing a drink.

A real-time system will usually contain a mixture of tasks with different types of

 

 

 

Concurrency

Performing Multiple, Concurrent Tasks

The environment is:

I Inherently parallel – lots of different things can be happening at the same time, so a real-time system may need to react to several different events at the same time.

I Non-deterministic – events occur at unpredictable times, so a real-time system needs to deal with events as and when they happen.

Performing Multiple, Concurrent Tasks

The environment is:

I Inherently parallel – lots of different things can be happening at the same time, so a real-time system may need to react to several different events at the same time.

I Non-deterministic – events occur at unpredictable times, so a real-time system needs to deal with events as and when they happen.

The operations carried out by a real-time system are called tasks, processes or threads.

I The ability to run these operations in parallel is called concurrency.

Time

running

waiting

waiting running

waiting

waiting running

waiting

  waiting
       
running running running

Task A

Task B

General facilities required to program RTS

Task management (to run tasks concurrently):

I Scheduling tasks (deciding which task to run when)

I Memory management (allow tasks to be stopped and resumed) I Inter-task communication and synchronization

Resource management (to interface with environment): I Real-time clock

I Input/Output

I Interrupt handling

 

 

 

Summary

Real-time systems are computer systems that monitor, respond to, or control an external environment subjected to time constraints imposed by the external environment.

Real-time systems interact with their environment, perform multiple, concurrent tasks and operate within response time constraints.

Real-time structures are:

I Time triggered.

I Event triggered.

Real-time classifications include:

I Time aware.

I Reactive systems.

I Soft, hard, firm deadlines.

6CCS3RSC/7CCSMRTS ‘ 2021 King’s College London. Unauthorised Reproduction Prohibited.

Suggested Reading

I A. Burns and A. Wellings. Real Time Systems and Programming Languages:

Ada, Real-Time Java and C/Real-Time POSIX. 4th ed. Pearson, 2009, §1.1-1.3.

6CCS3RSC/7CCSMRTS ‘ 2021 King’s College London. Unauthorised Reproduction Prohibited.