REAL TIME SYSTEMS
REAL TIME SYSTEMS
UNITUNIT 1: 1: INTINTRODRODUCTUCTION ION TO TO REAREAL-TIL-TIME ME SYSSYSTEMTEMS:S: HistHistorical orical backgrbackground,ound, RTS Definition, Classification of Real-time Systems, Time constraints, Classification of RTS Definition, Classification of Real-time Systems, Time constraints, Classification of Programs.
Programs. 6 Hours6 Hours
Historical
Historical backgrou
background
nd
•
• Brown and Campbell – 1950 – Earliest proposal - Computer operating in real timeBrown and Campbell – 1950 – Earliest proposal - Computer operating in real time
(as a part of the control system) (as a part of the control system)
Consists of feedback and feed-forward loops Consists of feedback and feed-forward loops Assumption was that, the analog computers can
Assumption was that, the analog computers can be usedbe used Digital computer elements did not were excluded
Digital computer elements did not were excluded
•
• First digital computer – developed for real time conFirst digital computer – developed for real time control – for airborne operationtrol – for airborne operation
Digitrac digital computer – 1954 – u
Digitrac digital computer – 1954 – used to provide an automatic flight andsed to provide an automatic flight and weapons control system
weapons control system
•
• Industrial control – in digital computers usage – late 1950sIndustrial control – in digital computers usage – late 1950s
Computer and electronic system manufacturers – for extending
Computer and electronic system manufacturers – for extending markets – beenmarkets – been out from military uses of – initiated the computer control industries
out from military uses of – initiated the computer control industries 1958, September – Louisiana
1958, September – Louisiana Power and Light Power and Light Company Company - Daystrom - Daystrom computer computer system’
system’s installation – for s installation – for plant monitoring – plant monitoring – in their power station in their power station – at Sterling,– at Sterling, Louisiana
Louisiana
It was not the control system It was not the control system
•
• First industrial computer installation -First industrial computer installation
-T
Texaco Companexaco Company –Ramo-Wooldridge Company - y –Ramo-Wooldridge Company - RWRW-300 system’s installation -300 system’s installation -at Port Arthur refinery in Texas
at Port Arthur refinery in Texas 1959, March 15
1959, March 15thth– Refinery were using – closed – Refinery were using – closed loop control systemloop control system
(Anon, 1959) (Anon, 1959)
•
• 1957-58 - Monsanto Chemical Company – with the cooperation of Ramo-1957-58 - Monsanto Chemical Company – with the cooperation of
Ramo-W
Wooldridge Company – studied the ooldridge Company – studied the control by computer control by computer
•
• 1958, October – it planned to have computer control for ammonia plant – at1958, October – it planned to have computer control for ammonia plant – at
Luling, Louisiana Luling, Louisiana
•
• 1960, July 201960, July 20thth – Commissioning of computer control for ammonia plant at– Commissioning of computer control for ammonia plant at
Luling, Louisiana – began Luling, Louisiana – began
•
• 1960, April 41960, April 4thth– Closed loop control was ach– Closed loop control was achieved – after rewriting – the controlieved – after rewriting – the control
of the program - Noise problems – were
of the program - Noise problems – were faced – on the mefaced – on the measurement of signalsasurement of signals
•
• 1959-60, B. F. Goodrich Company – Acrylanite plant, 1959-60, B. F. Goodrich Company – Acrylanite plant, at Calvert city, Kentucky – at Calvert city, Kentucky –
had the same installation scheme –
had the same installation scheme – as above – and also as above – and also –40 systems of RW–40 systems of RW-300-300 based – were in for supervisory control systems for usi
based – were in for supervisory control systems for using – for steady-stateng – for steady-state optimization calculations – for determining the set-points – for standard analog optimization calculations – for determining the set-points – for standard analog controllers – Here, computer – not con
controllers – Here, computer – not controlling directly – movement of the valvestrolling directly – movement of the valves or other plant actuators
or other plant actuators
•
• 1959 – Plan to had the following installation were begun (Burkitt,1965)1959 – Plan to had the following installation were begun (Burkitt,1965)
•
• 1962, November 1962, November – Ferranti Argus 200 systems - First DDC (Direct Digital– Ferranti Argus 200 systems - First DDC (Direct Digital
Control) system – installed – at ICI ammonia-soda plant at F
Control) system – installed – at ICI ammonia-soda plant at F leetwood,leetwood, Lancashire, UK
Lancashire, UK
It was the large system – 120 control loops (94
It was the large system – 120 control loops (94 of were used actually) – 256of were used actually) – 256 measurements (224 of were used actually) –
measurements (224 of were used actually) – in Fleetwood systemin Fleetwood system
•
• 1961 – Monsanto Company – Texas city plant – and, a hierarchical control1961 – Monsanto Company – Texas city plant – and, a hierarchical control
scheme for petrochemical companies, at Chocolate Bayou – DDC projects – scheme for petrochemical companies, at Chocolate Bayou – DDC projects – began
began
•
•
• Ferranti ArFerranti Argus 200 – Used the gus 200 – Used the ferrite core store – to hold the conferrite core store – to hold the control program -trol program
-PROM – program was held in it PROM – program was held in it
Loaded by – physically inserting pegs into a plug board – each peg representing – Loaded by – physically inserting pegs into a plug board – each peg representing – one bit in the memory word
one bit in the memory word W
Was laborious to set as laborious to set up initiallyup initially W
Was very reliable –since, destruction of the as very reliable –since, destruction of the memory contents - can be memory contents - can be done onlydone only by physical dislodgement of the pegs
by physical dislodgement of the pegs
Security was enhanced – using special power supplies – and, switch-over Security was enhanced – using special power supplies – and, switch-over mechanisms – to protect information held in the main core store
mechanisms – to protect information held in the main core store
The information – was as follows – The information – was as follows – 1. Set points – Loss most undesirable 1. Set points – Loss most undesirable 2. V
2. Valve demand – Presence alve demand – Presence after controlled stoppage allows computer to gainafter controlled stoppage allows computer to gain control of plant immediately and without disturbing the plant (referred to as control of plant immediately and without disturbing the plant (referred to as bumpless transfer)
bumpless transfer)
3. Memory calculations – Loss is tolerable, soon will be updated and only slight 3. Memory calculations – Loss is tolerable, soon will be updated and only slight disturbance to plant
disturbance to plant
4. Future development – Extension to allow for optimization may require 4. Future development – Extension to allow for optimization may require information to be maintained for long periods of time
information to be maintained for long periods of time 5. More rapid
5. More rapid memory access – memory access – were in Ferranti Argus 200 – that were in Ferranti Argus 200 – that of RWof RW-300 and-300 and similar machines
similar machines
Began the second phase of application of computers – to real time control Began the second phase of application of computers – to real time control
•
• 1960s, Early – Computers ware using – combined magnetic core memories and1960s, Early – Computers ware using – combined magnetic core memories and
drum stores – drum eventually giving wa
drum stores – drum eventually giving way to hard disk drivesy to hard disk drives
Ex.:
Ex.: for early 1960s computers – for early 1960s computers –
General Electric 4000 seriesGeneral Electric 4000 series
BM 1800BM 1800
CDC 1700CDC 1700
Foxboro FOX 1, and Foxboro 1AFoxboro FOX 1, and Foxboro 1A
SDSSDS
Ferranti Argus seriesFerranti Argus series
Elliot Automation 900 seriesElliot Automation 900 series
•
• Cost of earlier computer increased – in atteCost of earlier computer increased – in attempts to resolve some problems – andmpts to resolve some problems – and
only one computer –
only one computer – for supervising control and DDC – can for supervising control and DDC – can be justified only – itbe justified only – it was with further problems in development of softwares
was with further problems in development of softwares
•
• Softwares – written by specialists programmers – in machine code Softwares – written by specialists programmers – in machine code – it was– it was
manageable earlier – since, tasks were
manageable earlier – since, tasks were defined clearly and the programs’ lengthdefined clearly and the programs’ length were less
were less
•
• Combining of DDC and supervisory control – Combining of DDC and supervisory control – increased – increased –
1. the code length, for a given application 1. the code length, for a given application 2. the complexity of the progra
2. the complexity of the programmingmming
DDC and supervisory control – were w
DDC and supervisory control – were with very different time-scalesith very different time-scales
DDC control programs – have to interrupt the supervisory control programs’ DDC control programs – have to interrupt the supervisory control programs’ increase in code length – made all the code could be stored in core memory and increase in code length – made all the code could be stored in core memory and also swapping of code between the drum memory and core – to be to done were also swapping of code between the drum memory and core – to be to done were also - Solutions to
also - Solutions to increased code length problems above – were by increased code length problems above – were by
--Development of general purpose real-time operating systems and high-level Development of general purpose real-time operating systems and high-level languages
languages
•
• Late 1960s – RTOS were developed – PROCESS FORTRAN compilers had their Late 1960s – RTOS were developed – PROCESS FORTRAN compilers had their
appearance appearance
•
• Problems and costs of involving in having one computer only for use – made theProblems and costs of involving in having one computer only for use – made the
users to retreat – the smaller systems – for which newly
users to retreat – the smaller systems – for which newly developingdeveloping
microcomputers (like DEC PDP-8, PDP-11, Data General Nova, Honeywell 316, microcomputers (like DEC PDP-8, PDP-11, Data General Nova, Honeywell 316, etc.,) were ideally suited
•
• Microcomputers less cost – made them suitable – to Microcomputers less cost – made them suitable – to load the large number of load the large number of
tasks onto one machine, (b
tasks onto one machine, (by using more than one microcomputer, instead a singley using more than one microcomputer, instead a single computer)
computer)
•
• 1970 – two computers on the systems were using – in which one computer acting1970 – two computers on the systems were using – in which one computer acting
simply stand-by – to function in the ev
simply stand-by – to function in the event of failure of the working coent of failure of the working computer mputer
•
• Throughout 1970 – Developments in ICs and construction techniques in circuitThroughout 1970 – Developments in ICs and construction techniques in circuit
boards – led to - increment in reliability of the systems – reduction in the cost – boards – led to - increment in reliability of the systems – reduction in the cost –
increment in the processor power –
increment in the processor power – increase in the fast memory amount – increase in the fast memory amount – mademade more correct and dependable softwares to be to write
more correct and dependable softwares to be to write
•
• 1974 – microprocessors’ advent – made it economical to use distributed computer 1974 – microprocessors’ advent – made it economical to use distributed computer
control system control system
RTS Definition
RTS Definition
RTS definition (in as The Oxford dictionary of Computing): RTS definition (in as The Oxford dictionary of Computing):
Any system in which the time at which the output is produced is significant. This Any system in which the time at which the output is produced is significant. This is usually because the input corresponds to some movement in the physical world, is usually because the input corresponds to some movement in the physical world, and the output has
and the output has to relate to that same movement. The lag to relate to that same movement. The lag from input time to outputfrom input time to output time must be sufficiently small for acceptable timelines
time must be sufficiently small for acceptable timelines
RTS definition (Cooling – 1991): RTS definition (Cooling – 1991):
Real-time systems are those which must produce correct responses within a Real-time systems are those which must produce correct responses within a definite time limit. Should computer responses exceed these time bounds then definite time limit. Should computer responses exceed these time bounds then performance degradation and/or malfunction results
performance degradation and/or malfunction results
RTS definition (alternate definition): RTS definition (alternate definition):
A real-t
A real-time system reads inputs from the plant and ime system reads inputs from the plant and sends control signals to thesends control signals to the plant at times determined by plant operational considerations – not at times limited by plant at times determined by plant operational considerations – not at times limited by
the capabilities of the computer system the capabilities of the computer system
RTS definition: RTS definition:
A program for which the correctness of operations depends both on the
A program for which the correctness of operations depends both on the logicallogical results of the computations and the time at which the results are produced
results of the computations and the time at which the results are produced
Ex.:
Ex.:Aircraft engine control system – sending response to UNIX workstationsAircraft engine control system – sending response to UNIX workstations
Classification of Real-time Systems
Classification of Real-time Systems
Computer is connected to the env
Computer is connected to the environment within which it is working by a ironment within which it is working by a widewide range of interface devices and
range of interface devices and receives an sends a vareceives an sends a variety of stimuli – in the real timeriety of stimuli – in the real time systems and embedded computers
systems and embedded computers
Ex.: Plant input, plant output, and communication tasks shown in Fig. Ex.: Plant input, plant output, and communication tasks shown in Fig.
They have one common feature – that they are connected by physical devices to They have one common feature – that they are connected by physical devices to processes which are external to the computer.
processes which are external to the computer. These external processes all operate in their These external processes all operate in their own time scales and the co
own time scales and the computer is said to operated I real time if mputer is said to operated I real time if actions carried out inactions carried out in the computer relate to the time scales of the external processes
the computer relate to the time scales of the external processes
Synchronization between the external
Synchronization between the external processes and the internal actions (tasks) – processes and the internal actions (tasks) – carried by the computer:
carried by the computer:
1. Clock based: Synchronization between the above two - if in depends on passages of 1. Clock based: Synchronization between the above two - if in depends on passages of time, actual time of day (clock based RTS)
time, actual time of day (clock based RTS)
2. Event based: Synchronization between the above two – if in depends events 2. Event based: Synchronization between the above two – if in depends events
Ex.:
Ex.:Closure of a switchClosure of a switch
3. Interactive Systems: Relation between the actions in the computer and the system – is 3. Interactive Systems: Relation between the actions in the computer and the system – is much more loosely defined
much more loosely defined Requirement, typically – in the
Requirement, typically – in the form that – a set of operations in form that – a set of operations in the computer should bethe computer should be completed within a predetermined time
completed within a predetermined time Majority of the communication tasks – are
Majority of the communication tasks – are of this categoryof this category
Control tasks:
Control tasks: Even though – not obviously and directly connected to the externalEven though – not obviously and directly connected to the external environment – they need to operated in real time – since, time is usually involved in environment – they need to operated in real time – since, time is usually involved in determining the parameters of the algorithms used. It is useful to
determining the parameters of the algorithms used. It is useful to divide tasks to bedivide tasks to be
carried out by embedded computers into the interactive categories and characteristics of carried out by embedded computers into the interactive categories and characteristics of each class are to be recognized
each class are to be recognized
Types of tasks in real time systems:
1.
1. CloClock-bck-baseased d (Cy(Cycliclic, c, PerPeriodiodic)ic) 2.
2. EvEventent-b-basased (ed (ApeApeririododicic)) 3.
3. InInteteraractctivive e sysyststememss
1.
1. CloClock-bck-based ased TTasks asks (Cy(Cyclicclic, Per, Periodiiodic)c)
Process of the plant - operate in
Process of the plant - operate in real timereal time
Plant time constant: it’s the measure of the time taken by a plant
Plant time constant: it’s the measure of the time taken by a plant to respond to a change to respond to a change inin input or load and
input or load and is used as a characteristic of the plantis used as a characteristic of the plant
May be measured – in hours for some chemical processes or May be measured – in hours for some chemical processes or In ms for an aircraft system
In ms for an aircraft system
Feedback control: It involves the feedback control Feedback control: It involves the feedback control It requires the sampling rate to be de
It requires the sampling rate to be dependent on the time constant pendent on the time constant of the process to beof the process to be controlled
controlled
Sampling rate increases – as the time constant value decreases Sampling rate increases – as the time constant value decreases Synchronization in real time – between the two is – required Synchronization in real time – between the two is – required All the required operations (like measurement, control and
All the required operations (like measurement, control and actuation – within eachactuation – within each sampling interval) – can be able to carry out
sampling interval) – can be able to carry out
Completion of the operation –
Completion of the operation – within the specified time: Dependent onwithin the specified time: Dependent on 1. Number of operations to be performed
1. Number of operations to be performed 2. Speed of the computer
2. Speed of the computer
Real-time clock:
Real-time clock: It’s the clock – added to the computer - to have the synchronization. It’sIt’s the clock – added to the computer - to have the synchronization. It’s signal – is used to interrupt the o
signal – is used to interrupt the operations of the computer – at some perations of the computer – at some predetermined fixedpredetermined fixed time interval
time interval
Computers carry out – plant input, plant output and control tasks in response to the clock Computers carry out – plant input, plant output and control tasks in response to the clock interrupt. If the clock interrupt is at a faster rate than
interrupt. If the clock interrupt is at a faster rate than the sampling rate – count of ethe sampling rate – count of eachach interrupt to be to – until it’s the time to run the tasks.
interrupt to be to – until it’s the time to run the tasks.
Different sampling rates: used in larger plants – where tasks are subdivided into groups Different sampling rates: used in larger plants – where tasks are subdivided into groups – – for controlling different parts of the plant
Clock interrupt – used frequently – to keep a clock and a calendar – and keep the Clock interrupt – used frequently – to keep a clock and a calendar – and keep the computer – aware of both the time and the date
computer – aware of both the time and the date Clock based tasks (cyclic or periodic
Clock based tasks (cyclic or periodic tasks) – here, task is run once tasks) – here, task is run once per time period Tper time period T (cycle time, T) –or run at exactly T unit intervals
(cycle time, T) –or run at exactly T unit intervals
2.
2. Event-based Tasks (Aperiodic)Event-based Tasks (Aperiodic)
Systems in which actions are performed in response
Systems in which actions are performed in response to some events and notto some events and not performed at response at particular times or time intervals
performed at response at particular times or time intervals
Ex.: Ex.:
1. Turing off a pump - Closing a valve when the
1. Turing off a pump - Closing a valve when the level of a liquid tank reacheslevel of a liquid tank reaches predetermined value – like the one in
predetermined value – like the one in - level of fuel in the vehicle fuel tank – reaching- level of fuel in the vehicle fuel tank – reaching the pump nozzle
the pump nozzle
2. Switching a motor off – in response
2. Switching a motor off – in response to the closure of a micro-switchto the closure of a micro-switch indicating - that some desired position had reached
indicating - that some desired position had reached
Used extensively – to indicate –
Used extensively – to indicate – alarm conditions and initiate alarm actionsalarm conditions and initiate alarm actions Ex.: Indication of too high a
Ex.: Indication of too high a temperature or too great a pressuretemperature or too great a pressure Includes the requirement– that the s
Includes the requirement– that the system must respond – within a given maximum timeystem must respond – within a given maximum time to a particular event
to a particular event
Uses the interrupts – to inform the computer system – that action is required. Smaller Uses the interrupts – to inform the computer system – that action is required. Smaller systems – use polling - where the
systems – use polling - where the computer periodically asks (polls) various sensors – tocomputer periodically asks (polls) various sensors – to see if action is required
see if action is required
Aperiodic tasks: Events usually occur at non-deterministic intervals Aperiodic tasks: Events usually occur at non-deterministic intervals Aperiodic tasks – may have
Aperiodic tasks – may have deadlines – expressed in terms of having deadlines – expressed in terms of having start times or finishstart times or finish times or even both.
times or even both. Ex.: T
Ex.: Task may be required to ask may be required to start – within 0.5s of an event start – within 0.5s of an event occurringoccurring T
Task may have to pask may have to produce an output – roduce an output – within 0.5s of an eventwithin 0.5s of an event
3.
3. InInteteraractctivive sye syststememss
Probably represent – the largest class of real time systems Probably represent – the largest class of real time systems
Ex.:
2. Reservation systems for hotels, airlines and car rental co
2. Reservation systems for hotels, airlines and car rental co mpaniesmpanies 3. Computerized tills
3. Computerized tills
Requirement of interactive systems: can be expressed in
Requirement of interactive systems: can be expressed in terms such as ‘the averageterms such as ‘the average response tome must not exceed…’
response tome must not exceed…’
Ex.: Automatic bank teller system might – require an average response time – Ex.: Automatic bank teller system might – require an average response time – notnot exceeding 20s
exceeding 20s
Event-based systems Vs Interactive systems Event-based systems Vs Interactive systems
The two are The two are
1.
1. Same:Same: since, it apparently response to a signal since, it apparently response to a signal from the plant (in this case usuallyfrom the plant (in this case usually a person)
a person)
2.
2. Different:Different: Since, it responds Since, it responds a a time determined by ta a time determined by the internal state of the internal state of thehe computer and without any reference to the environment
computer and without any reference to the environment Ex.: Automati
Ex.: Automatic bank teller c bank teller - does not know that – you will miss a train, or that it’- does not know that – you will miss a train, or that it’ss raining hard and you
raining hard and you are getting wet, but it’s response – depends on how busare getting wet, but it’s response – depends on how bus y they the communication lines and central computers are and also your amount
communication lines and central computers are and also your amount
Clock-based systems Vs Interactive systems Clock-based systems Vs Interactive systems
The two are The two are
1.
1. Same:Same: since, are capable of displaying the date and time, and also they have a realsince, are capable of displaying the date and time, and also they have a real time clock – which enables the
time clock – which enables them to keep track of timem to keep track of time
2.
2. Different:Different: when the test is done whether or not the answer for the question – ‘Canwhen the test is done whether or not the answer for the question – ‘Can the system be tightly synchronized to an external process?’
the system be tightly synchronized to an external process?’ If answer is ‘yes’ – they are clock-ba
If answer is ‘yes’ – they are clock-basedsed If answer is ‘no’ – they are e