Karnaugh mapping aids industrial control

Industrial PLC programmers face many problems. Among them: reducing scan time so lower cost PLCs can be used; eliminating "bugs" in ladder logic rungs; and reducing maintenance costs on old ladder logic.Karnaugh mapping can help with all these problems. Karnaugh mapping is a systematic and pictorial way of applying Boolean algebra to reduce complex digital problems.

01/01/2000


Industrial PLC programmers face many problems. Among them: reducing scan time so lower cost PLCs can be used; eliminating 'bugs' in ladder logic rungs; and reducing maintenance costs on old ladder logic.

Karnaugh mapping can help with all these problems. Karnaugh mapping is a systematic and pictorial way of applying Boolean algebra to reduce complex digital problems.

An example of Karnaugh mapping could begin with writing an organized statement about the conditions for going on a picnic. In this case, the alternatives are Sunday and Clear and Calm or Sunday and Clear and Windy. Common sense analysis of the logic says it doesn't matter whether the wind blows, so the picnic statement becomes Sunday and Clear, a much simpler statement (see diagram).

The picnic statement in ladder logic looks something like this:


As the ladder logic shows, the picnic rung is enabled whether it is calm or not calm-so the rung can be written in a simpler form that reduces scan time:


More complicated programs require a more systematic approach for analysis. The principles of Boolean algebra fit that requirement.

The first step is to make a clear problem statement. The next step is to construct a truth table. The truth table uses all combinations of all variables of the problem-day of week, cloudiness, and wind conditions.

An example of the truth table for the picnic problem includes numeric representations in a binary form that make the truth table easier to manipulate.

A = Day of week1 = Sunday0 = Other
B = Cloud cover1 = None0 = Cloudy
C = Wind conditions1 = Calm0 = Windy

421
ABCPicnic
00000
10010
20100
30110
41000
51000
61101
71111

A truth table has a column for every variable. When you let the number of variables = n, a truth table has 2 to the power n rows.

The next step is to construct a Karnaugh (K) map. The K map is square or rectangular in the proportions 2 to 1 and contains 2 to the n squares-one for each row of the truth table. The three-variable map for our picnic problem is rectangular and has eight squares-one for each row of the truth table.

The squares are numbered the same as the rows on the truth table. However, there is a method to the numbering-such that rows represented by the numbers vary by only one variable in adjacent squares. In this way, adjacent squares represent variables that can be removed.

The following is a typical three-variable map:


_
C

C

0

000

1

001

2

010

3

011

6

110

7

111

4

100

5

101

Now, the picnic's truth table can be mapped on the three-variable K map. Row numbers on the truth table correspond exactly to square numbers in the K map. Each square also has a three-digit binary number for the row on the truth table. Notice that adjacent squares vary by only one bit. The result number is represented in bold type.

_
C

C
0 0
000
0 1
001
0 2
010
0 3
011
1 6
110
1 7
111
0 4
100
0 5
101

The two paths of ladder logic are represented by lines six and seven on the truth table. Their appearance in adjacent squares on the K map indicates a condition for rung (logic) reduction. The entire rung is represented by A and B (the first and second bits) with bit C being superfluous. Therefore, if A and B are true, then we go on the picnic! This is the same result we got by applying common sense.

K maps work, but isn't common sense faster? For this level of problem, yes. However, we are laying a foundation for more challenging problems using and establishing a design methodology.

Back in the early days of computers and integrated circuits-after discrete components and before microprocessors-computer integrated circuits were built with bit slice Arithmetic Logic Units. Suppose we have a simple PLC with no math instructions and we need to add two eight-bit numbers. Do we spend $5,000 for a capable PLC or is there some technology that we can use to save money?

The specification calls for a bit slice adder. A truth table for one slice woud look like this:

A B C Carry out Sum
0 00000
1 00101
2 01001
3 01110
4 10001
5 10110
6 11011
7 11111

For this problem, two three-variable maps are needed, one for the Carry out and one for the Sum.


Carry out

 

 

 
Sum
_
C

C
_
C

C

0

000

1

001

_
A

0

000
1 1
001

2

010
1 3
011

_
A
1 2
010

3

011
1 6
110

7

111


A

6

110
1 7
111

4

100

6

110


A
1 4
100

6

110

Write the boolean equation for each adjacent pair of two.

AC+BC+AB = Co

This one cannot be simplified, so each one gets a boolean term.

_ _
ABC+ABC+ABC+ABC = Sum

The ladder logic from the equation would look like this:



Putting it together-an 8-bit adder


Maintenance follows much the same approach as design, except that a truth table must be constructed from the old rung. A traditionally designed rung such as:


would have a truth table that looks like this:

A B C D O
0 0000
1 0001
2 0010
3 0011
4 0100
5 01011
6 0110
7 01111
8 1000
9 10011
10 1010
11 1011
12 1100
13 1101
14 1110
15 11111

The truth table can then be maintenanced and K mapped to form the new rung.

The next step in PLC logic minimization may be to devise rung software or a hand held rung calculator to perform rung minimization. If PLC manufacturers decide to include this rung minimization software in their design packages, a handheld rung calculator would soon become obsolete. A feature of a rung minimization algorithm is rung entry and optimization using the engineer's favorite methods.

Good luck and good logic!

For more information, a good book on Karnaugh mapping is Computer Logic Design by M. Morris Mano, Prentice Hall, 1972. For a more complete Karnaugh mapping discussion, visit www.controleng.com .


Author Information
Lyle R. Hurst, electronics instructor, ITT Technical Institute, Arnold, Mo., and Gary Mintchell, senior editor,




The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by...
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
Women in engineering; Engineering Leaders Under 40; PID benefits and drawbacks; Ladder logic; Cloud computing
Robotic integration and cloud connections; SCADA and cybersecurity; Motor efficiency standards; Open- and closed-loop control; Augmented reality
Controller programming; Safety networks; Enclosure design; Power quality; Safety integrity levels; Increasing process efficiency
This article collection contains several articles on how advancements in vision system designs, computing power, algorithms, optics, and communications are making machine vision more cost effective than ever before.
Featured articles highlight technologies that enable the Industrial Internet of Things, IIoT-related products and strategies to get data more easily to the user.
This digital report will explore several aspects of how IIoT will transform manufacturing in the coming years.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

Cloud, mobility, and remote operations; SCADA and contextual mobility; Custom UPS empowering a secure pipeline
Infrastructure for natural gas expansion; Artificial lift methods; Disruptive technology and fugitive gas emissions
Mobility as the means to offshore innovation; Preventing another Deepwater Horizon; ROVs as subsea robots; SCADA and the radio spectrum
Automation Engineer; Wood Group
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by...
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
Women in engineering; Engineering Leaders Under 40; PID benefits and drawbacks; Ladder logic; Cloud computing
Robotic integration and cloud connections; SCADA and cybersecurity; Motor efficiency standards; Open- and closed-loop control; Augmented reality
Controller programming; Safety networks; Enclosure design; Power quality; Safety integrity levels; Increasing process efficiency
This article collection contains several articles on how advancements in vision system designs, computing power, algorithms, optics, and communications are making machine vision more cost effective than ever before.
Featured articles highlight technologies that enable the Industrial Internet of Things, IIoT-related products and strategies to get data more easily to the user.
This digital report will explore several aspects of how IIoT will transform manufacturing in the coming years.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

Cloud, mobility, and remote operations; SCADA and contextual mobility; Custom UPS empowering a secure pipeline
Infrastructure for natural gas expansion; Artificial lift methods; Disruptive technology and fugitive gas emissions
Mobility as the means to offshore innovation; Preventing another Deepwater Horizon; ROVs as subsea robots; SCADA and the radio spectrum
Automation Engineer; Wood Group
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
The Engineers' Choice Awards highlight some of the best new control, instrumentation and automation products as chosen by...
The System Integrator Giants program lists the top 100 system integrators among companies listed in CFE Media's Global System Integrator Database.
Each year, a panel of Control Engineering and Plant Engineering editors and industry expert judges select the System Integrator of the Year Award winners in three categories.
This eGuide illustrates solutions, applications and benefits of machine vision systems.
Learn how to increase device reliability in harsh environments and decrease unplanned system downtime.
This eGuide contains a series of articles and videos that considers theoretical and practical; immediate needs and a look into the future.
Women in engineering; Engineering Leaders Under 40; PID benefits and drawbacks; Ladder logic; Cloud computing
Robotic integration and cloud connections; SCADA and cybersecurity; Motor efficiency standards; Open- and closed-loop control; Augmented reality
Controller programming; Safety networks; Enclosure design; Power quality; Safety integrity levels; Increasing process efficiency
This article collection contains several articles on how advancements in vision system designs, computing power, algorithms, optics, and communications are making machine vision more cost effective than ever before.
Featured articles highlight technologies that enable the Industrial Internet of Things, IIoT-related products and strategies to get data more easily to the user.
This digital report will explore several aspects of how IIoT will transform manufacturing in the coming years.

Find and connect with the most suitable service provider for your unique application. Start searching the Global System Integrator Database Now!

Cloud, mobility, and remote operations; SCADA and contextual mobility; Custom UPS empowering a secure pipeline
Infrastructure for natural gas expansion; Artificial lift methods; Disruptive technology and fugitive gas emissions
Mobility as the means to offshore innovation; Preventing another Deepwater Horizon; ROVs as subsea robots; SCADA and the radio spectrum
Automation Engineer; Wood Group
System Integrator; Cross Integrated Systems Group
Jose S. Vasquez, Jr.
Fire & Life Safety Engineer; Technip USA Inc.
This course focuses on climate analysis, appropriateness of cooling system selection, and combining cooling systems.
This course will help identify and reveal electrical hazards and identify the solutions to implementing and maintaining a safe work environment.
This course explains how maintaining power and communication systems through emergency power-generation systems is critical.
click me