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

Module 1 RTS PDF

Real-time systems must produce correct responses within definite time limits or performance degradation and malfunctions can occur. Real-time programs have correctness that depends on both logical results and time results are produced. Real-time systems perform both periodic clock-based tasks and aperiodic event-based tasks in response to external events. Hard real-time systems must meet all deadlines, while soft real-time systems can tolerate occasional missed deadlines. Real-time control applications include industrial processes that can be batch, continuous, or laboratory-based.
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)
124 views

Module 1 RTS PDF

Real-time systems must produce correct responses within definite time limits or performance degradation and malfunctions can occur. Real-time programs have correctness that depends on both logical results and time results are produced. Real-time systems perform both periodic clock-based tasks and aperiodic event-based tasks in response to external events. Hard real-time systems must meet all deadlines, while soft real-time systems can tolerate occasional missed deadlines. Real-time control applications include industrial processes that can be batch, continuous, or laboratory-based.
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/ 48

MODULE 1

INTRODUCTION TO
REAL TIME SYSTEMS
Real Time Systems Definition:
Real-Time Systems are those which must produce correct responses within a definite
time limit. Should computer response exceed these time bounds then performance
degradation and /or malfunction results.

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.

Real-time program can be defined as:

A program from which the correctness of operation depends both on the logical
results of the computation and the time at which the results are produced.
2
Classification of Real-Time Systems

Clock-based tasks (Cyclic, periodic)


■ A process plant operates in real time and thus we talk about the plant time constant.
A time constant is a measure of the time taken by a plant to respond to a change in input or load and is
used as a characteristic of the plant.

■ Time constant may be measured in hours for some chemical processes or in ms for an aircraft system.

■ For feedback control the required sampling rate will be dependent on the time constant of the
process to be controlled. The shorter the time constant of the process, the faster the required
sampling rate.

■ Synchronization is usually obtained by adding a clock to the computer system normally


referred to as real-time clock and using a signal from the clock to interrupt the operations
of the computer at some predetermined fixed time interval.

3
Cont..
■ If the clock interrupt is set at a faster rate than the sampling rate, it may count many
interrupts before running a particular task.

■ Clock-based tasks are typically referred to as cyclic or periodic tasks where the terms can
imply either that task is to run once per time period T, or is to run at exactly T unit intervals.

Event-Based Tasks (aperiodic)

■ There are many systems where actions have to be performed not at particular times or time
intervals but in response to some event.

E.g., closing a valve when the liquid level in a tank reaches a predetermined value.

■ Event-based systems are also used extensively to indicate alarm conditions and initiate alarm
actions e.g. temperature or pressure too high.

4
Cont..
■ The system must respond within a given maximum time to a particular event.

■ It normally employs interrupts to inform the computer system that action is required.

■ Some small, simple systems may use polling.

■ Events occurring at non-deterministic intervals and event-based tasks are frequently


referred to as aperiodic tasks.

Interactive Systems

■ There represent the largest class of real-time systems and cover such systems as ATMs,
reservation systems for hotels, airlines etc.

■ The real-time requirement is usually expressed in terms such as ‘the average response time
must not exceed…’
5
Cont..
■ How are they different from event based?

The output depends on the internal state without any response to the environment.

E.g. ATM response depends on the network conditions, account state and not on the outside
factors like users urgency or weather condition outside.

6
Time Constraints
Hard real-time: These are systems that must satisfy deadlines on each and every occasion.

Soft real-time: These are systems for which an occasional failure to meet a deadline does not
compromise the correctness of the system.

■ Typical example of a hard real-time control system is the temperature control loop of the hot-
air blower system.
■ Design of suitable control algorithm for this system involves the choice of the sampling
interval Ts. E.g. 10 ms, then at 10ms intervals the input value must be read, control
calculation carried out and output value calculated, and sent to the heater drive.
■ Example for Hard time constraints associated with event based task : assume that hot air
blower is used to dry a component if exposed to temperature greater than 50 degree Celsius
for more than 10 seconds result in damage.
■ An ATM is an example of a soft time constraint.

7
Constraints can be defined as follows:
HARD SOFT
Periodic (Cyclic) Aperiodic (Event) Periodic (Cyclic) Aperiodic (Event)
𝑛 𝑛
1 1
𝑡𝑐 𝑖 = 𝑡𝑠 ± 𝑎 𝑡𝑒 𝑖 ≤ 𝑇𝑒 ෍ 𝑡𝑐 𝑖 = 𝑡𝑠 ± 𝑎 ෍ 𝑡𝑒 𝑖 ≤ 𝑇𝑎
𝑛 𝑛
𝑖=1 𝑖=1
𝑛 = 𝑇/𝑡𝑠
𝑛 = 𝑇/𝑡𝑠

𝑡𝑐 𝑖 : 𝑇ℎ𝑒 𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙 𝑏𝑒𝑡𝑤𝑒𝑒𝑛 𝑡ℎ𝑒 𝑖 𝑎𝑛𝑑 𝑖 − 1 𝑐𝑦𝑐𝑙𝑒𝑠,


𝑡𝑒 𝑖 : 𝑇ℎ𝑒 𝑟𝑒𝑠𝑝𝑜𝑛𝑠𝑒 𝑡𝑖𝑚𝑒 𝑡𝑜 𝑡ℎ𝑒 𝑖𝑡ℎ 𝑜𝑐𝑐𝑢𝑟𝑎𝑛𝑐𝑒 𝑜𝑓 𝑒𝑣𝑒𝑛𝑡 𝑒,
𝑡𝑠 : 𝑇ℎ𝑒 𝑑𝑒𝑠𝑖𝑟𝑒𝑑 𝑝𝑒𝑟𝑖𝑜𝑑𝑖𝑐 𝑐𝑦𝑐𝑙𝑖𝑐 𝑖𝑛𝑡𝑒𝑟𝑣𝑎𝑙,
𝑇𝑒 : The maximum permitted response time to event e,
𝑇𝑎 : The average permitted response time to event e measured over some time interval T.
n: The number of occurrences of event e within the time interval T, or the number of cyclic repetitions during time
interval T.
a: A small timing tolerance.
8
Classification of Programs

■ Sequential
■ Multi-tasking
■ Real-Time

Sequential

■ Actions are strictly ordered as a time sequence: the behaviour of the program depends only
on the effects of the individual actions and their order, the time taken to perform the action
is not of consequence.

■ Verification, requires two kinds of argument:

– That a particular statement defines a stated action; and

– That the various program structures produce a stated sequence of events.

9
Multi-tasking

■ Actions it is required to perform are not necessarily disjoint in time; it may be necessary for
several actions to be performed in parallel.

■ Such a program may be built from parts (processes or tasks) which are themselves partly
sequential, but which are executed concurrently and which communicate through shared
variables and synchronisation signals.

■ Verification, requires application of arguments for sequential programs and additionally:

– The task (process) can be verified separately only if the constituent variables of each
task (process) are distinct.

– If the variables are shared, the potential concurrency makes the effect of the program
unpredictable, unless there are further rules that govern the sequence of tasks.

– Use of synchronising procedure means that each task can finish at its own speed. 10
Concepts of Computer Control
■ Applications are typically classified as:
➢ Batch
➢ Continuous
➢ Laboratory (or Test)
Batch
■ Batch is used to describe processes in which a sequence of operations are carried out to
produce a quantity of a product (the batch) and in which the sequence is then repeated to
produce further batches.
■ The specification of the product or the exact composition may be changed between the
different runs. E.g. rolling of sheet steel, where ingot being rolled may change in composition
or thickness of the sheet could be changed.
■ An important measure is the set-up time (or change-over time)

11
Real-Time

■ In addition to its actions not necessarily being disjoint in time, the sequence of some of the
actions is not determined by the designer but by the environment- external events occur in
real-time and not depending on internal operations of computer.

■ A real-time program can still be divided into a number of tasks but communication between
the tasks cannot wait for a synchronisation signal: the environment task cannot be delayed.

■ Actual time taken by an action is an essential factor in the process of verification.

12
Summary

■ Computer control involves many different activities that have to be carried out concurrently.

■ Digital computers are sequential devices and an individual computer can give, because of its
speed of operation, the appearance of carrying out activities concurrently.

■ Real-time systems have to carry out both periodic and aperiodic activities.

■ Real-time systems have to satisfy time constants that can be either a hard constant or a soft
(average value) constant.

■ Real-time software is more difficult to specify, design and construct than non-real time
software.

13
Computer control applications in Industrial Process Control could be classified as:

▪ Batch

▪ Continuous

▪ Laboratory

Batch

■ The term batch is used to describe process in which a sequence of operations are carried out
to produce a quantity of a produce (the batch) and the sequence is repeated to produce
further batches.

■ The specification of the product or the exact composition may change between the different
runs. E.g. in steel rolling mill the composition of the ingot may change or the desired sheet
thickness may be changed.

14
Cont..

■ Set-up time (change-over time) is the time taken to prepare the equipment for the next
production batch.

■ It is wasted time in that no output is produced.

■ The ratio of the operation time and set-up time is important in determining suitable batch
size.

■ In mechanical productions the introduction of NC ( Numerically Controlled) machine tools


has let to a shorter setup time.

15
Continuous
■ The term continuous is used for systems in which production is maintained
for long periods of time without interruption, typically over several months
or even years.

■ E.g. Catalytic cracking of crude oil (fractional distillation), ratio of different


fractions can be changed, but without stopping the process.

■ One problem is that during change-over from one specification to the next,
the output of the plant is often not within the product tolerance and must be
scrapped.

■ Trend is to convert systems to continuous.


16
Laboratory Systems
■ They are frequently of the operator-initiated type in that the computer is
used to control some complex experimental test or some computer equipment
used for routine testing.

E.g. Control and analysis of data from vapour phase chromatography.

Another example is the testing of an audiometer, a device used to test hearing. It


produces sound levels at different frequencies. This is tested using a computer.

17
Irrespective of classification typical steps include:

• Data acquisition

• Sequence Control

• Loop control (DDC)

• Supervisory control

• Data analysis

• Data storage

• Human-computer interface (HCI)

18
The objectives of using a computer to control the process will include:

• Efficiency of operation

• Ease of operation

• safety

• Improved products

• Reduction in waste

• Reduced environmental impact

• A reduction in direct labour

19
Sequence Control
■ Generally sequence control occurs in some part of most systems, it often predominates in
batch systems and hence it is used for illustration.
■ Batch systems are widely used in food processing and chemical industries- involves mixing
the raw materials, carrying out some process and then discharging the product.
■ Example shows a typical reactor vessel.
■ A chemical is produced by the reaction of two other chemicals at a specified temperature.
■ The chemicals are mixed together in a sealed vessel (the reactor) and the temperature of the
reaction is controlled by feeding hot or cold water through the water jacket which surrounds
the vessel.
■ Water flow is controlled by adjusting the valves C and D.
■ Flow of material into and out of the vessel is regulated by the valves A, B and E.

20
A simple chemical reactor vessel
21
Cont..
The procedure for the operation of the system may be as follows:
1. Open valve A to charge the vessel with chemical 1.
2. Check the level of the chemical in the vessel (by monitoring the pressure); when correct
amount is admitted, close the valve A.
3. Start the stirrer to mix the chemicals together.
4. Repeat stages 1 and 2 with valve B in order to admit the second chemical.
5. Switch on the three-term controller and supply the set point so that the chemical mix is
heated up to the required reaction temperature.
6. Monitor the reaction temperature; when it reaches the set point, start a timer to time the
duration of the reaction.
7. When the timer indicates that the reaction is complete, switch off the controller and open
valve C to cool down the reactor contents. Switch off the stirrer.
8. Monitor the temperature; when the contents have cooled,open the valve E to remove the
product from the reactor.
22
Typical chemical batch process
23
Cont..
The first figure is part of a larger setup consisting of two reactors.
■ The sequence initiation may be left to a human operator or the computer may be
programmed to supervise the operation (supervisory control).
■ Complete automatic control of the process would avoid the natural tendency of
operators to start a new batch sequence close to the end of their shift; human operators
provide more flexibility in making decisions.
■ Hence many supervisory calculations are mixed; the computer is programmed to carry
out the necessary supervisory calculations and to present its decisions to for
confirmation or rejection by the operator, or alternatively it provides the range of
options to the operator.

24
Cont..
A similar mixture of sequence, loop and supervisory control can be found in continuous systems.
Consider the float glass process shown in fig. below.
■ The raw material – sand, powdered glass and fluxes- is mixed in batches and fed to a furnace.
It melts rapidly to form a molten mixture which flows through the furnace.
■ As the molten glass moves through the furnace it is refined. The process requires accurate
control of temperature in order to maintain quality and to keep fuel cost to a minimum.
■ The molten glass flows out of the furnace and forms a ribbon on the float bath; it has to be
cooled sufficiently so that the ribbons can be cool sufficiently to pass on rollers without
breaking.
■ The ribbon passes into the lehr where it is annealed – again temperature control is required.
■ From the lehr the glass ribbons move down the line towards the cut-up stations at a speed
which is too great for manual inspection so automatic inspection is used.
■ Flaws are marked with spray paint.
■ Then it passes through cutters, to cut to size and lifted and stacked using automatic stackers.

25
Sequence control may vary from large systems with some 20,000 operations to check as in
large boiler turbine unit in power stations or small systems like washing machines.

26
Loop Control (Direct Digital Control)
■ In DDC the computer is the feedback loop as is shown in fig.
■ The computer forms a crucial component in terms of the reliability of the
system and hence great care is needed to ensure that in the event of failure ,
the plant remains in a safe condition.

27
Cont..
■ The usual means of ensuring safety is to make small incremental changes to the actuators on
the plant.
Advantages of DDC over analog control are:
1. Cost- A single computer can control a large number of loops.
2. Performance- digital control offers simpler implementation of a wide range of control
algorithms, improved accuracy and reduced drift.
3. Safety- modern digital hardware is highly reliable with long mean-time between failures and
hence can improve the safety of systems. However, the software used in programmable
digital systems may be much less reliable than the hardware.
■ Development of Integrated Circuits and the microprocessor have that cost of digital
solutions are less than analog.

28
PID Control
■ The PID control algorithm has the general form.
𝑡 𝑇𝑑 𝑑𝑒 𝑡
■ 𝑚 𝑡 = 𝐾𝑝 [𝑒 𝑡 + 1
ൗ𝑇𝑖 ‫׬‬0 𝑒 𝑡 𝑑𝑡 + ]
𝑑𝑡

■ Where e(t)= r(t) - c(t) and c(t) is the measured variable, r(t) is reference value
of set point, and e(t) is error; 𝐾𝑝 is the overall controller gain; 𝑇𝑖 is the
integral action time and 𝑇𝑑 is the derivative action time.
■ For wide range of applications it is hard to improve on the performance of PI or PID
controller.
■ For majority PI is all is needed.

29
Cont.
■ Using a control signal that is made proportional to the error between the desired value of the
output and the actual value of the output is a common strategy.
■ The ratio of control signal to error signal is controlled by 𝐾𝑝 .
■ High value gives a small steady state error and fast response; but with oscillations, which
may not be acceptable. Low value of 𝐾𝑝 gives a slow response and a large steady state error.
■ Integral term integrates out the steady state error. It compensates for changes that occur in the
process being controlled.
■ Derivative term anticipates the error and hence acts to reduce the error that would otherwise
arise from the disturbance.
■ There is much more to DDC than PID but PID works well for 90% of the cases.

30
DDC Applications
■ DDC may be applied to a single-loop system implemented on a small microprocessor or to a
large system involving several hundred loops. Fig. shows a steam boiler control system.

31
Cont.
■ The steam pressure is controlled by regulating the supply of fuel oil to the burner, but to comply with
pollution regulations a particular mix of air and fuel is required.

■ The steam pressure control system generates an actuation signal which is fed to an auto/manual bias station.

■ If the station is switched to auto then the actuation signal is transmitted; if it is manual mode a signal which
has been entered manually is transmitted.

■ The signal from the bias station is connected to two units a high signal selector and a low signal selector each
of which has two inputs and one output .

■ The high selector transmits higher of the two input signals, the low selector transmits lower of the two inputs.

■ The signal from the low selector provides the set point for the DDC loop controlling the oil flow, the signal
from the high selector provides the set point for the air flow controller(two cascaded loops).

■ A ratio unit is installed in the air flow measurement line.

■ A signal from the controller which monitors the combustion flames directly(using optical pyrometer) is added
to the air flow signal to provide the inputs to the air flow controller.

32
Cont.
■ DDC is not necessarily limited to simple feedback control as shown in Fig. below.

33
Cont.
■ It is possible to use techniques such as inferential, feedforward and adaptive or self-tuning
control. Inferential control, shown below refers to the control when variables on which the
feedback control is based cannot be measured directly, but inferred.

34
Cont.
■ Inferential measurements are frequently used in
distillation column control.

■ The four independent variables usually


controlled are liquid levels Ha and Hb in the
accumulator and the reboiler, and the
composition Xa and Xb of the top and bottom
products.

■ The composition can be measured directly by


spectrographic techniques but it is more usual
to measure the temperatures at points Ya and Yb
near the top and bottom of the column and the
pressure P in the column.

■ The temperatures represent the boiling points


of the mixture at the position in the column and
from measurements of pressure and
temperature the composition can be inferred.

35
Cont.
■ Feedforward control is frequently used in the process industries; it involves measuring the
disturbances on the system rather than measuring the outputs and is shown in fig.

36
Adaptive Control
■ Adaptive control can take several forms: a) preprogrammed adaptive control (gain
scheduled control ) b) self-tuning; and c) model-reference adaptive control.

■ Programmed adaptive control is illustrated below. The adaptive mechanism makes preset
changes in auxiliary process measurements. E.g. level of liquid in a vessel.

37
Cont.
■ In an alternative form measurements of changes in the external environment are used to
select the gain or other controller parameters. E.g. in aircraft autostabiliser, control
parameters may be changed according to external pressure.

38
Cont.
■ Adaptive mechanism using self tuning is illustrated below, uses identification techniques to
achieve continual determination of the parameters of the process being controlled.

39
Cont.
■ The model reference technique is shown; it relies on the ability to construct an accurate
model of the process and to measure the disturbances which affect the process.

40
SUPERVISORY CONTROL
■ Adoption of computers for process control has increased the range of activities that can be
performed. Not only do computers perform direct control of plant operation, but also provide
managers and engineers with a comprehensive picture of the status of the plant operations.-
Supervisory Role.

41
Cont..
■ Many of the early computer control schemes used the computer in a supervisory role and not
the DDC. Because
– a) Computers in the early days were not always reliable and caution dictated that the
plant should be able to run in the event of a computer failure;
– b) computers were very expensive, and it was not economically viable to use a
computer to replace the analog control equipment in use.

■ A Computer system that was used to adjust the set points of the existing analog control
system in an optimum manner could perhaps be economically justified.

■ The basic idea of supervisory control shown in figure. The circles labelled C represent
individual controllers in the feedback loop; these can be themselves digital computers, but
their operation is supervised by a digital computer.

42
Cont..
■ An example of supervisory control is shown. Two evaporators are connected in parallel and
material in solution is fed to each unit.

■ The purpose of the plant is to evaporate as much water as possible from the solution.

■ Steam is supplied to heat exchanger linked to the first evaporator and the steam from the
second evaporator is supplied from the vapours boiled off the first stage.

43
Cont..
■ To achieve maximum evaporation the pressures in the chambers must be as high as safety
permits.
■ However, it is necessary to achieve a balance between the two evaporators; if the first is driven at
its maximum rate it may generate too much that the safety thresholds for the second evaporator is
exceeded.
■ A supervisory control scheme can be designed to balance the operation of the two evaporators to
obtain the best overall evaporation rate.

44
CENTRALISED COMPUTER CONTROL
■ Through most of the 1960s computer control implied the use of one central computer for the
control of the whole plant. Mostly due to financial reasons.

■ Although a general-purpose computer can be programmed to perform all of the required


tasks the different time-scales and security requirements for the various categories of tasks
make the programming job difficult, particularly with regards to testing of software.

■ In the ‘60s the computers were not very reliable, mean-time-to-failure of computers were of
the order of few hours and to achieve mean-time-to-failure of 3 to 6 months for the whole
system required defensive programming to ensure the system could continue running in a
safe condition while the computer was repaired.

■ In the ‘60s companies went for digital control with analog backup.

■ By the ‘70s cost of computers reduced making it feasible to use dual computer systems.

45
Cont..
■ Automatic or manual changeover is possible.

■ Weakness- Cabling and interface equipment, software is not duplicated, question over the
reliability of changeover equipment.

46
Hierarchical Systems
■ Tasks are divided according to function, for example with one computer performing DDC
calculations and being subservient to another which performs supervisory control.

47
Cont..
■ A typical company decision making structure
shown in the pyramid; each decision element
receives commands from the level above and
sends information back to that level.

■ Based on the information received from the


element or elements below and the constraints
imposed by the elements at the same level, sends
commands to the elements below and information
to the elements at the same level. Faster response
as you go down the pyramid.

■ Typical example of a hierarchical system is the


batch control using hierarchical system.

■ Three levels- Manager, Supervisor and Unit


Control.

48

You might also like