Programmable Controllers

Transcription

Programmable ControllersTheory and ImplementationSecond EditionL.A. BryanE.A. Bryan

PROGRAMMABLECONTROLLERST HEORY AND I MPLEMENTATIONSecond EditionL. A. BryanE. A. BryanAn Industrial Text Company PublicationAtlanta Georgia USA

1988, 1997 by Industrial Text CompanyPublished by Industrial Text CompanyAll rights reservedFirst edition 1988. Second edition 1997Printed and bound in the United States of America03 02 01 00 99 98 97 10 9 8 7 6 5 4 3 2 Reproduction or translation of any part of this work beyondthat permitted by Sections 107 and 108 of the 1976 UnitedStates Copyright act are unlawful.Requests for permission, accompanying workbooks, orfurther information should be addressed to:Industrial Text and Video Company1950 Spectrum CircleTower A-First FloorMarietta, Georgia 30067(770) 240-2200(800) PLC-TEXTLibrary of Congress Cataloging-in-Publication DataBryan, L.A.Programmable controllers: theory and implementation/L.A. Bryan,E.A. Bryan.—2nd ed.p.cm.Includes index.ISBN 0-944107-32-X1. Programmable controllers.I. Bryan, E.A.II. Title.TJ223.P76B795 1997629.8'9—dc2196-49350CIPDue to the nature of this publication and because of the different applications ofprogrammable controllers, the readers or users and those responsible for applying theinformation herein contained must satisfy themselves to the acceptability of eachapplication and the use of equipment therein mentioned. In no event shall the publisherand others involved in this publication be liable for direct, indirect, or consequentialdamages resulting from the use of any technique or equipment herein mentioned.The illustrations, charts, and examples in this book are intended solely to illustrate themethods used in each application example. The publisher and others involved in thispublication cannot assume responsibility or liability for actual use based on theillustrative uses and applications.No patent liability is assumed with respect to use of information, circuits, illustrations,equipment, or software described in this text.Industrial Text & Video Company1-800-752-8398www.industrialtext.com

ContentsC ONTENTSPreface . ixAbout the Authors . xHow to Use this Book . xiSECTION 1 INTRODUCTORY CONCEPTSChapter 11-11-21-31-41-51-61-7Introduction to Programmable ControllersDefinition . 4A Historical Background . 5Principles of Operation . 10PLCs Versus Other Types of Controls . 13PLC Product Application Ranges . 22Ladder Diagrams and the PLC . 24Advantages of PLCs . 26Chapter 22-12-22-32-42-5Number Systems and CodesNumber Systems . 34Number Conversions . 41One’s and Two’s Complement . 43Binary Codes . 46Register Word Formats . 50Chapter 33-13-23-33-4Logic ConceptsThe Binary Concept . 56Logic Functions . 57Principles of Boolean Algebra and Logic . 64PLC Circuits and Logic Contact Symbology . 68SECTION 2 COMPONENTS AND SYSTEMSChapter 44-14-24-34-44-54-6Processors, the Power Supply, and Programming DevicesIntroduction . 82Processors . 84Processor Scan . 86Error Checking and Diagnostics . 92The System Power Supply . 98Programming Devices . 104Chapter 55-15-25-35-4The Memory System and I/O InteractionMemory Overview . 110Memory Types . 111Memory Structure and Capacity . 115Memory Organization and I/O Interaction . 119Industrial Text & Video Company1-800-752-8398www.industrialtext.comiii

Contents5-5 Configuring the PLC Memory—I/O Addressing . 1275-6 Summary of Memory, Scanning, and I/O Interaction . 1325-7 Memory Considerations . 133Chapter 66-16-26-36-46-56-66-76-86-96-10The Discrete Input/Output SystemIntroduction to Discrete I/O Systems . 138I/O Rack Enclosures and Table Mapping . 139Remote I/O Systems . 146PLC Instructions for Discrete Inputs . 147Types of Discrete Inputs . 150PLC Instructions for Discrete Outputs . 162Discrete Outputs . 165Discrete Bypass/Control Stations . 177Interpreting I/O Specifications . 178Summary of Discrete I/O . 182Chapter 77-17-27-37-47-57-67-77-87-97-107-11The Analog Input/Output SystemOverview of Analog Input Signals . 186Instructions for Analog Input Modules . 187Analog Input Data Representation . 189Analog Input Data Handling . 196Analog Input Connections . 199Overview of Analog Output Signals . 201Instructions for Analog Output Modules . 201Analog Output Data Representation . 203Analog Output Data Handling . 207Analog Output Connections . 213Analog Output Bypass/Control Stations . 214Chapter 88-18-28-38-48-58-68-7Special Function I/O and Serial Communication InterfacingIntroduction to Special I/O Modules . 218Special Discrete Interfaces . 220Special Analog, Temperature, and PID Interfaces . 224Positioning Interfaces . 233ASCII, Computer, and Network Interfaces . 248Fuzzy Logic Interfaces . 255Peripheral Interfacing . 260SECTION 3 PLC PROGRAMMINGChapter 99-19-29-39-49-59-69-7Programming LanguagesIntroduction to Programming Languages . 276Types of PLC Languages . 276Ladder Diagram Format . 282Ladder Relay Instructions . 289Ladder Relay Programming . 298Timers and Counters . 306Timer Instructions . 308Industrial Text & Video Company1-800-752-8398www.industrialtext.comiv

Contents9-89-99-109-119-129-139-149-15Counter Instructions . 312Program/Flow Control Instructions . 317Arithmetic Instructions . 322Data Manipulation Instructions . 334Data Transfer Instructions . 348Special Function Instructions . 358Network Communication Instructions . 363Boolean Mnemonics . 369Chapter 1010-110-210-310-410-510-6The IEC 1131 Standard and Programming LanguageIntroduction to the IEC 1131 . 374IEC 1131-3 Programming Languages . 380Sequential Function Chart Programming . 403Types of Step Actions . 419IEC 1131-3 Software Systems . 429Summary . 439Chapter 1111-111-211-311-411-511-611-7System Programming and ImplementationControl Task Definition . 444Control Strategy . 444Implementation Guidelines . 445Programming Organization and Implementation . 446Discrete I/O Control Programming . 465Analog I/O Control Programming . 492Short Programming Examples . 521Chapter 1212-112-212-312-4PLC System DocumentationIntroduction to Documentation . 536Steps for Documentation . 537PLC Documentation Systems . 547Conclusion . 549SECTION 4 PLC PROCESS APPLICATIONSChapter 1313-113-213-313-413-513-613-713-813-9Data Measurements and TransducersBasic Measurement Concepts . 554Interpreting Errors in Measurements . 560Transducer Measurements . 565Thermal Transducers . 572Displacement Transducers . 586Pressure Transducers . 588Flow Transducers . 591Vibration Transducers . 599Summary . 608Chapter 14 Process Responses and Transfer Functions14-1 Process Control Basics . 61014-2 Control System Parameters . 614Industrial Text & Video Company1-800-752-8398www.industrialtext.comv

Contents14-314-414-514-614-714-8Process Dynamics . 623Laplace Transform Basics . 632Dead Time Responses in Laplace Form . 644Lag Responses in Laplace Form . 645Types of Second-Order Responses . 653Summary . 665Chapter -1215-13Process Controllers and Loop TuningIntroduction . 670Controller Actions . 671Discrete-Mode Controllers . 676Continuous-Mode Controllers . 690Proportional Controllers (P Mode) . 692Integral Controllers (I Mode) . 706Proportional-Integral Controllers (PI Mode) . 715Derivative Controllers (D Mode) . 725Proportional-Derivative Controllers (PD Mode) . 729Proportional-Integral-Derivative Controllers (PID Mode) . 736Advanced Control Systems . 744Controller Loop Tuning . 747Summary . 766SECTION 5 ADVANCED PLC TOPICS AND NETWORKSChapter 1616-116-216-316-416-516-6Artificial Intelligence and PLC SystemsIntroduction to AI Systems . 774Types of AI Systems . 774Organizational Structure of an AI System . 776Knowledge Representation . 778Knowledge Inference . 781AI Fault Diagnostics Application . 788Chapter 1717-117-217-317-417-517-6Fuzzy LogicIntroduction to Fuzzy Logic . 798History of Fuzzy Logic . 801Fuzzy Logic Operation . 802Fuzzy Logic Control Components . 805Fuzzy Logic Control Example . 828Fuzzy Logic Design Guidelines . 835Chapter 1818-118-218-318-418-518-6Local Area NetworksHistory of Local Area Networks . 848Principles of Local Area Networks . 848Network Topologies . 851Network Access Methods . 857Communication Media . 860Understanding Network Specifications . 862Industrial Text & Video Company1-800-752-8398www.industrialtext.comvi

Contents18-7 Network Protocols . 86618-8 Network Testing and Troubleshooting . 87418-9 Network Comparison and Selection Criteria . 875Chapter 1919-119-219-319-419-519-619-7I/O Bus NetworksIntroduction to I/O Bus Networks . 880Types of I/O Bus Networks . 883Advantages of I/O Bus Networks . 885Device Bus Networks . 886Process Bus Networks . 899I/O Bus Installation and Wiring Connections . 910Summary of I/O Bus Networks . 916SECTION 6 INSTALLATION AND START-UPChapter 2020-120-220-320-420-520-620-7PLC Start-Up and MaintenancePLC System Layout . 922Power Requirements and Safety Circuitry . 931Noise, Heat, and Voltage Considerations . 935I/O Installation, Wiring, and Precautions . 942PLC Start-Up and Checking Procedures . 948PLC System Maintenance . 952Troubleshooting the PLC System . 954Chapter 2121-121-221-321-421-5System Selection GuidelinesIntroduction to PLC System Selection . 962PLC Sizes and Scopes of Applications . 962Process Control System Definition . 969Other Considerations . 981Summary . 982APPENDICESAppendix AAppendix BAppendix CAppendix DAppendix EAppendix FAppendix GLogic Symbols, Truth Tables, and Equivalent Ladder/Logic Diagrams . 987ASCII Reference . 989Electrical Relay Diagram Symbols . 991P&ID Symbols . 993Equation of a Line and Number Tables . 995Abbreviations and Acronyms . 997Voltage-Current Laplace Transfer Function Relationships . 999Glossary . 1001Index . 1025Industrial Text & Video Company1-800-752-8398www.industrialtext.comvii

This page intentionally left blank.

PrefacePREFACESince the first edition of this book in 1988, the capabilities of programmablelogic controllers have grown by leaps and bounds. Likewise, the applicationsof PLCs have grown with them. In fact, in today’s increasingly computercontrolled environment, it is almost impossible to find a technical industrythat does not use programmable controllers in one form or another. Torespond to these phenomenal changes, we introduce the second edition ofProgrammable Controllers: Theory and Implementation.This second edition, like the first, provides a comprehensive theoretical, yetpractical, look at all aspects of PLCs and their associated devices and systems.However, this version goes one step further with new chapters on advancedPLC topics, such as I/O bus networks, fuzzy logic, the IEC 1131-3 programming standard, process control, and PID algorithms. This new edition alsopresents revised, up-to-date information about existing topics, with expandedgraphics and new, hands-on examples. Furthermore, the new layout of thebook—with features like two-tone graphics, key terms lists, well-definedheadings and sections, callout icons, and a revised, expanded glossary—makes the information presented even easier to understand.This new edition has been a labor-intensive learning experience for all thoseinvolved. As with any task so large, we could never have done it alone.Therefore, we would like to thank the following companies for their help inbringing this book to press: Allen-Bradley Company—Industrial ComputerGroup, ASI-USA, B & R Industrial Automation, Bailey Controls Company,DeviceNet Vendors Association, ExperTune Software, Fieldbus Foundation,Hoffman Engineering Company, Honeywell—MicroSwitch Division,LANcity—Cable Modem Division of Bay Networks, Mitsubishi Electronics,Omron Electronics, Phoenix Contact, PLC Direct, PMC/BETA LP, ProfibusTrade Organization, Schaevitz Engineering Company, Siemens Automation,Square D Company, Thermometrics, and WAGO.We hope that you will find this book to be a valuable learning and referencetool. We have tried to present a variety of programmable control operations;however, with the unlimited variations in control systems, we certainly havenot been able to provide an exhaustive list of PLC applications. Only you,armed with the knowledge gained through this book, can explore the truelimits of programmable logic controllers.Stephanie PhilippoEditorIndustrial Text & Video Company1-800-752-8398www.industrialtext.comix

About the AuthorsA BOUT THE AUTHORSL UIS B RYANLuis Bryan holds a Bachelor of Science in Electrical Engineering degree anda Master of Science in Electrical Engineering degree, both from the University of Tennessee. His major areas of expertise are digital systems, electronics, and computer engineering. During his graduate studies, Luis was involved in several projects with national and international governmentalagencies.Luis has extensive experience in the field of programmable controllers. Hewas involved in international marketing activities, as well as PLC applications development, for a major programmable controller manufacturer. Healso worked for a consulting firm, providing market studies and companyspecific consultations about PLCs. Furthermore, Luis has given lectures andseminars in Canada, Mexico, and South America about the uses of programmable controllers. He continues to teach seminars to industry and governmententities, including the National Aeronautics and Space Administration(NASA).Luis is an active member of several professional organizations, including theInstitute of Electrical and Electronics Engineers (IEEE) and the IEEE’sinstrument and computer societies. He is a senior member of the InstrumentSociety of America, as well as a member of Phi Kappa Phi honor society andEta Kappa Nu electrical engineering honor society. Luis has coauthoredseveral other books about programmable controllers.E RIC B RYANEric Bryan graduated from the University of Tennessee with a Bachelor ofScience in Electrical Engineering degree, concentrating in digital design andcomputer architecture. He received a Master of Science in Engineeringdegree from the Georgia Institute of Technology, where he participated in aspecial computer-integrated manufacturing (CIM) program. Eric’s specialties are industrial automation methods, flexible manufacturing systems(FMS), and artificial intelligence. He is an advocate of artificial intelligenceimplementation and its application in industrial automation.Eric worked for a leading automatic laser inspection systems company, aswell as a programmable controller consulting firm. His industrial experienceincludes designing and implementing large inspection systems, along withdeveloping PLC-based systems. Eric has coauthored other publications aboutPLCs and is a member of several professional and technical societies.Industrial Text & Video Company1-800-752-8398www.industrialtext.comx

How to Use this BookHOW TO USE THIS B OOKWelcome to Programmable Controllers: Theory and Implementation. Before you begin reading, please review the following strategies for using thisbook. By following these study strategies, you will more thoroughly understand the information presented in the text and, thus, be better able to applythis knowledge in real-life situations.B EFORE Y OU B EGIN R EADING Look through the book to familiarize yourself with its structure. Read the table of contents to review the subjects you will be studying. Familiarize yourself with the icons used throughout the text:Chapter HighlightsKey Terms Look at the appendices to see what reference materials have been provided.A S Y OU S TUDY E ACH C HAPTER Before you start a chapter, read the Chapter Highlights paragraph at thebeginning of the chapter’s text. This paragraph will give you an overviewof what you’ll learn, as well as explain how the information presented inthe chapter fits into what you’ve already learned and what you will learn. Read the chapter, paying special attention to the bolded items. These arekey terms that indicate important topics that you should understand afterfinishing the chapter. When you encounter an exercise, try to solve the problem yourself beforelooking at the solution. This way, you'll determine which topics youunderstand and which topics you should study further.W HEN Y OU F INISH E ACH C HAPTER At the end of each chapter, look over the list of key terms to ensure thatyou understand all of the important subjects presented in the chapter. Ifyou’re not sure about a term, review it in the text. Review the exercises to ensure that you understand the logic and equations involved in each problem. Also, review the workbook and studyguide, making sure that you can work all of the problems correctly. When you’re sure that you thoroughly understand the information that hasbeen presented, you’re ready to move on to the next chapter.Industrial Text & Video Company1-800-752-8398www.industrialtext.comxi

SECTION O NEINTRODUCTORYCONCEPTS Introduction to Programmable Controllers Number Systems and Codes Logic ConceptsIndustrial Text and Video Company 1-800-752-8398www.industrialtext.com

This page intentionally left blank.Industrial Text and Video Company 1-800-752-8398www.industrialtext.com

C HAPTERO NEINTRODUCTION TOPROGRAMMABLE CONTROLLERSI find the great thing in this world is not somuch where we stand as in what direction weare moving.—Oliver Wendell HolmesIndustrial Text and Video Company 1-800-752-8398www.industrialtext.com

SECTION1IntroductoryConceptsIntroduction toProgrammable ControllersC HAPTERH IGHLIGHTSCHAPTER1Every aspect of industry—from power generation to automobile painting tofood packaging—uses programmable controllers to expand and enhanceproduction. In this book, you will learn about all aspects of these powerful andversatile tools. This chapter will introduce you to the basics of programmablecontrollers—from their operation to their vast range of applications. In it, wewill give you an inside look at the design philosophy behind their creation,along with a brief history of their evolution. We will also compare programmable controllers to other types of controls to highlight the benefits anddrawbacks of each, as well as pinpoint situations where PLCs work best.When you finish this chapter, you will understand the fundamentals ofprogrammable controllers and be ready to explore the number systemsassociated with them.1-1 D EFINITIONProgrammable logic controllers, also called programmable controllers orPLCs, are solid-state members of the computer family, using integratedcircuits instead of electromechanical devices to implement control functions.They are capable of storing instructions, such as sequencing, timing,counting, arithmetic, data manipulation, and communication, to controlindustrial machines and processes. Figure 1-1 illustrates a conceptualdiagram of a PLC rolProgrammableControllerFieldOutputsFigure 1-1. PLC conceptual application diagram.Programmable controllers have many definitions. However, PLCs can bethought of in simple terms as industrial computers with specially designedarchitecture in both their central units (the PLC itself) and their interfacingcircuitry to fi

book—with features like two-tone graphics, key terms lists, well-defined headings and sections, callout icons, and a revised, expanded g