Sub.: Supervisory Control Fundamentals Lec.2 - Real Time Systems
Sub.: Supervisory Control Fundamentals Lec.2 - Real Time Systems
Sub.: Supervisory Control Fundamentals Lec.2 - Real Time Systems
Almaty, 2019
Real-Time Systems
For long time, SCADA operated independently of other computer-
based systems, and the issue of whether it was a real-time system was
unimportant. Increasingly, however, we are now finding that SCADA is
interfacing with applications that can operate on either a scheduled or
a requested basis. A little thought about what SCADA systems are
expected to do and, for that matter, what the letters in SCADA actually
stand for will lead to the conclusion that SCADA fits somewhere
between real-time and batch operation. It has elements of each. This
unit will consider the aspects of SCADA systems that make them similar
to real-time systems and how those aspects contribute to decisions
affecting the design of SCADA systems.
Learning objectives
1) Understand the terms that deal with time response.
2) Understand the criteria to be considered when selecting
scan interval.
3) Know the factors that affect decisions about where to place
calculation or computing elements.
What Really is Real Time?
• The term real-time control is defined as "pertaining to the
performance of a computation during the actual time that the related
physical process transpires." In the context of SCADA it refers to the
response of the control system to changes in the process. In rigorous
terms, a real-time control system is one that introduces no time delay
or dead time between the reception of a process measurement and
the outputting of a control signal.
• In fact, nearly all control systems must introduce some time delay.
Those that introduce an amount without any measurable effect are
usually called real-time control systems. It may be helpful to think of
batch mode control as being the opposite of real-time control.
• Most systems that control
continuous processes operate in
real time.
• Consider figure 1. The controlled
variable signal is fed to the input of
the control system with no time
delay. The controller operates on
this signal as quickly as possible
with the control algorithm. The
manipulated variable is output to
the process immediately. Time
delays exist in the control side of
the system, but they are usually Figure 1 – Most continuous process control minimizes time delay
kept very short.
• Figure 2 shows a simple SCADA with
the MTU scanning three RTUs.
• The MTU asks RTU number 1 for
flow information about the flow
through FE-101, then it asks each of
the other RTUs about flow through
their flow elements. The scan
interval (sometimes called "scan
period") is the time between one
conversation with an RTU and the
next conversation with the same
RTU. It is obvious that the Figure 2 - MTU Asks Each RTU In Turn About Its Flow Information
constraints of the SCADA system
and its method of low-speed
scanning are going to introduce a
time delay.
Figure 3 plots the delay. The decision whether to
allow the control to be affected by the scan interval can
only be made by someone familiar with the process. At
the early stages of design of the SCADA system, scan
interval can be selected to mitigate against some of the
time delay effects.
In particular, systems for indicating status or for
alerting operators to process conditions that are out of
limits (alarms) attempt to introduce as little time delay as
"economically feasible." This is an important phrase when
considering SCADA. It does not mean "as little time as
possible." It means that the time response to the alarm
must be considered when determining how quickly the
alarm must be made known to the operator.
The following three examples will help to clarify
this. For each example, a process upset or equipment
failure has been recognized. The SCADA system signals
the operator that an alarm condition exists. The operator
then responds to return the process to nominal.
• If the scan rate were acceptable for all except RTU number 5 in a
system of five RTUs, the scanning program could be set up as follows:
• RTU 1, RTU 2, RTU 5, RTU 3, RTU 4, RTU 5, RTU 1...
• As with most quick-fix solutions, there are limits to how often this can
be done without degrading the rest of the system
• If most of the RTUs show process functions that are marginally good
or bad from a timing point of view, the best solution may be to
increase the data rate (in this case, from 1200 bps to 2400 bps). It is
important to realize that doubling the data rate will not reduce the
scan period by one half.
• Communications efficiency is a nonlinear function of data rate. If
many problems are identified and the process requires a response
time that is orders-of-magnitude shorter than the problems will allow,
it may be necessary to review the communications method. It may be
that some functions should be removed from the SCADA system.
• Provision should be made for additions to the amount of data to be
transmitted. Most SCADA systems have functions added to them over
their lives; few have functions deleted. Next topic will address some
of the activities that should not be dependent on the
communications system.
Where to Compute?
• Have you noticed as you travel on a freeway
that is well lighted by mercury or sodium
lamps that the spokes on the hubcaps of the
car next to you are visible and are slowly
turning—sometimes backward, sometimes
forward? This is the "strobe effect," and it
happens because the street lights give off a
burst of light every 1/60 second (every 1/50
second if your power system is 50 Hz). If the
spokes of the hubcap are turning so that a
spoke is at (or near) the same position that
another spoke was 1/60 of a second ago, your
eyes will be fooled into thinking they are
seeing the same spoke.
• Figure 4 shows how this works. To clarify
the illustration, one of the spokes (the one
in the twelve o'clock position) in Figure 4(A)
has been smeared by road tar. If we assume
a 30-inch-diameter wheel with six spokes,
the configuration shown in Figure 4(B) will
happen 1/60 of a second later if the car is
going 53.55 mph, and the configuration in
Figure 4(C) will happen 1/60 second after Figure 4 – Sampling frequency and “aliasing”
that of Figure 4(B).
Now take off the road tar. Imagine that the car is going 107.1 mph or 160.65 mph or any
integral multiple of 53.55 mph. If you could see (or sample) only the relative position of the
spokes, you would have no way to tell how fast the car is going. The spokes would not appear
to move. If the car were going a bit slower, the hubcap would appear to rotate backward; if
the car were moving a bit faster, it would appear to rotate forward slowly.
• So, for a case that has the physical constraints we have described, there is
something magic about 53.55 mph and the sampling frequency of 60 Hz.
• The "magic" is that for every integral multiple of 53.55 mph, a spoke (we
don't know which one) passes through the top vertical position. Now turn
the problem around. Say we know that the range of speeds is between 0
mph and 53.55 mph and we wish to calculate the minimum frequency of
the strobe so we can unambiguously determine the speed. How could we
do it?
• Since we know that it takes 1/60 of a second for the spoke to advance one
position, we must fire the strobe a bit faster than 1 /60 of a second if we
want to sample the situation that exists before the spoke gets there. The
frequency must be faster than 60 Hz, because at 60 Hz one spoke could
masquerade as another. In this example, 60 Hz is called the "aliasing
frequency." For a similar situation in which the number of spokes is changed
to twelve, the aliasing frequency would be 120 Hz.
• This is all very interesting, you say, but what does it have to do with
SCADA? If the physical attributes of the process to be controlled,
including the highest natural frequency of the process, are known the
aliasing frequency can be calculated. The process parameters can be
sampled effectively at frequencies higher than the aliasing frequency but
not at lower frequencies. So this simple test of how frequently the
process must be sampled can tell if the scan frequency is adequate for
sampling.
• If it is adequate and if the measurement is not too critical, the process
can be sampled, the raw data can be scanned, the calculation (or
computation) can be done in the MTU, and the result can be sent back to
the RTU and processed. On the other hand, those processes that have
aliasing frequencies higher than the selected scanning frequency must
have the computations done before the scanning. These computations
must take place in the RTU or some other equipment at the same
location as the RTU.
• The following two examples will illustrate this point.
Example 6
• Given that, from Example 4, a scan interval of one minute is practical,
determine where the calculations should be performed to measure the
amount of water produced from a well using a tank metering system.
Such metering systems are used on irrigated farms to keep track of the
amount of water diverted to a field. Water flows into the tank until it is
full, then stops. A valve is then opened to start the flow of water from the
tank to the field. When the tank becomes empty, the drain valve closes,
and the tank refills. It takes four minutes to fill the tank and four minutes
to drain the tank. Status switches on the drain valve are monitored by the
SC ADA system. When the drain valve is dosed, the refill valve is open and
vice versa.
• Question: Can the flow totalizing be done at the MTU?
Answer:
• Since the scan interval is one minute (from Example 1) and the
aliasing frequency (the highest cycling frequency in the process) is
one cycle (of the refill valve) in four minutes, this calculation would be
an acceptable one to do at the MTU.
Example 7
• Question: Assume the same conditions as in Example 4-6, except that
only forty seconds are required to refill the tank. Can the flow
totalizing be done at the RTU?
Answer:
• Since the drain valve contains operating frequencies (one cycle / 40
seconds or 0.025 Hz) higher than the scan frequency (one cycle / 60
seconds or 0.017 Hz), there will be cycles that are short enough for the
valve to close and then open before the SCADA system completes a scan.
• The MTU will have no way to know that the cycle happened. In this case,
the totalizing should be done at the RTU. Note that the entire operation
may cycle in less than a scan period, but if the part of the cycle that is being
sampled cycles in less than a scan period you will get the wrong
measurement. The RTU should use a sampling frequency higher than the
MTU scan frequency and one designed to cover the process aliasing
frequency. But as we will see in Unit 8, that is not an onerous requirement.
• The periods of scan intervals within most RTUs are usually on the order of
milliseconds.
• Given that some rather simple calculations can be used to determine
which computations should be done at the MTU and which should be
done at the RTU, there remains the question of what hardware
should be used to perform auxiliary calculations at the RTU's location.
Because of the enormous reduction in the cost of small computer
hardware, it is now feasible to purchase a computer that is powerful
enough to complete, in a timely manner, all of the calculations, all of
the instruction to sensors, and all of the storage of historical data that
may be needed at the site. This means that it is possible to have the
computer-based RTU do all of the remote site calculations.
• There are several reasons why you do not want to put "all your eggs
in one basket" and do all of the calculations in the RTU. As will be
explained in next topics, safety-related considerations call for the use
of fail-safe logic for safety shutdowns. Regulatory requirements may
mandate that meter totalizer logic be located in separate locked
enclosures. Small, simple RTUs supported by special-purpose logic
modules may be more price competitive than large, complex RTUs
that can do all of the logic calculations. Finally, some control
calculations require input data from more than one remote site.
These control functions are most logically completed at the MTU.
Simple orders can then be sent to the appropriate RTUs to effect the
controls.
EXERCISES 1
• Real time is relative. For the following process concerns, determine if
the response time is adequate:
a. Customer billing for gas through a meter is issued once per month.
The scan rate is once per hour.
b. Customer billing for gasoline is based on individual fill-ups, each
lasting ninety seconds. The scan rate o f the meter is once per hour.
c. Two meters measuring gas into and out of a pipeline are scanned
every ten minutes. An alarm is generated if the sum of the last four inlet
measurements exceeds the sum of the last four outlet measurements.
EXERCISES 2
• An RTU recognizes that a motor that should be running has stopped.
It is 2:00 a.m. For this motor failure, overtime is not allowed, so no
maintenance crew will be sent to investigate until 9:00 a.m.
a. Would a ten-minute scan rate be acceptable?
b. Would a one-hour scan rate be acceptable?
c. Would a twenty-four-hour scan rate be acceptable?
EXERCISES 3
1) An RTU determines that afire is burning in the chlorine injection
building of a water treatment plant. Because this is an extremely
serious condition, what can the RTU do to notify the MTU without
waiting for the next scan?
2) Describe one way that the scan rate for a single RTU could be
increased beyond the scan rate for the other RTUs.
3) What is the range of data rates for most SCADA systems?
4) Name three things that detract from communications efficiency.
5) In Example 1, what would be the scan interval if a dedicated
telephone line, not a UHF radio, were the communications medium?
EXERCISES 4
• The liquid level in a column gravity separator is observed to cycle with
a two-minute period from one maximum level to the next. What
would be the effect of sampling this level with the following:
a. A two-minute scan rate?
b. A thirty-second scan rate?