Design Problem
Design Problem
RELAY LOGIC
Design a controller to maintain the water level in a tank between two limits. The water level
should not go below a low level point called “Low” and should not exceed a height called
“High.” The level of the water can be increased using an electric pump. A limit switch will
close when the water level is below “Low” and another limit switch will close when the water
level is above the height ”High.” Otherwise both limit switches are open.
Our first step is to change the description of the problem into a form that can be represented by logic
states. One of method of doing this is to write down the logic equation:
In this example the logic equation is very simple and very easy also to simplify. In more complex processes
writing down the logic equation directly can be facilitated by using a state diagram. This forces us to
consider the states of the process. In this case, the important state is the state of the pump, whether it is
on or not. The state diagram for the tank filling process is shown in figure 2.9. The red circles indicate
the state of the process and the arrows or edges represent the transitions and what caused them to occur.
From the state diagram we can see that the logic equation is
Pump on = [High · Pump on + (Pump on) · Low] · [High · (Pump on) + (Pump on) · Low] (2.2)
= [High · Pump on + (Pump on) · Low] (2.3)
Tank High
Tank low
We can write down the solution in logic algebra and simplify the equation to a minimum. This process
is facilitated by using a Karnaugh map as shown in table 2.1. The idea behind a Karnaugh map is that
there is only a one bit change from a line to the next line, or from a column to the next column. Look
closely at figure 2.1 and you will see that this is true. In the Karnaugh map, a ”1” indicates that the
pump is ”on” and a ”0” indicates that the pump is ”off”. This is shown in red. The principle of the
Karnaugh map is that if there is a ”1” in neighbouring columns or rows then that value does not matter.
For example, in the first two rows, the ”Low” bit changes from ”0” to ”1” but the ”High” bit does not
change. This means that if ”Pump on” is true then it does not matter what the condition of ”Low” is,
”High” must be zero. Similarly, in the second row, while ”High” is not true and ”Low” is true, it does not
matter about the state of the pump.
2.3. A DESIGN PROBLEM 11
Table 2.1: Karnaugh Map of the fluid-tank level controller. Here <High means “Is it greater than the
HIGH level?” and >Low means “Is it less than the LOW level?”
Using the Karnaugh Map shown in table (2.1), we can write the logic expression
A flow diagram of this problem is shown in figure 2.10. What is the difference between a state-diagram
and a flow-chart? A flow-chart is related to decisions to do things, whereas the state-diagram is about
transitions from one state to another.
Realization
The next step is the realization of the logic statement. Two realizations are shown in figure 2.11 and figure
2.12.
12 CHAPTER 2. RELAY LOGIC
Figure 1: A flow-chart
Begin
Yes
Fluid High? Pump Off
No
Fluid Low?
No
Yes
Pump On? Pump On
No
End
Pump on
Fluid Level High
Figure 2.11: Sample realizations of the water tank controller using logic gates
Pump On Pump
Figure 2.12: Sample realizations of the water tank controller using relay logic