engg4420 ‐‐ lecture 2

16
CHAPTER 1: REALTIME COMPUTER CONTROL G. F. Franklin et al., ``Feedback Control of Dynamic Systems,`` 5th Edition, Pearson, 2006. S. Bennett, ``RealTime Computer Control,`` Pearson Education. R. Muresan, ENGG4420 Lab Manual, 2010. REFERENCES: ENGG4420 ‐‐ LECTURE 2 September0810 12:49 PM CHAPTER 1 Page 1 ENGG4420 -- LECTURE 2, UoG, RADU MURESAN

Upload: others

Post on 09-Nov-2021

2 views

Category:

Documents


0 download

TRANSCRIPT

Page 1: ENGG4420 ‐‐ LECTURE 2

CHAPTER 1: REAL‐TIME COMPUTER CONTROL

G. F. Franklin et al., ``Feedback Control of Dynamic Systems,`` 5th Edition, Pearson, 2006.

S. Bennett, ``Real‐Time Computer Control,`` Pearson Education.

R. Muresan, ENGG4420 Lab Manual, 2010.○

REFERENCES: •

ENGG4420 ‐‐ LECTURE 2                                            September‐08‐1012:49 PM

CHAPTER 1 Page 1

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 2: ENGG4420 ‐‐ LECTURE 2

SECTIONS

SECTION 1.1: Real‐Time Definitions and Development

SECTION 1.2: Dynamic Models•SECTION 1.3: Feedback Control •SECTION 1.4: PID•SECTION 1.5: Tuning•SECTION 1.6: Implementing Real‐Time Control Algorithms 

CHAPTER 1 Page 2

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 3: ENGG4420 ‐‐ LECTURE 2

SECTION 1.1 REAL‐TIME DEFINITIONS AND DEVELOPMENTThe application of digital computers to industrial control began in the late 1950s.

In late 1960s the real‐time operating systems were developed.

By 1970, it was becoming possible to consider having two computers on the system, one simply acting as stand‐by in the event of failure.

The development of microprocessor in 1974 made possible the use of distributed computer control systems.

COMPUTER CONTROL TASK OPERATIONSequential mode: plant input, control, plant output and communication tasks are all being carried out in turn and, with the sequence then being repeated indefinitely.

Parallel mode: various tasks are executed concurrently.

Computers with a single processor unit are in fact performing as pseudo‐concurrent operation.

Task synchronization○Sharing of resources between tasks.○

Concurrency (or pseudo‐concurrency) problems:•

CHAPTER 1 Page 3

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 4: ENGG4420 ‐‐ LECTURE 2

What is Real Time?

Within this context: real‐time response is the ability to reliably and, without fail, respond to an event, or perform an operation, within a guaranteed time period.

Ex. ‐‐ chemical plant ...○

Real‐time is a quantitative notion of time and is measured using a physical (real) clock.

While dealing with logical time, time readings from a physical clock are not necessary for ordering the events. Ex. ‐‐ library software ...

Logical time (or virtual time) deals with a qualitative notion of time and is expressed using event ordering relations such as before, after, sometimes, eventually, preceeds, succeeds, etc.

Both the computer system and the controlled system (environment) use the same time scale.

A system is called a real‐time system, when we need quantitative expression of time (i.e., real time) to describe the behaviour of the system.

Any system whose behaviour can completely be described without using any quantitative expression of time is not a real‐time system.

CHAPTER 1 Page 4

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 5: ENGG4420 ‐‐ LECTURE 2

More Definitions of Real‐Time Systems

This is usually because the input corresponds to some movement in the physical world, and the output has to relate to that same movement.

i.

The lag from input time to output time must be sufficiently small for acceptable timeliness.

ii.

General Definition: Any system in which the time at which the output is produced is significant

1.

Real‐time systems are those which must produce correct responses within a definite time limit otherwise performance degradation and/or malfunction results;

2.

Or, a real‐time system reads inputs from the plant and sends control signals to the plant at times determined by plant operational considerations ‐ not at times limited by the capabilities of the computer system.

3.

A real‐time program is a program for which the correctness of operation depends on both the logical results of the computation and the time at which the results are produced.

4.

CHAPTER 1 Page 5

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 6: ENGG4420 ‐‐ LECTURE 2

EXAMPLE APPLICATIONS OF REAL‐TIME SYSTEMS

INDUSTRIAL APPLICATIONS: major usage of real‐time systems

Type of process control application○Real‐time computer periodically monitors plant conditions ‐‐ readings of pressure, temperature, and chemical concentration of the reaction chamber

Automation system decides based on the readings the corrective actions necessary at that instant in order to maintain the chemical reaction at the certain rate.

The actions decided upon must be carried out within certain predefined time bounds

Typical time bounds for chemical plants are from a few microseconds to several milliseconds.

Example 1: Chemical Plant Control •

CHAPTER 1 Page 6

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 7: ENGG4420 ‐‐ LECTURE 2

Example of plant automation system○The work product (partially assembled car) moves on a conveyor belt

Several workstations are place along the conveyor belt ‐‐ each workstation performs specific operations: fitting engine, etc.

At each workstation a sensor senses the arrival of the next partially assembled product

There is time constraint imposed on the workstation computer ‐‐ work must be completed before moving to the next step

Time bounds are typically 100x of ms.○

Example 2. Automated Car Assembly Plant•

FitEngine

FitDoor

FitWheel Spray

Paint

Conveyor Belt

Chassis

Finished Car

CHAPTER 1 Page 7

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 8: ENGG4420 ‐‐ LECTURE 2

Example 3: Supervisory Control and Data Acquisition (SCADA)SCADA are a category of distributed control systems and in general monitor and control a large number of distributed events

In SCADA systems, sensors are scattered at various geographic locations to collect raw data that is processed and stored in real‐time database

EMS helps to carry out load balancing in an electrical energy distribution network

Example of SCADA is the Energy Management System (EMS)

Another SCADA example is a system that monitors and controls traffic in a computer network ‐‐makes the router change its traffic routing policy dynamically based on sensed load in different segments of the network.

TIME CONTRAINTS in SCADA applications is that the sensors must sense the system state at regular intervals (every few ms) and the data must be processed before the next state is sensed.

CHAPTER 1 Page 8

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 9: ENGG4420 ‐‐ LECTURE 2

MEDICAL: few examples are: robots, MRI scanners, radiation therapy equipment, bedside monitors, and Computerized Axial Tomography (CAT)

Radioactive material is used in various treatments in medical field

If the radioactive material gets dislocated and falls a robot is used to restore the radioactive material to its proper position.

The robot walks into the room containing the material, picks it up, and restores it to its proper position.

The robot needs to sense the environment frequently and based on this information it needs to plan its path.

The real‐time constraint on the path planningtask of the robot is that unless it plans the path fast enough after an obstacle is detected, it may collide with it.

Time constraints in this case are a few ms.○

Example 4: Robot used in recovery of displaced radioactive material

CHAPTER 1 Page 9

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 10: ENGG4420 ‐‐ LECTURE 2

PERIPHERAL EQUIPMENT: there are many peripheral equipment that contain embedded real‐time systems such as: laser printers, digital copiers, fax machines, digital cameras, scanners etc.

AUTOMOTIVE AND TRANSPORTATION:  a few examples in this area are: automotive engine control systems, road traffic signal control, air‐traffic control, high‐speed train control, car navigation system, and MPFI engine control system

MPFI is a real‐time system that controls the rate of fuel injection and allows the engine to operate at its optimal efficiency, and reduce pollution.

A MPFI system injects fuel into the individual cylinders resulting in better power balance among cylinders as well as higher output.

The computer primarily controls the ignition timing and the quantity of fuel to be injected

Ambient temperature, engine coolant temperature, exhaust temperature, emission gas contents, engine rpm, vehicle road speed, crankshaft position, camshaft position, etc. 

The actions of the computer are determined based on sensor's data from the engine:

Example: Multi‐Point Fuel Injection (MPFI) System

CHAPTER 1 Page 10

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 11: ENGG4420 ‐‐ LECTURE 2

TELECOMMUNICATION APPLICATIONS: examples in this class are: cellular systems, video conferencing, cable modems, etc.

Popular means of mobile communication ‐‐ a cellular system usually maps a city into cells.

In each cell, a base station monitors the mobile handsets present in the cell.

The base station performs various tasks such as locating a user, sending and receiving control messages to a handset, hand‐off calls, etc.

When a mobile user moves away, its received signal strength (RSS) falls at the base station.

The base station monitors RSS and when it fall under a certain threshold value, it hands‐off details of the ongoing call of the mobile to the base station of the cell to which the mobile has moved.

The hand‐off must be completed within a sufficient small predefined time interval so that the user does not feel any temporary disruption of service during hand‐off.

Typically, call hand‐off is required to be achieved within a few ms.

Example: A Cellular System

CHAPTER 1 Page 11

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 12: ENGG4420 ‐‐ LECTURE 2

AEROSPACE: there are various real‐time systems in aerospace: avionics, flight simulation, airline cabin management systems, satellite tracking systems, on‐board aircraft computer, etc.

On‐board computer implements the auto pilot mode ‐‐ the on‐board computer takes over all controls of the aircraft including navigation, take‐off, and landing.

In the auto pilot mode the computer periodically samples velocity and acceleration of the aircraft , amplitude etc.

The sampled data is used to compute X, Y, and Z coordinates of the current position.

The computer compares the current position with the pre‐specified track data.

Before the next sample data values are obtained  the computer computes the deviation from the specified track values and takes any corrective actions that are necessary.

Sampling of parameters and data analysis need to be completed within a few microseconds.

Example: On‐Board Aircraft Computer

CHAPTER 1 Page 12

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 13: ENGG4420 ‐‐ LECTURE 2

INTERNET AND MULTIMEDIA APPLICATIONS: real‐time applications in this area include: video conferencing and multimedia multicast, Internet routers and switches, etc.

CONSUMER ELECTRONICS: in this area there are numerous applications of real‐time systems: set‐top boxes, audio equipment, Internet telephony, microwave ovens, intelligent washing machines, home security systems, air conditioning and refrigeration, toys, cell phones, etc.

A cell phone at any point in time carries out a number of tasks simultaneously such as: convert input voice to digital signals, convert electrical signals from the microphone to output voice signals, sample incoming base station signals in the control channel, etc.

Example: a base station might command a cell phone to switch the ongoing communication to a specific frequency (within  a few ms).

A cell phone response to the communication received from the base station within certain specified time bounds. 

Example: Cell Phones

CHAPTER 1 Page 13

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 14: ENGG4420 ‐‐ LECTURE 2

DEFENCE APPLICATIONS: real‐time systems include: missile guidance systems, anti‐missile systems, satellite‐based surveillance systems, etc.

capable of sensing the target and home on it○Homing becomes easy when the target emits either electrical or thermal radiation.

The missile guidance is achieved by a computer mounted on the missile.

The mounted computer computes the deviation from the required trajectory and effects track changes of the missile to guide it onto the target.

within a few hundreds of microseconds or less depending on the missile speed.

The time constraint on the computer‐based guidance system is that the sensing and the track correction tasks must be activated frequently enough to keep the missile from straying from the target 

Example: Missile Guidance System

OTHER EXAMPLES:  from every day life we have the railway reservation system as a real‐time system but it is in a different sub‐category ... 

CHAPTER 1 Page 14

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 15: ENGG4420 ‐‐ LECTURE 2

A BASIC MODEL OF A REAL‐TIME SYSTEM

CHAPTER 1 Page 15

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N

Page 16: ENGG4420 ‐‐ LECTURE 2

ENGG4420: LECTURE 2 ‐‐ CHARACTERISTICS OF REAL‐TIME SYSTEMSTIME CONSTRAINTS: every real‐time task is associated with some time constraints: a) Deadline associated with tasks ‐‐ common constraint; b) Delay; c) Duration

A.

It is the responsibility of the Real‐Time Operating System (RTOS) to ensure that all tasks meet their respective time constraints.

A logically correct result produced after the deadline would be considered incorrect.

a.

NEW CORRECTNESS CRITERION: correctness in real‐time system implies both logical correctness of results, and correctness of time at which the results are produced.

B.

Safe system is one that does not cause any damage even when it fails

a.

Reliable system is one that can operate for long durations of time without any failure

b.

SAFETY‐CRITICALITY: In many real‐time systems the issues related to safety and reliability are bounded together to generate safety‐critical systems ‐‐ safety‐critical system is required to be highly reliable.

C.

CHAPTER 1 Page 16

EN

GG

4420

-- L

EC

TUR

E 2

, UoG

, RA

DU

MU

RE

SA

N