Industrial Control Technology Industrial Control Technology A Handbook for Engineers and Researchers Peng Zhang Beijing Normal University, People’s Republic of China N o r w i c h , NY, USA Copyright © 2008 by William Andrew Inc. No part of this book may be reproduced or utilized in any form or by any means, electronic or mechanical, including photocopying, recording, or by any information storage and retrieval system, without permission in writing from the Publisher. ISBN: 978-0-8155-1571-5 Library of Congress Cataloging-in-Publication Data Zhang, Peng. Industrial control technology : a handbook for engineers and researchers / Peng Zhang. p. cm. Includes bibliographical references and index. 1. Process control--Handbooks, manuals, etc. 2. Automatic control--Handbooks, manuals, etc. I. Title. TS156.8.Z43 2008 670.42--dc22 2008002701 Printed in the United States of America This book is printed on acid-free paper. 10 9 8 7 6 5 4 3 2 1 Published by: William Andrew Inc. 13 Eaton Avenue Norwich, NY 13815 1-800-932-7045 www.williamandrew.com Environmentally Friendly This book has been printed digitally because this process does not use any plates, ink, chemicals, or press solutions that are harmful to the environment. The paper used in this book has a 30% recycled content. NOTICE To the best of our knowledge the information in this publication is accurate; however the Publisher does not assume any responsibility or liability for the accuracy or completeness of, or consequences arising from, such information. This book is intended for informational purposes only. Mention of trade names or commercial products does not constitute endorsement or recommendation for their use by the Publisher. Final determination of the suitability of any information or product for any use, and the manner of that use, is the sole responsibility of the user. Anyone intending to rely upon any recommendation of materials or procedures mentioned in this publication should be independently satisfied as to such suitability, and must meet all applicable safety and health standards. Contents Preface xix 1 Sensors and Actuators for Industrial Control 1.1 Sensors 1.1.1 Bimetallic Switch 1.1.1.1 Operating Principle 1.1.1.2 Basic Types 1.1.1.3 Application Guide 1.1.1.4 Calibration 1.1.2 Color Sensors 1.1.2.1 Operating Principle 1.1.2.2 Basic Types 1.1.2.3 Application Guide 1.1.2.4 Calibration 1.1.3 Ultrasonic Distance Sensors 1.1.3.1 Operating Principle 1.1.3.2 Basic Types 1.1.3.3 Application Guide 1.1.3.4 Calibration 1.1.4 Light Section Sensors 1.1.4.1 Operating Principle 1.1.4.2 Application Guide 1.1.4.3 Specifications 1.1.4.4 Calibration 1.1.5 Linear and Rotary Variable Differential Transformers 1.1.5.1 Operating Principle 1.1.5.2 Application Guide 1.1.5.3 Calibration 1.1.6 Magnetic Control Systems 1.1.6.1 Operating Principle 1.1.6.2 Basic Types and Application Guide 1.1.7 Limit Switches 1.1.7.1 Operating Principle 1.1.7.2 Basic Types and Application Guide 1.1.7.3 Calibration 1 1 1 1 2 4 5 6 6 7 9 9 10 10 11 12 12 15 15 16 19 20 22 22 25 26 27 28 33 38 38 40 43 vii Zhang_Prelims.indd vii 5/24/2008 9:42:07 AM viii CONTENTS 1.1.8 1.2 Zhang_Prelims.indd viii Photoelectric Devices 1.1.8.1 Operating Principle 1.1.8.2 Application Guide 1.1.8.3 Basic Types 1.1.9 Proximity Devices 1.1.9.1 Operating Principle 1.1.9.2 Application Guide 1.1.9.3 Basic Types and Specifications 1.1.10 Scan Sensors 1.1.10.1 Operating Principle 1.1.10.2 Basic Types 1.1.10.3 Technical Specifications 1.1.11 Force and Load Sensors 1.1.11.1 Operating Principle 1.1.11.2 Basic Types 1.1.11.3 Technical Specifications 1.1.11.4 Calibration Actuators 1.2.1 Electric Actuators 1.2.1.1 Operating Principle 1.2.1.2 Basic Types 1.2.1.3 Technical Specification 1.2.1.4 Application Guides 1.2.1.5 Calibrations 1.2.2 Pneumatic Actuators 1.2.2.1 Operating Principle 1.2.2.2 Basic Types and Specifications 1.2.2.3 Application Guide and Assembly on Valve 1.2.3 Hydraulic Actuators 1.2.3.1 Operating Principle 1.2.3.2 Basic Types and Specifications 1.2.3.3 Application Guide 1.2.3.4 Calibration 1.2.4 Piezoelectric Actuators 1.2.4.1 Operating Principle 1.2.4.2 Basic Types 1.2.4.3 Technical Specifications 1.2.4.4 Calibration 1.2.5 Manual Actuators 44 44 47 49 52 53 56 56 63 63 65 69 72 72 77 79 86 87 88 88 90 94 96 98 100 100 104 106 111 111 115 119 123 125 126 132 136 137 141 5/24/2008 9:42:07 AM CONTENTS ix 1.3 142 142 143 149 150 155 155 161 165 166 170 171 172 173 175 175 177 177 179 180 2 Valves 1.3.1 Control Valves 1.3.1.1 Basic Types 1.3.1.2 Technical Specifications 1.3.1.3 Application Guide 1.3.2 Self-Actuated Valves 1.3.2.1 Check Valves 1.3.2.2 Relief Valves 1.3.3 Solenoid Valves 1.3.3.1 Operating Principles 1.3.3.2 Basic Types 1.3.3.3 Technical Specifications 1.3.4 Float Valves 1.3.4.1 Operating Principle 1.3.4.2 Specifications and Application Guide 1.3.4.3 Calibration 1.3.5 Flow Valves 1.3.5.1 Operating Principle 1.3.5.2 Specifications and Application Guide 1.3.5.3 Calibration Computer Hardware for Industrial Control 2.1 Microprocessor Unit Chipset 2.1.1 Microprocessor Unit Organization 2.1.1.1 Function Block Diagram of a Microprocessor Unit 2.1.1.2 Microprocessor 2.1.1.3 Internal Bus System 2.1.1.4 Memories 2.1.1.5 Input/Output Pins 2.1.1.6 Interrupt System 2.1.2 Microprocessor Unit Interrupt Operations 2.1.2.1 Interrupt Process 2.1.2.2 Interrupt Vectors 2.1.2.3 Interrupts Service Routine (ISR) 2.1.3 Microprocessor Unit Input/Output Rationale 2.1.3.1 Basic Input/Output Techniques 2.1.3.2 Basic Input/Output Interfaces 2.1.4 Microprocessor Unit Bus System Operations 2.1.4.1 Bus Operations 2.1.4.2 Bus System Arbitration Zhang_Prelims.indd ix 187 187 190 191 192 201 201 205 207 207 208 210 210 213 213 216 218 219 222 5/24/2008 9:42:08 AM x CONTENTS 2.1.4.3 Interrupt Routing 2.1.4.4 Configuration Registers Programmable Peripheral Devices 2.2.1 Programmable Peripheral I/O Ports 2.2.2 Programmable Interrupt Controller Chipset 2.2.3 Programmable Timer Controller Chipset 2.2.4 CMOS Chipset 2.2.5 Direct Memory Access Controller Chipset 2.2.5.1 Idle Cycle 2.2.5.2 Active Cycle Application-Specific Integrated Circuit (ASIC) 2.3.1 ASIC Designs 2.3.1.1 ASIC Specification 2.3.1.2 ASIC Functional Simulation 2.3.1.3 ASIC Synthesis 2.3.1.4 ASIC Design Verification 2.3.1.5 ASIC Integrity Analyses 2.3.2 Programmable Logic Devices (PLD) 2.3.3 Field-Programmable Gate Array (FPGA) 2.3.3.1 FPGA Types and Important Data 2.3.3.2 FPGA Architecture 2.3.3.3 FPGA Programming 223 224 226 226 229 233 235 235 238 239 240 242 242 243 244 246 247 248 250 251 252 255 System Interfaces for Industrial Control 3.1 Actuator–Sensor (AS) Interface 3.1.1 Overview 3.1.2 Architectures and Components 3.1.2.1 AS Interface Architecture: Type 1 3.1.2.2 AS Interface Architecture: Type 2 3.1.3 Working Principle and Mechanism 3.1.3.1 Master–Slave Principle 3.1.3.2 Data Transfer 3.1.4 System Characteristics and Important Data 3.1.4.1 How the AS Interface Functions 3.1.4.2 Physical Characteristics 3.1.4.3 System Limits 3.1.4.4 Range of Functions of the Master Modules 3.1.4.5 AS Interface in a Real-Time Environment 259 259 259 260 261 263 266 267 269 275 275 275 276 2.2 2.3 3 Zhang_Prelims.indd x 277 277 5/24/2008 9:42:08 AM CONTENTS xi 3.2 279 280 280 289 291 309 319 327 328 333 335 339 344 345 347 351 351 353 3.3 3.4 Zhang_Prelims.indd xi Industrial Control System Interface Devices 3.2.1 Fieldbus System 3.2.1.1 Foundation Fieldbus 3.2.1.2 PROFIBUS 3.2.1.3 Controller Area Network (CAN bus) 3.2.1.4 Interbus 3.2.1.5 Ethernets/Hubs 3.2.2 Interfaces 3.2.2.1 PCI, ISA, and PCMCIA 3.2.2.2 IDE 3.2.2.3 SCSI 3.2.2.4 USB and Firewire 3.2.2.5 AGP and Parallel Ports 3.2.2.6 RS-232, RS-422, RS-485, and RS-530 3.2.2.7 IEEE-488 Human–Machine Interface in Industrial Control 3.3.1 Overview 3.3.2 Human–Machine Interactions 3.3.2.1 The Models for Human–Machine Interactions 3.3.2.2 Systems of Human–Machine Interactions 3.3.2.3 Designs of Human–Machine Interactions 3.3.3 Interfaces 3.3.3.1 Devices 3.3.3.2 Tools 3.3.3.3 Software Highway Addressable Remote Transducer (HART) Field Communications 3.4.1 HART Communication 3.4.1.1 HART networks 3.4.1.2 HART Mechanism 3.4.2 HART System 3.4.2.1 HART System Devices 3.4.2.2 HART System Installation 3.4.2.3 HART System Configuration 3.4.2.4 HART System Calibration 3.4.3 HART Protocol 3.4.3.1 HART Protocol Model 3.4.3.2 HART Protocol Commands 3.4.3.3 HART Protocol Data 353 365 368 371 371 375 376 377 378 378 383 387 387 397 400 402 406 406 409 411 5/24/2008 9:42:08 AM xii CONTENTS 3.4.4 4 HART Integration 3.4.4.1 Basic Industrial Field Networks 3.4.4.2 Choosing the Right Field Networks 3.4.4.3 Integrating the HART with Other Field Networks Digital Controllers for Industrial Control 4.1 Industrial Intelligent Controllers 4.1.1 Programmable Logic Control (PLC) Controllers 4.1.1.1 Components and Architectures 4.1.1.2 Control Mechanism 4.1.1.3 PLC Programming 4.1.1.4 Basic Types and Important Data 4.1.1.5 Installation and Maintenance 4.1.2 Computer Numerical Control (CNC) Controllers 4.1.2.1 Components and Architectures 4.1.2.2 Control Mechanism 4.1.2.3 CNC Part Programming 4.1.2.4 CNC Controller Specifications 4.1.3 Supervisory Control and Data Acquisition (SCADA) Controllers 4.1.3.1 Components and Architectures 4.1.3.2 SCADA Protocols 4.1.3.3 Functions and Administrations 4.1.4 Proportional-Integration-Derivative (PID) Controllers 4.1.4.1 PID Control Mechanism 4.1.4.2 PID Controller Implementation 4.1.4.3 PID Controller Tuning Rules 4.1.4.4 PID Control Technical Specifications 4.2 Industrial Process Controllers 4.2.1 Batch Controllers 4.2.1.1 Batch Control Standards 4.2.1.2 Control Mechanism 4.2.2 Servo Controllers 4.2.2.1 Components and Architectures 4.2.2.2 Control Mechanism 4.2.2.3 Distributed Servo Control 4.2.2.4 Important Servo Control Devices 4.2.3 Fuzzy Logic Controllers 4.2.3.1 Fuzzy Control Principle 4.2.3.2 Fuzzy Logic Process Controllers Zhang_Prelims.indd xii 415 415 420 420 429 429 429 429 437 440 454 455 462 463 466 474 483 488 488 498 512 519 519 520 524 526 532 532 534 536 539 540 544 547 550 558 559 564 5/24/2008 9:42:08 AM CONTENTS xiii 5 Application Software for Industrial Control 5.1 Boot Code for Microprocessor Unit Chipset 5.1.1 Introduction 5.1.2 Code Structures 5.1.2.1 BIOS and Kernel 5.1.2.2 Master Boot Record (MBR) 5.1.2.3 Boot Program 5.1.3 Boot Sequence 5.1.3.1 Power On 5.1.3.2 Load BIOS, MBR and Boot Program 5.1.3.3 Initiate Hardware Components 5.1.3.4 Initiate Interrupt Vectors 5.1.3.5 Transfer to Operating System 5.2 Real-Time Operating System 5.2.1 Introduction 5.2.2 Task Controls 5.2.2.1 Multitasking Concepts 5.2.2.2 Task Types 5.2.2.3 Task Stack and Heap 5.2.2.4 Task States 5.2.2.5 Task Body 5.2.2.6 Task Creation and Termination 5.2.2.7 Task Queue 5.2.2.8 Task Context Switch and Task Scheduler 5.2.2.9 Task Threads 5.2.3 Input/Output Device Drivers 5.2.3.1 I/O Device Types 5.2.3.2 Driver Content 5.2.3.3 Driver Status 5.2.3.4 Request Contention 5.2.3.5 I/O Operations 5.2.4 Interrupts 5.2.4.1 Interrupt Handling 5.2.4.2 Enable and Disable Interrupts 5.2.4.3 Interrupt Vector 5.2.4.4 Interrupt Service Routines 5.2.5 Memory Management 5.2.5.1 Virtual Memory 5.2.5.2 Dynamic Memory Pool 569 570 570 570 571 573 575 575 575 Zhang_Prelims.indd xiii 577 577 578 578 579 579 579 579 581 582 585 586 586 588 589 593 595 597 597 597 598 599 601 601 608 609 610 612 613 616 5/24/2008 9:42:08 AM xiv CONTENTS 5.3 Zhang_Prelims.indd xiv 5.2.5.3 Memory Allocation and Deallocation 5.2.5.4 Memory Requests Management 5.2.6 Event Brokers 5.2.6.1 Event Notification Service 5.2.6.2 Event Trigger 5.2.6.3 Event Broadcasts 5.2.6.4 Event Handling Routine 5.2.7 Message Queue 5.2.7.1 Message Passing 5.2.7.2 Message Queue Types 5.2.7.3 Pipes 5.2.8 Semaphores 5.2.8.1 Semaphore Depth and Priority 5.2.8.2 Semaphore Acquire, Release and Shutdown 5.2.8.3 Condition and Locker 5.2.9 Timers 5.2.9.1 Kernel Timers 5.2.9.2 Watchdog Timers 5.2.9.3 Task Timers 5.2.9.4 Timer Creation and Expiration Real-Time Application System 5.3.1 Architecture 5.3.2 Input/Output Protocol Controllers 5.3.2.1 Server or Manager 5.3.2.2 I/O Device Module 5.3.3 Process 5.3.3.1 Process Types 5.3.3.2 Process Attributes 5.3.3.3 Process Status 5.3.3.4 Process and Task 5.3.3.5 Process Creation, Evolution, and Termination 5.3.3.6 Synchronization 5.3.3.7 Mutual Exclusive 5.3.4 Finite State Automata 5.3.4.1 Models 5.3.4.2 Designs 5.3.4.3 Implementation and Programming 616 618 618 619 621 621 622 622 622 625 626 629 630 632 634 638 639 640 645 646 647 647 650 650 652 653 654 654 655 656 656 657 658 659 660 665 667 5/24/2008 9:42:08 AM CONTENTS xv 6 Data Communications in Distributed Control System 6.1 Distributed Industrial Control System 6.1.1 Introduction 6.1.1.1 Opened Architectures for Distributed Control 6.1.1.2 Closed Architectures for Distributed Control 6.1.1.3 Similarity to Computer Network 6.1.2 Data Communication Model for Distributed Control System 6.1.2.1 Data Communication Models for Open Control Systems 6.1.2.2 Data Communication Models for Closed-Control Systems 6.2 Data Communication Basics 6.2.1 Introduction 6.2.1.1 Data Transfers within an IC Chipset 6.2.1.2 Data Transfers over Medium Distances 6.2.1.3 Data Transfer over Long Distances 6.2.2 Data Formats 6.2.2.1 Bit 6.2.2.2 Byte 6.2.2.3 Character 6.2.2.4 Word 6.2.2.5 Basic Codeword Standards 6.2.3 Electrical Signal Transmission Modes 6.2.3.1 Bit-Serial and Bit-Parallel Modes 6.2.3.2 Word-Parallel Mode 6.2.3.3 Simplex Mode 6.2.3.4 Half-Duplex Mode 6.2.3.5 Full-Duplex Mode 6.2.3.6 Multiplexing Mode 6.3 Data Transmission Control Circuits and Devices 6.3.1 Introduction 6.3.2 Universal Asynchronous Receiver Transmitter (UART) 6.3.2.1 Applications and Types 6.3.2.2 Mechanism and Components 6.3.3 Universal Synchronous Receiver Transmitter (USRT) 675 675 675 Zhang_Prelims.indd xv 676 678 680 680 681 690 691 691 691 693 693 695 695 696 696 697 698 700 700 701 701 702 703 703 705 705 706 706 707 708 5/24/2008 9:42:08 AM xvi CONTENTS 6.3.4 6.4 6.5 Zhang_Prelims.indd xvi Universal Synchronous/Asynchronous Receiver Transmitter (USART) 709 6.3.4.1 Architecture and Components 709 6.3.4.2 Mechanism and Modes 712 6.3.5 Bit-Oriented Protocol Circuits 718 6.3.5.1 SDLC Controller 719 6.3.5.2 HDLC Controller 721 6.3.6 Multiplexers 721 6.3.6.1 Digital Multiplexer 722 6.3.6.2 Time Division Multiplexer (TDM) 723 Data Transmission Protocols 725 6.4.1 Introduction 725 6.4.2 Asynchronous Transmission 726 6.4.2.1 Bit Synchronization 726 6.4.2.2 Character Synchronization 727 6.4.2.3 Frame Synchronization 730 6.4.3 Synchronous Transmission 733 6.4.3.1 Bit Synchronization 734 6.4.3.2 Character-Oriented Synchronous Transmission 737 6.4.3.3 Bit-oriented Synchronous Transmission 739 6.4.4 Data Compression and Decompression 740 6.4.4.1 Loss and Lossless Compression and Decompression 741 6.4.4.2 Data Encoding and Decoding 741 6.4.4.3 Basic Data Compression Algorithms 742 Data-Link Protocols 749 6.5.1 Framing Controls 749 6.5.1.1 High-Level Data Link Control (HDLC) 750 6.5.1.2 Synchronous Data Link Control (SDLC) 752 6.5.2 Error Controls 753 6.5.2.1 Error Detection 754 6.5.2.2 Error Correction 755 6.5.3 Flow Controls 758 6.5.3.1 Stop-and-Wait 758 6.5.3.2 Sliding Window 759 6.5.3.3 Bus Arbitration 760 6.5.4 Sublayers 760 6.5.4.1 Logic Link Control (LLC) 760 6.5.4.2 Media Access Control (MAC) 762 5/24/2008 9:42:08 AM CONTENTS xvii 6.6 Data Communication Protocols 6.6.1 Client–Server Model 6.6.1.1 Two and Three-Tier Client–Server 6.6.1.2 Message Server 6.6.1.3 Application Server 6.6.2 Master–Slave Model 6.6.2.1 Master 6.6.2.2 Slave 6.6.3 Producer–Consumer Model 6.6.3.1 Designs 6.6.3.2 Implementations 6.6.4 Remote Procedure Call (RPC) 763 763 764 765 766 766 767 767 768 768 769 770 System Routines in Industrial Control 7.1 Overview 7.2 Power-On and Power-Down Routines 7.2.1 System Hardware Requirements 7.2.1.1 Low Voltage Power Supply Circuit (LVPSC) 7.2.1.2 Basic Input and Output System (BIOS) 7.2.2 System Power-On Process 7.2.3 System Power-On Self Tests 7.2.3.1 When Does the POST Apply? 7.2.3.2 What does the POST do? 7.2.3.3 Who Does the POST? 7.2.4 System Power-Down Process 7.3 Install and Configure Routines 7.3.1 System Hardware Requirements 7.3.1.1 PCI Address Spaces 7.3.1.2 PCI Configuration Headers 7.3.1.3 PCI I/O and PCI Memory Addresses 7.3.1.4 PCI-ISA Bridges 7.3.1.5 PCI-PCI Bridges 7.3.1.6 PCI Initialization 7.3.1.7 The PCI Device Driver 7.3.1.8 PCI BIOS Functions 7.3.1.9 PCI Firmware 7.3.2 System Devices Install and Configure Routine 7.3.3 System Configure Routine 775 775 776 778 7 Zhang_Prelims.indd xvii 778 780 781 783 783 783 785 785 788 789 790 790 791 791 792 795 796 798 800 802 803 5/24/2008 9:42:08 AM xviii 7.4 7.5 Index Zhang_Prelims.indd xviii CONTENTS Diagnostic Routines 7.4.1 System Hardware Requirements 7.4.2 Device Component Test Routines 7.4.3 System NVM Read and Write Routines 7.4.4 Faults/Errors Log Routines 7.4.5 Change System Mode Routines 7.4.5.1 System Modes List 7.4.5.2 System Modes Transition 7.4.6 Calibration Routines 7.4.6.1 Calibration Fundamentals 7.4.6.2 Calibration Principles 7.4.6.3 Calibration Methodologies Simulation Routines 7.5.1 Modeling and Simulation 7.5.1.1 Process Models 7.5.1.2 Process Modeling 7.5.1.3 Control Simulation 7.5.2 Methodologies and Technologies 7.5.2.1 Manufacturing Process Modeling and Simulation 7.5.2.2 Computer Control System Modeling and Simulation 7.5.3 Simulation Program Organization 7.5.3.1 Simulation Routines for Single Microprocessor Control Systems 7.5.3.2 Simulation Routines for Distributed Control Systems 7.5.3.3 Simulation Routine Coding Principles 7.5.4 Simulators, Toolkits, and Toolboxes 7.5.4.1 MATLAB 7.5.4.2 SIMULINK 7.5.4.3 SIMULINK Real-Time Workshop 7.5.4.4 ModelSim 7.5.4.5 Link for ModelSim 804 805 806 807 808 809 810 811 813 813 814 816 817 818 818 821 826 831 833 836 840 840 840 841 841 841 844 846 847 849 853 5/24/2008 9:42:08 AM Preface Objectives Industrial control consists of industrial process control and industrial production automation. This book applies to both industrial process control and industrial production automation, and it covers the technology in three branches: theory, design, and technology. In recent years, there has been a technical revolution in the semiconductor industry and in the electronics industry, which has significantly advanced the existing technologies in industrial control. The recent technical developments in the semiconductor and electronics industries are mainly represented as these seven aspects: (1) The microprocessor chipsets have been very capable in interrupt handling, data passage, and interface communication. (2) The operating speeds of both microprocessors and programmable integrated circuits have become much faster. (3) The enhancements in the register arrays and the instruction set of microprocessor units have made multitasking or multithreads possible. (4) The sizes of various semiconductor chips are being increased and their production costs are going lower and lower. (5) The controllers of intelligent functionalities are more and more designed to perform various control strategies and protocols. For example, Programmable Logic Control (PLC) controllers implement Ladder Logic, and fuzzy logic controllers operate in terms of fuzzy control theory; the Controller Area Network (CAN) is a very powerful automatic system used even in aerospace. These industrial intelligent controllers are being increasingly used in industrial control so that the establishment of industrial control systems is becoming more and more feasible. (6) The various development tools for both hardware and software are becoming more and more feasible and powerful, which is largely shortening the time for developing software and hardware and is significantly enhancing their quality. (7) The programmable application-specific integrated circuits (ASIC) have now approached an intelligence similar to that of microprocessors, so that they are performing a more important functional role in various control systems. xix Zhang_Prelims.indd xix 5/24/2008 9:42:08 AM xx PREFACE These technical developments in both the semiconductor industry and the electronics industry have advanced industrial control into both realtime control and distributed control. Real-time control requires controllers to capture all the significant target activities and to deliver their responses as swiftly as possible so that system performance is never degraded. Distributed control indicates that controls are performed by a number of microprocessor controllers and executed in a group of independent agents or units that are physically and electronically connected and communicate with each other. This tendency in industrial control has led to the future continuation of both real-time control and distributed control. Consequently, industrial control has been gradually extended from device and machine control to plant and enterprise and industry. To demonstrate that these technical developments satisfy the new industrial control requirements, this book provides comprehensive technical details, including the necessary rationales, methodologies, types, parameters, and specifications, for the devices of industrial control. As a technical handbook for engineers, a technical reference, and an academic textbook for students, this book particularly emphasizes the following seven areas: (1) the sensors, actuators, and valves currently existing in all kinds of industrial control systems; (2) the electronic hardware resident on the microprocessor chipset system; (3) the system interfaces including devices, Fieldbuses, and techniques used for all kinds of industrial control; (4) the digital controllers performing the written programs and the given protocols; (5) the embedded software on a microprocessor chipset for real-time control applications; (6) the data-transmission hardware and protocols between independent agents or units of their own microprocessors; (7) the routines, containing special hardware and software, which are very useful to any kind of industrial control system. All these seven areas are crucial for accomplishing both real-time control and distributed control in industry. This book, therefore, provides the key technologies applied to modern industrial control so that it will be widely available to all the engineers and researchers as well as students who are working in industrial control and its relative disciplines. Zhang_Prelims.indd xx 5/24/2008 9:42:08 AM PREFACE xxi Readership This book has been written primarily as an engineering handbook for those engineers working in the research and development of all kinds of control systems. However, the faculties and postgraduates in universities or colleges will also find this book a useful technical reference for their projects related to control and computer engineering. For university students, this book can be taken as a textbook in classes such as automation, control, computer network, and other related technical subjects. As an engineering handbook, this book will help professionals to design, deploy, and make both manufacture control equipment and production process control systems. Modern industrial control technologies involve three essential phases: machinery, hardware, and software. However, no matter what phase a control engineer is working with, he or she will find that this book is very helpful. As a reference, this book will aid the faculties and postgraduates in universities and colleges to understand all the technical details involved in their research projects on controls. The wide coverage of this book allows it to bridge the gap between theory and technique in control. In addition, it is suitable for practicing postgraduates who wish or need to gain an engineering knowledge of the control topics. This book is also intended to be a course textbook for students studying the subjects of automatic control, computer hardware and electronics, computer network, as well as data communication. Typically, the students will be in electronic engineering, computer control, control systems, or industrial automation courses. Synopsis This book has been organized into chapters, sections, and titled graphs, etc. The first of its seven chapters, “Sensors and Actuators for Industrial Control,” lists the typical sensors, meters, actuators, and valves that are crucial devices located between the front and the rear of industrial control systems. This chapter provides the mechanism concepts, working principles, device types, technical data, and the guides to enable engineers to design and develop industrial control systems. The second chapter, “Computer Hardware for Industrial Control,” provides a detailed list of the types of electronic devices resident on the Zhang_Prelims.indd xxi 5/24/2008 9:42:08 AM xxii PREFACE system given by a microprocessor chipset. These are the microprocessor, programmable peripheral devices, and ASIC. The architecture of the electronic components on a computer motherboard is also plotted so that engineers are able to see how the microprocessor chipset is populated. This chapter provides engineers with an explanation of how microprocessors operate, and also all the necessary technical data for microprocessors to perform. The third chapter, “System Interfaces for Industrial Control,” discusses four types of interfaces: actuator–sensor interface, control system interfaces, human–machine (or human–controller) interfaces, and highway addressable remote transducer (HART) field interfaces. These four interfaces basically cover all the interface devices and technologies existing in various industrial control systems. The actuator–sensor interface is located at the front or rear of the actuator–sensor level to bridge the gap between this level and the controllers. The control system interfaces include the Fieldbus and microprocessor chipset interfaces that are used for connecting and communicating with controllers. The human–machine interfaces contain both the tools and technologies to provide humans with easy and comfortable methods of handling the devices. The HART field communications include the HART protocol and HART interface devices used for field communications in industrial process control. The fourth chapter is entitled “Digital Controllers for Industrial Control.” A controller, similar to a computer, is a system with its own hardware and software capable of performing independent control. This chapter lists the controllers necessary for both industrial production control and industrial process control: they are PLC controllers, CNC controllers, SCADA system, PID controller, batch controllers, servo controllers, and the fuzzy controllers. The title of the fifth chapter is “Application Software for Industrial Control.” The real-time control works with the microprocessor chipset installed on a motherboard or a daughter board. Any microprocessor chipset, except for the inherent microcode and BIO to the CPU, must have a software package consisting of three program systems: boot code, operating system, and application system. This chapter provides engineers with the basic rationale, semantics, principles, work sequence, and program structures for each of these three systems. With reference to this chapter, an experienced software engineer should be capable of programming the design of the whole software package of a microprocessor controller board. The sixth chapter is “Data Communications in Distributed Control System.” Several independent units, each of which will probably have their own microprocessor to monitor a number of mechanical systems, are Zhang_Prelims.indd xxii 5/24/2008 9:42:08 AM PREFACE xxiii physically and electronically connected together. These communicate with each other electronically in an interactive manner so as to form a distributed control system. In distributed control, to set up this type of industrial control system the engineers must understand the connection methodologies and communication rationales between the independent units. This chapter contains all the technical information, data, methodologies, and some theories necessary for the implementation of a distributed control system. The seventh chapter is for the complex topics. These are the topics dealing with subjects that are over and above the basics when compared with the first six chapters. Chapter 7 explains system routines that make the control systems more user friendly and safe to operate. With the Power-up and Power-down routines, the system is able to safely establish and terminate when power is switched ON and OFF, respectively. The installation and configuration routines permit the system devices to communicate with each other through both the software and the hardware. The diagnostic routines then allow engineers to determine the root reasons when a system suffers from a malfunction. Bibliography Writing this book has involved reference to a large number of sources including academic books, journal articles, and in particular industry technical manuals and company introductory or demonstrational materials displayed on web sites of various dates and locations. The number and the scale of the sources are such that it would be practically impossible to acknowledge each source individually in the body of the book. The sources are, therefore, alphabetically ordered and placed at the end of each chapter. This method has two benefits. It enables the author to acknowledge the contribution of other individuals and institutions whose scholarship or products have been referred to in this book. It also provides the reader the convenience of tracing more relevant sources. Acknowledgments My most sincere thanks go to my family: to my wife, Minghua and my son Huza for their unwavering understanding and support. I would also like to thank my younger brother Zhang wei for the ideas he contributed to this book. Zhang_Prelims.indd xxiii 5/24/2008 9:42:08 AM xxiv PREFACE I am extremely grateful to Professor D. T. Pham, director of the Manufacturing Engineering Center, Cardiff University, United Kingdom, who granted me some very valuable suggestions in his review of some portions of this manuscript, and to Dr. Chunquian Ji in Cardiff University and to Dr. Wenbo Mao in Hewlett Packard Research Laboratory, United Kingdom, for their valuable comments and suggestions on the manuscripts. Without the support of these people, there would not have been this book. Peng Zhang Beijing May 2008 Zhang_Prelims.indd xxiv 5/24/2008 9:42:08 AM 1 Sensors and Actuators for Industrial Control 1.1 Sensors 1.1.1 Bimetallic Switch Bimetallic switches are electromechanical thermal sensors or limiters that are used for automatic temperature monitoring in industrial control. They limit the temperature of machines or devices by opening up the power load or electric circuit in the case of overheating or by shutting off a ventilator or activating an alarm in the case of overcooling. Bimetal switches can also serve as time-delay devices. The usual technique is to pass current through a heater coil that eventually (10 s or so) warms the bimetal elements enough to actuate. This is the method employed on some controllers such as cold-start fuel valves found on automobile engines. 1.1.1.1 Operating Principle A bimetallic switch essentially consists of two metal strips fixed together. If the two metals have different expansibilities, then as the temperature of the switch changes, one strip will expand more than the other, causing the device to bend out of the plane. This mechanical bending can then be used to actuate an electromechanical switch or be part of an electrical circuit itself, so that contact of the bimetallic device to an electrode causes a circuit to be made. Figure 1.1 is a diagrammatic representation of the typical operation of temperature switches. There are two directional processes given in this diagram, which cause the contacts to change from open to close and from close to open, respectively: (1) Event starts; the time is zero, the temperature of switch is T1, and the contacts are open. As environment temperature increases, the switch is abruptly heated and reaches the temperature of T2 at some moment causing the contacts to close. (2) When the temperature of the switch is T2 and the contacts are closed, if the environment temperature keeps decreasing, the switch is abruptly cooled, which takes the temperature to T1 at some instance causing the contacts to open again. 1 Zhang_Ch01.indd 1 5/13/2008 5:45:16 PM 2 INDUSTRIAL CONTROL TECHNOLOGY Temperature Contacts closed T2 Differential Decreasing temperature Increasing temperature Environment temperature T1 Contacts open 0 Time Figure 1.1 Typical operation of temperature switches. 1.1.1.2 Basic Types Bimetallic switches and thermal controls basically fall into two broad categories: (1) Creep action devices with slow make and slow break switching action and (2) snap action devices with quick make and quick break switching action. Creep action devices are excellent in either a temperature-control application or as a high-limit control. They have a narrow temperature differential between opening and closing, and generally have more rapid cycling characteristics than snap action devices. Snap action devices are most often used for temperature-limiting applications, as their fairly wide differential between opening and closing temperature provides slower cycling characteristics. Although in its simplest form a bimetallic switch can be constructed from two flat pieces of metal, in practical terms a whole range of shapes is used to provide maximum actuation or maximum force during thermal cycling. As given in Fig. 1.2, the bimetallic elements can be of three configurations in a bimetallic switch: (1) In Fig. 1.2(a), two metals make up the bimetallic strip (hence the name). In this diagram, the black metal would be chosen to expand faster than the white metal if the device were being used in an oven, so that as the temperature rises the black metal expands faster than the white metal. This causes the strip to bend downward, separating from contact so that current is cut off. In a Zhang_Ch01.indd 2 5/13/2008 5:45:17 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 3 Contact Rivet Bimetallic strip (a) Base Set-point adjustment screw Insulating connection spring Switch contact Bimetallic strip (b) Electrical connections Base Contact (c) Bimetallic disc Figure 1.2 The operating principle for bimetallic switches: (a) basic bimetallic switch, (b) adjustable set-point switch, and (c) bimetallic disc switch. refrigerator you would use the opposite setup, so that as the temperature rises the white metal expands faster than the black metal. This causes the strip to bend upward making contact so that current can flow. By adjusting the size of the gap between the strip and the contact, you can control the temperature. (2) Another configuration uses a bimetallic element as a plunger or pushrod to force contacts open or closed. Here the bimetal does not twist or deflect, but instead is designed to lengthen or travel as a means of actuation as illustrated by Fig. 1.2(b). Bimetallic switches can be designed to switch at a wide range of temperatures. The simplest devices have a single set-point temperature determined by the geometry of the bimetal and switch packaging. Examples include switches found in consumer products. Zhang_Ch01.indd 3 5/13/2008 5:45:17 PM 4 INDUSTRIAL CONTROL TECHNOLOGY More sophisticated devices of industrial usages may incorporate calibration mechanisms for adjusting temperature sensitivity or switch-response times. These mechanisms typically set the separation between contacts as a means of changing the operating parameters. (3) Bimetal elements can also be disc shaped as in Fig. 1.2(c). These types often incorporate a dimple as a means of producing a snap action (not appropriately plotted in this figure). Disc configurations tend to handle shock and vibration better than cantilevered bimetallic switches. 1.1.1.3 Application Guide Bimetallic devices are generally specified for temperatures from –65°F to several hundred degrees Fahrenheit. Specialized devices can handle upward of 2000°F. Set-point tolerance and repeatability is generally on the order of ±5°F, and set-point drift is usually negligible. (1) Choosing the right thermal control. The rate of temperature rise, location of the thermal control, the electrical load, and the mass of the application can each greatly affect cycling (operational) characteristics of a thermal control. Because of these variables, it is strongly recommended that you conduct testing of the switches specifically in your application. Certain aspects should be taken into consideration when applying both creep and snap action devices. Careful attention must be paid to input voltage, load currents, and the characteristics of the load. Final design criteria should be based upon results of the testing of our devices in your application, at your facility. (2) Choosing the right bimetallic switches. It has been realized that each application for thermal controls is unique in one form or another. Because of this, there is no standard product. A wide range of options is offered, including the calibration temperature range and tolerances. The length of the lead wires and the type of insulation material also require deliberate consideration. You should require samples for your application testing before deciding to use bimetallic switches. (3) Snap action configurations. Snap action bimetal elements are used in applications where an action is required at a threshold temperature. As such, they are not temperature-measuring devices, but rather temperature-activated devices. The typical temperature change to activate a snap action device is several degrees and is determined by the geometry of the device. When Zhang_Ch01.indd 4 5/13/2008 5:45:17 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 5 the element activates, a connection is generally made or broken, and a gap between the two contacts exists for a period of time. For a mechanical system, there is no problem; however, for an electrical system, the gap can result in a spark that can lead to premature aging and corrosion of the device. Having the switch activate quickly, hence the use of snap action devices, reduces the amount and duration of spark. Snap action elements also incorporate a certain amount of hysteresis into the system, which is useful in applications that would otherwise result in an oscillation about the set point. It should be noted, however, that special design of creep action bimetals can also lead to different ON/ OFF points, such as in the reverse lap-welded bimetal. (4) Sensitivity and accuracy. Modern techniques are more useful where sensitivity and accuracy are concerned for making a temperature measurement; however, bimetals find application in industrial temperature control where an action is required without external connections. Evidently, geometry is important for bimetal systems as the sensitivity is determined by the design, and a mechanical advantage can be used to yield a large movement per degree temperature change. 1.1.1.4 Calibration Temperature range calibration can be conducted with the following two methods: (1) The ice method. Immerse the temperature probe at least 2 in. into a glass of finely crushed ice. Add cold tap water to remove air pockets. Wait at least 1 min. The gauge should read 32°F. If it does not, turn the adjustment nut on the back of the reading dial with a pair of pliers until the dial reads 32°F. Wait at least 1 min to verify correct adjustment. (2) The boiling method. Submerge the probe into boiling water. Wait until the needle stops moving, then adjust the calibration nut until the dial reads 212°F. Since the boiling point of water decreases as altitude increases, this method may not be as accurate as the ice method at altitudes above sea level unless the exact boiling point temperature is known. Calibration is a broad topic and includes the ultimate reference sources, such as the national metrology laboratories, which are the custodians of the International Temperature Scale, and those services that are directly traceable to the national standards. For example, this is the scale that Zhang_Ch01.indd 5 5/13/2008 5:45:17 PM 6 INDUSTRIAL CONTROL TECHNOLOGY the national labs, or those affiliated to those labs, refer to in the calibration certificates of reference devices that may be used in corporation or university or other measurement laboratories that provide a more local service, such as to working instruments in a process plant or experimental apparatus. 1.1.2 Color Sensors Color sensors that can operate in real time under various environmental conditions can benefit many applications, including quality control, chemical sensing, food production, medical diagnostics, energy conservation, and monitoring of hazardous waste, etc. Analogous applications can also be found in other fields of economy, for example, in the electric industry for recognition and assignment of colored cords, in the electronic industry for the automatic test of mounted LED arrays or matrices, in the textile industry to check coloring processes, or in the building materials industry to control compounding processes. These color sensors are generally advisable wherever color structures, color processes, color nuances, or colored body rims must be recognized in homogeneously continuous processes over a long period and have influence on the process control or quality protection as measuring or controlled variables. 1.1.2.1 Operating Principle The color detection occurs at the color sensors according to the threefield procedure. Color sensors cast light on the objects to be tested, calculate the chromaticity coordinates from the reflected or transmitted radiation, and compare them with previously stored reference tristimulus (red, green, and blue) values. If the tristimulus values are within the set tolerance range, a switching output is activated. Color sensors can detect both the color of opaque objects through their reflections (incident light) and of transparent materials in transmitted light, whereby a reflector is mounted opposite the sensor. In Fig. 1.3, the color sensor can sense eight colors: red, green, and blue (primary colors); magenta, yellow, and cyan (secondary colors); and black and white. The ASIC chipset of the color sensor is based on the fundamentals of optics and digital electronics. The object whose color is to be detected should be placed in front of the system. The light rays reflected from the object will fall on the three convex lenses that are fixed in front of Zhang_Ch01.indd 6 5/13/2008 5:45:17 PM 7 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL Light Color sensor Blue Green Object Red LDR1 Magenta LDR2 ASIC chipset LDR3 Cyan Yellow Black White Figure 1.3 Operating principle of an assumed color sensor. the three LDRs. The convex lenses are used to cause the incident light rays to converge. Red, green, and blue glass filters are fixed in front of LDR1, LDR2, and LDR3, respectively. When reflected light rays from the object fall on the gadget, the filter glass plates determine which of these three LDRs would get triggered. When a primary color light ray falls on the system, the glass plate corresponding to that primary color will allow that specific light to pass through. But the other two glass plates will not allow any light to pass through. Thus, only one LDR will get triggered and the gate output corresponding to that LDR will indicate which color it is. Similarly, when a secondary color light ray falls on the system, the two primary glass plates corresponding to the mixed color will allow that light to pass through while the remaining one will not allow any light ray to pass through it. As a result two of these three LDRs get triggered and the gate output corresponding to these indicates which color it is. When all three LDRs get triggered or none of them are triggered, you will observe white and black light indications, respectively. 1.1.2.2 Basic Types In accordance with the working processes and application features, color sensors can be categorized into three-field color sensors and structured color sensors. (1) Three-field color sensors. The sensor works based on the tristimulus (standard spectral) value function and identifies colors with absolutely unerring precision and 10,000 times faster than the human eye could. It provides a compact and dynamic technical Zhang_Ch01.indd 7 5/13/2008 5:45:17 PM 8 INDUSTRIAL CONTROL TECHNOLOGY solution for general color detection and color measurement jobs. It is capable of detecting, analyzing, and measuring minute differences in color, for example, as part of LED testing, calibration of monitors, or where mobile equipment is employed for color measurement. These color sensors can have these advantages: (a) dielectric color filters adaptable for individual customers; (b) MHz signal frequency for time critical measurements; (c) profitable and fast signal processing; (d) compact design—without optical beam guidance; (e) high aging resistance; (f) temperature stability and environmental resistance. Based on the techniques used, there are two kinds of threefield color sensors: (i) Three-element color sensor. This sensor includes special filters so that their output currents are proportional to the function of standard XYZ tristimulus values. The resulting absolute XYZ standard spectral values can thus be used for further conversion into a randomly selectable color space. This allows for a sufficiently broad range of accuracies in color detection—from “eye accurate” to “true color,” that is, standard-compliant colorimetry to match the various application environments (ii) Integral color sensor. This kind of sensor accommodates integrative features including (1) detection of color changes; (2) recognition of color labels; (3) sorting colored objects; (4) checking of color-sensitive production processes; and (5) control of the product appearance. (2) Structured color sensors. Structured color sensors are used for the simultaneous recording of color and geometric information including (1) determination of color edges or structures and (2) checking of industrial mixed and separation processes. These color sensors can have the following advantages: (a) high selection of the sensor during applications in fast continuous processes of manufacture; (b) high signal sequence and parallel data transfer; (c) implementation of integral colorimetry; (d) applications with high-measuring frequencies; (e) adapted receiver geometries; (f) specific color adaptation. Based on the techniques used, there are two kinds of structured color sensors: (i) Row color sensor. The row color sensor has been developed for detecting and controlling the color codes and color sequences in the continuous measurement of Zhang_Ch01.indd 8 5/13/2008 5:45:18 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 9 moving objects. These color sensors are designed as PIN-photo-diode arrays. The photo diodes are arranged in the form of honeycombs for each three rhombi. The diode lines consist of two honeycomb lines displaced to each other half-line. As a result, it is possible on least expanse to implement a high resolution. In this case, the detail to be controlled is determined by the choice of suitable focusing optics. (ii) Hexagonal color sensor. This kind of sensor generates information for the subsequent electronics about the three-field chrominance signal (intensity of the threereceiving segments covered with the spectral filters) as well as about the structure and the position. 1.1.2.3 Application Guide In industrial control, color sensors are selected by means of the applicationoriented principle. Although having many factors is a required consideration, the following technical items are of primary reference: (1) operating voltage, (2) rated voltage, (3) output voltage, (4) residual ripple maximum, (5) no-load current, (6) spectral sensitivity, (7) size of measuring dot minimum, (8) limiting frequency, (9) color temperature, (10) light spot minimum, (11) permitted ambient temperature, (12) enclosure rating, (13) control interface type, etc. 1.1.2.4 Calibration Calibration is used to establish the link between the output signals (voltage, digital numbers) of the color sensor and their absolute physical values at color sensor input, which describe the overall transfer function of the color sensor. Calibration is a part of the color sensor characterization. Different applications require calibrating different parameters. For example, calibrating an ocean color sensor for remote sensing particularly concerns with spectral and radiometric parameters if geometric calibrations are not considered. Many companies or organizations in the world provide color sensor calibration services with their (1) software, (2) platform, and (3) evaluation boards. For example, SONY Corporation provides the ARTISANTM COLOR REFERENCE SYSTEM; DMN Digital Inc. provides Pantone ColorPlus Color Calibrator, etc. Zhang_Ch01.indd 9 5/13/2008 5:45:18 PM 10 INDUSTRIAL CONTROL TECHNOLOGY 1.1.3 Ultrasonic Distance Sensors There are numerous applications for ultrasonic distance sensors in industrial control. Ultrasonic distance sensors are used in all industries for measuring the distance to or size of material objects. That covers almost any size and type of object that can be measured in most industrial sectors. (1) Machine builders. Whether retrofitting existing machines or building new ones, ultrasonic distance sensors are used for motion control, or level control, or dimensioning, or proximity sensing. These are common applications in the converting, pulp and paper, printing, rubber, metals, textile, and other manufacturing industries. (2) Automation. Ultrasonic distance sensors reduce automation costs by providing a simple and effective means of monitoring the size or position of objects in production processes. Sensor information is used to accept or reject objects based on size, position, or fill level; make decisions on the routing of packages based on size or position; control the flow of liquid, solid, or granular materials; indicate when an object is nearby or in position, in/out of tolerance, or provide alarms when objects are in/out of position, near full/empty, or indicate process completion. (3) Process controls. Common applications include measuring the level of bulk materials in a tank or bin (inventory) or controlling the amount of material dispersed from a vessel (batching). Tank levels can be locally displayed or reported to a remote computer by a data network. Alarms can warn of low level, order levels, high level, or other conditions. 1.1.3.1 Operating Principle Ultrasonic distance sensors measure the distance or presence of target objects by sending a pulsed ultrasound wave at the object and then measuring the time for the sound echo to return. Knowing the speed of sound, the sensor can determine the distance of the object. As displayed in Fig. 1.4, the ultrasonic distance sensor regularly emits a barely audible click. It does this by briefly supplying a high voltage either to a piezoelectric crystal or to magnetic fields of ferromagnetic materials. In the first case, the crystal bends and sends out a sound wave. A timer within the sensor keeps track of exactly how long it takes the sound wave to bounce off something and return. This delay is then converted into a voltage corresponding to the distance of the sensed object. In the second case, the physical response of a ferromagnetic material in a magnetic field Zhang_Ch01.indd 10 5/13/2008 5:45:18 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 11 Figure 1.4 Operating principle of ultrasonic distance sensor. is due to the presence of magnetic moments. Interaction of an external magnetic field with the domains causes a magnetostrictive effect. Controlling the ordering of the domains through alloy selection, thermal annealing, cold working, and magnetic field strength can optimize this effect. The generated magnetostrictive effects are the use of magnetostrictive bars to control high-frequency oscillators and to produce ultrasonic waves in gases, liquids, and solids. Applying converters based on the reversible piezoelectric effect makes one-head systems possible where the converter serves both as transmitter and as receiver. The transceivers work by transmitting a short burst ultrasonic packet. An internal clock starts simultaneously, measuring propagation time. The clock stops when the object reflects the sound packet back to the sensor. The time elapsed between transmitting the packet and receiving the echo is the basis for calculating distance. Complete control of the process is realized by an integrated microcontroller, which allows for excellent output linearity. 1.1.3.2 Basic Types The ultrasonic distance sensor can be operated in two different modes. The first mode, referred to as continuous (or analog) mode, involves the sensor continuously sending out sound waves at a rate determined by the manufacturer. The second mode, called clock (or digital) mode, involves the sensor sending out signals at a rate determined by the user. This rate Zhang_Ch01.indd 11 5/13/2008 5:45:18 PM 12 INDUSTRIAL CONTROL TECHNOLOGY can be several signals per second with the use of a timing device, or it can be triggered intermittently by an event such as the press of a button. 1.1.3.3 Application Guide The major benefit of ultrasonic distance sensors is their ability to measure difficult targets—solids, liquids, granulates, powders, and even transparent and highly reflective materials that cause problems for optical sensors. In addition, analog output ultrasonic sensors offer comparatively long ranges, in many cases >3 m. They can be made very small too; some tubular models are only 12 mm in diameter, and 15 mm × 20 mm × 49 mm square-bodied versions are available for limited space applications. Ultrasonic devices do have some limitations. Foam and other attenuating surfaces may absorb most of the sound, significantly decreasing measuring range. Extremely rough surfaces may diffuse the sound excessively, decreasing range and resolution. However, an optimal resolution is usually guaranteed up to a surface roughness of 0.2 mm. Ultrasonic sensors emit a wide sonic cone, limiting their usefulness for small target measurement and increasing the chance of receiving feedback from interfering objects. Some ultrasonic devices offer a sonic cone angle as narrow as 6°, permitting detection of much smaller objects and sensing of targets through narrow spaces such as bottlenecks, pipes, and ampoules. For various distance-measuring sensors, there are four types of technical definitions emphasized in their applications: (1) resolution, (2) linearity, (3) repeat accuracy, and (4) reaction time. Figure 1.5 provides graphic illustrations of these four technical definitions for measuring distance sensors. 1.1.3.4 Calibration Ultrasonic distance sensors in either continuous or clock mode can be calibrated by means of some uncomplicated method. Once calibrated, switching between modes will not affect calibration. To calibrate an ultrasonic distance sensor, a voltmeter is essential. First, fasten the sensor to a surface such that there will be nothing but the target in front of it, at the same time leaving plenty of room behind it to adjust the small screws on the potentiometers by hand. Apply power to the sensor to begin warming it up. Allow several minutes for warm-up before starting the calibration process. The device should start clicking once power is applied. Figure 1.6 shows location of pots on an ultrasonic sensor. Zhang_Ch01.indd 12 5/13/2008 5:45:18 PM 13 ∇ Output Output 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL Deviation Distance ∇ Distance Distance (b) Output Distance (a) Output ∇ Response time Time Time (c) (d) Figure 1.5 Technical definitions of distance-measuring sensors: (a) Resolution corresponds to the smallest possible change in distance that causes a detectable change in the output signal. (b) Linearity is the deviation from a proportional linear function or a straight line, given as a percentage of the upper limit of the measuring range (full scale). (c) Repeat accuracy is the difference between measured values in successive measurements within a period of 8 h at an ambient temperature of 23 ± 5°C. (d) Reaction time is the time required by the sensor’s signal output to rise from 10% to 90% of the maximum signal level. For sensors with digital signal processing, it is the time required for calculation of a stable measured value. Zero pot Scale adjust pot Full-scale pot No connector Analog output Clock out Trig-enable Ext-trigger Common 8–16 V DC Gain Figure 1.6 Location of pots on an ultrasonic sensor. Zhang_Ch01.indd 13 5/13/2008 5:45:18 PM 14 INDUSTRIAL CONTROL TECHNOLOGY The gain control must now be set to 50%. It is the potentiometer with the screw head near the bottom of the device. It should rotate between what would correspond to 8 and 4 on the face of a clock, but no further. Set it to the “12” position The positive lead of a voltmeter is put on pin 6 and the negative lead on pin 2. Try to find a way to fasten these leads in place, or get someone to hold them there. A screwdriver with a very small flat head is required to do this. Rotate the zero and full-scale potentiometer screws fully counterclockwise, or about 12 turns. The screws will not stop turning after 12 turns, so you have to keep track. Now place the target at the maximum distance from the sensor of interest. The literature claims a maximum distance of 10 ft, which we found to be quite accurate. The sensor will work for objects at least 13 ft away, but the objects must be very sound reflective and/or large (such as a refrigerator door) to obtain a usable reading. Once the target is in place, adjust the scale adjust potentiometer. This potentiometer compensates for the varying voltages that may be supplied to the sensor. Rotate its screw until the voltmeter reads +5 V. Rotate the full-scale potentiometer clockwise until its voltage ceases to change, and then slowly rotate it counterclockwise until the +5 V reading is obtained again. Place the target at the minimum distance from the sensor. Do not put it any closer than 6 in. Slowly rotate the zero adjust potentiometer until a reading of 0 V is attained. We could not get a reading below 0.034 V, but anything from +0.5 to –0.5 V is acceptable. At this point it would be useful to move the target back and forth between the minimum and maximum distances while watching the voltmeter. It should read +5 V when the target is at its maximum distance and 0 V when at the minimum. Make sure to keep the target within the sensor’s line of sight, which can be thought of as an imaginary cone emanating from the sensor to a width of 2.6 ft when standing 10 ft away. The more you step outside the cone, the less likely you are to get a good reading. To adjust the gain, put the target at maximum distance. Rotate the gain screw fully counterclockwise, and then slowly rotate it clockwise until detection occurs. Rotate it an additional 1/16th turn after this. It is always best to keep the gain setting as low as possible, since higher gain settings increase the likelihood of false target detection. Once all the above steps have been completed, the sensor should be calibrated and ready for detection. Zhang_Ch01.indd 14 5/13/2008 5:45:19 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 1.1.4 15 Light Section Sensors Light section methods have been utilized as a three-dimensional measurement technique for many years as noncontact geometry and contour control. The light section sensor is primarily used for automating industrial production processes and testing procedures in which system-relevant positioning parameters are generated from profile information. Twodimensional height information can be collected by means of laser light, the light section method, and a high resolution of receiver array. Height profiles can be monitored, filling level detected, magazines counted, and the presence of objects checked. 1.1.4.1 Operating Principle The light section can be simply achieved in many cases with the laser light section method. The laser light section method is a three-dimensional procedure to measure object profiles in one-sectional plane. The principle of laser triangulation (see Fig. 1.7) requires a camera position orthogonal to the object’s surface area to measure the lateral displacement or the deformation of a laser line projected at an angle q onto the object’s surface (see Fig. 1.8). The elevation profile of interest is calculated from the deviation of the laser line from the zero position. A light section sensor consists of one camera and laser projector also called laser line generator. The measurement principle of a light section sensor is based on active triangulation (Fig. 1.7). Its simplest realization is Camera Laser projector q h Figure 1.7 Laser triangulation (optical scheme), where h is elevation measurement range and q is the angle between the plane of the laser line and the axis of the camera. A high resolution can be obtained by increasing h and decreasing q and vice versa. Zhang_Ch01.indd 15 5/13/2008 5:45:19 PM 16 INDUSTRIAL CONTROL TECHNOLOGY A Figure 1.8 Laser light sectioning is the two-dimensional extension of the laser triangulation. By projecting the expanded laser line an elevation profile of the object under test is obtained. Inset A: Image recorded by the area camera. The displacement of the laser line indicates the object elevation at the point of incidence. scanning a scene by a laser beam and detecting the location of the reflected beam. A laser beam can be spread by passing it through a cylindrical lens, which results in a plane of light. Its profile can be measured in the camera image thus realizing triangulation along one profile. In order to generate dense range images, one has to project not only one but also many light planes (Fig. 1.8). This can be achieved either by moving the projecting device or by projecting many stripes at once. In the latter case the stripes have to be encoded somehow; this is referred to as the coded-light approach. The simplest encoding is achieved by assigning different brightness to every projection direction, for example, by projecting a linear intensity ramp. Measuring range and resolution are determined by the triangulation angle between the plane of the laser line and the optical axis of the camera (see Fig. 1.7). The more grazing this angle, the larger is the observed lateral displacement of the line. The measured resolution is increased, but the measured elevation range is reduced. Criteria related to objects’ surface characteristics, camera aperture or depth of focus, and width of the laser line might reduce the achievable resolution. 1.1.4.2 Application Guide In applications, the laser light section method has some technical details requiring particular attention. Zhang_Ch01.indd 16 5/13/2008 5:45:19 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 17 (1) Object surface characteristics. One requirement for the utilization of the laser light section method is an at least partial diffuse reflecting surface. An ideal mirror would not reflect any laser radiation into the camera lens, and the camera cannot view the actual reflecting position of the laser light on the object surface. With a complete diffuse reflecting surface, the angular distribution of the reflected radiation is independent of the angle of incidence of the incoming radiation as it hits the object under test (Fig. 1.8). Real technical surfaces usually provide a mixture of diffuse and reflecting behavior. The diffuse reflected radiation is not distributed isotropic, which means that the more grazing the incoming light, the lesser the radiation reflected in an orthogonal direction to the object’s surface. Using the laser light section method, the reflection characteristics of the object’s surface (depending on the submitted laser power and sensitivity of the camera) limit the achievable angle of triangulation q (Fig. 1.7). (2) Depth of focus of the camera and lens. To ensure widely constant signal amplitude on the sensor, the depth of focus of the camera lens as well as the depth of focus of the laser line generator have to cover the complete measurement elevation range. By imaging the object under test onto the camera sensor the depth of focus of the imaging lens increases proportional to the aperture number k, the pixel distance y, quadratic to the imaging factor @ (= field of view/sensor size). The depth of focus 2z is calculated by 2z = 2yk@ (1+@). In the range ±z around the optimum object distance, no reduction in sharpness of the image is evident. Example: Pixel distance y = 0.010 mm Aperture number k = 8 Imaging factor @ = 3 2z = 2 × 0.010 × 8 × 3 × (1 + 3) = 1.92 mm With fixed imaging geometry a fading aperture of the lens increases its depth of focus. A larger aperture number k cuts the signal amplitude by a factor of 2 with each aperture step; it decreases the optical resolution of the lens and increases the negative influence of the speckle effect. (3) Depth of focus of a laser line. The laser line is focused to a fixed working distance. With actual working distances diverging from the setting the laser line widens and the power density of the radiation decreases. The region around the nominal working distance, where line width does not increase by more than a given factor, is according Zhang_Ch01.indd 17 5/13/2008 5:45:19 PM 18 INDUSTRIAL CONTROL TECHNOLOGY to agreement characterized as the depth of focus of a laser line. There are two types of laser line generators: laser micro line generators and laser macro line generators. Laser micro line generators create thin laser lines with Gaussian intensity profile orthogonal to the laser line. The depth of focus of a laser line at wavelength L and of width B is given by the so-called Rayleigh range 2ZR:2ZR = (pB2)/(2L), where p = 3.1415926. Laser macro line generators create laser lines with increased depth of focus. At the same working distance macro laser lines are wider than micro laser lines. Within the two design types, macro and micro line generators, the respective line width is proportional to the working distance. Due to the theoretical connection between line width and depth of focus, the minimum line width of the laser line is limited by the application due to the required depth of focus. (4) Basic setback: Laser speckle. Laser speckling is an interference phenomenon originating from the coherence of the laser radiation, for example, the laser radiation reflected by a rough-textured surface. Laser speckle disturbs the edge sharpness and the homogeneity of the laser lines. Orthogonal to the laser line, the center of intensity is displaced stochastically. The granularity of the speckle depends on the setting of the lens aperture viewing the object. With a small aperture number the arising speckles have a high spatial frequency; with a large k number the speckles are rather rough and particularly disturbing. Because a diffuse reflective and thus an optically rough-textured surface is essential for the utilization of the laser light section method, laser speckling cannot be avoided in principle. A reduction of the disturbing effect is possible by (1) utilizing laser beam sources with decreased coherence length, (2) a relative movement between object and sensor, possibly using a necessary or existent movement of the sensor or the object (e.g., the profile measurement of railroad tracks while the train is running), (3) diminishing the speckle pattern by choosing large lens apertures (small aperture numbers), as long as the requirements of depth of focus tolerate this. (5) Dome illuminator for diffuse illumination. The introduced application requires simultaneously with the three-dimensional profile measurement, control of the object outline, and surface. For this purpose, the object under test is illuminated homogeneously and is diffused by a dome illuminator. An LED ring lamp generates the illumination that propagates, scattered by a diffuse Zhang_Ch01.indd 18 5/13/2008 5:45:19 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 19 reflecting cupola, to the object of interest. In the center of the dome an opening for the camera is located. There is no radiation falling onto the object from this direction. Shadow and glint are widely avoided. Because the circumstances correspond approximately to the illumination on a cloudy day, this kind of illumination is also called “cloudy day illumination.” (6) Optical engineering. Using a laser light section application with high requirements, the design of the system configuration is of great importance. This “optical engineering” implies the choice and the contractive design of the utilized components like camera, lens, and laser line generator from the optical point of view. Considering the optical laws and their interactions, an optimum picture recording within the given physical boundary conditions is accomplished. Elaborate picture preprocessing algorithms are avoided. Arranging first steps to measure objects with largely diffuse reflecting surfaces or with reduced requirements in resolution, cameras and laser line generators from the electronic mail order catalog may be utilized for first system testing (e.g., school practicum, etc). These simple laser line generators utilize mostly a glass rod lens to produce a Gaussian intensity profile along the laser line (as mentioned in the Operating Principle section). With increased requirements, laser lines with largely constant intensity distribution and line width have to be utilized. 1.1.4.3 Specifications The specifications of the light section sensors are routinely documented with these technical data: (1) supply voltage which is the voltage of the direct current power supplied to the sensor; (2) voltage ripple which defines the maximum tolerance for the ratio of the maximum voltage bias to the supply voltage; (3) reverse polarity protected which indicates whether or not the sensor has functionality protected from reverse polarity; (4) short circuit protected which indicates whether or not the sensor can be protected from damage if short circuit occurs; (5) power consumption which represents the power consumption of the sensor; (6) maximum output load which is the output power value of the sensor; Zhang_Ch01.indd 19 5/13/2008 5:45:20 PM 20 INDUSTRIAL CONTROL TECHNOLOGY (7) maximum operation frequency which is the permitted working frequency of the sensor; (8) response time tON/tOFF , where tON is the time interval from when the sensor is turned on to when it is ready to be loaded for tasks and tOFF is the time interval from when the sensor is turned off to when it completely stops; (9) hysteresis which is the sensing delay of the sensor; (10) length of light line which is maximum working laser length, etc. In addition to these technical data, the specifications of the light section sensors normally also include some environmental data as below: (1) vibration which is the allowed environmental vibration; (2) shock which is the allowable energy of exterior air shocks; (3) operation temperature that is the tolerant environmental temperature for the sensors, etc. 1.1.4.4 Calibration In the process of calibration, camera and projector parameters are estimated simultaneously using the nonlinear least squares estimation model. The three-dimensional coordinates of checkpoints are introduced as additional unknowns, and thus they are estimated simultaneously with the model parameters. This estimation model was chosen because its output contains not only the estimated parameters but also their accuracy. Obtaining the checkpoint accuracy is the major topic of this work. The estimation of camera and projector parameters requires a threedimensional calibration standard with well-defined target points. These control points are characterized by their three-dimensional coordinates, the two-dimensional coordinates of their images, and their one-dimensional projector coordinates. Given n control points as input, the maximum likelihood estimation of unknown parameters can be derived by the general nonlinear least squares estimation. Here are some important requirements for the calibration standard popularly used in industrial control. (1) The control points have to be regularly distributed in threedimensional workspace. (2) The images of the control points have to have a good contrast and an extent of at least 10 pixels. In this case they can be measured very accurately using least squares template matches. Zhang_Ch01.indd 20 5/13/2008 5:45:20 PM 21 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL (3) Highly accurate three-dimensional coordinates of control points as well as their errors have to be available. For example, assume an aluminum plate with white squares printed on a black background is used as a calibration standard. To achieve a regular distribution of control points in work space, the calibration plate can be precisely displaced along the third axis. Figure 1.9 shows the section sensor setup as it was used in this work. Both camera and projector are inclined to facilitate the measurement of not only horizontal, but also vertical, and even of overhanging surfaces for our application of grasping threedimensional objects. The position of the RSP projected onto the XY plane of the world coordinate system is also given in Fig. 1.9(b). From Fig. 1.9(a) it should be clear that the angle q between the optical axes of the camera and the projector was chosen to be relatively small; it is approximately 15o. This choice has the advantage of making it possible to measure surfaces of larger orientation range while the achievable accuracy is not ideal as it would be theoretically with q. = 90o. Notice that the optical axis of the section sensor ar is defined as the symmetry axis of ac and ap in Fig. 1.9(a). The work space in this example (200 × 200 × 100 mm3) is mainly constrained by the depth of focus of the projector and the camera, which is about 200 mm at a distance of 1300 mm. Weights of observations depend on the measurement process. For light section sensor calibration, three types of observations are used: (1) a priori knowledge about the three-dimensional coordinates of white squares on the calibration plate, (2) image measurements of square centers, and (3) measurements of the projector coordinates of square centers. (a) (b) Y Projector Work space RSP Camera ap ac Z ai X 1300 mm q RSP 200 mm Z 100 mm Work space XY plane 200 mm Figure 1.9 Experimental range sensor setup: (a) relative position of camera, projector, and work space in the range sensor plane (RSP); (b) position of the RSP and the work space projected onto the XY–Z plane of the world coordinate system. Zhang_Ch01.indd 21 5/13/2008 5:45:20 PM 22 INDUSTRIAL CONTROL TECHNOLOGY 1.1.5 Linear and Rotary Variable Differential Transformers The linear variable differential transformer (LVDT) is a well-established transducer design which has been used throughout many decades for the accurate measurement of displacement and within closed loops for the control of positioning. The LVDT design lends itself for easy modification to fulfill a whole range of different applications in both research and industry: (1) pressurized versions for hydraulic cylinder applications; (2) materials suitable for sea water and marine services; (3) dimensions to suit specific application requirements; (4) multichannel, rack amplifier–based systems; (5) automotive suspension system. The rotational variable differential transformer (RVDT) is also a wellestablished transducer design used to measure rotational angles and operates under the same principles as the LVDT sensor. Whereas the LVDT uses a cylindrical iron core, the RVDT uses a rotary ferromagnetic core. Some of the typical applications of RVDT are (1) flight control/navigation (2) flap actuators (3) fuel control (4) cockpit control (5) automation assembly equipment. 1.1.5.1 Operating Principle (1) An LVDT is much like any other transformer in that it consists of a primary coil, secondary coils, and a magnetic core as illustrated in Fig. 1.10(a). The primary coils (the upper coil in Fig. 1.10(a)) are energized with constant amplitude alternating current. This produces an alternating magnetic field in the center of the transducer which induces a signal into the secondary coils (the two lower coils in Fig. 1.10(a)) depending on the position of the core. Movement of the core within this area causes the secondary signal to change (Fig. 1.10(b)). As the two secondary coils are positioned and connected in a set arrangement (push–pull mode), when the core is positioned at the center, a zero signal is derived. Zhang_Ch01.indd 22 5/13/2008 5:45:20 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 23 Primary coil Movable core (a) Secondary coil Secondary #1 Secondary coil Primary Secondary #2 Lead wires Displacement (b) Moveable core Figure 1.10 The working principles of an LVDT: (a) the three coils and the movable core and (b) the displacement system of a sensor. Movement of the core from this point in either direction causes the signal to increase. As the coils are wound in a particular precise manner, the signal output has a linear relationship with the actual mechanical movement of the core. The secondary output signal is then processed by a phasesensitive demodulator which is switched at the same frequency as the primary energizing supply. This results in a final output which, after rectification and filtering, gives direct current output proportional to the core movement and also indicates its direction, positive or negative, from the central zero point (Fig. 1.10(b)). As with any transformer, the voltage of the induced signal in the secondary coil is linearly related to the number of coils. The basic transformer relation is Vout/Vin = Nout/Nin where Vout is the voltage at the output, Vin is the voltage at the input, Nout is the number of windings of the output coil, and Nin is the number of windings of the input coil. The distinct advantage of using an LVDT displacement transducer is that the moving core does not make contact with other electrical components of the assembly, as with resistive types, and so offers high reliability and long life. Further, the core can Zhang_Ch01.indd 23 5/13/2008 5:45:20 PM 24 INDUSTRIAL CONTROL TECHNOLOGY be so aligned that an air gap exists around it, which is ideal for applications where minimum mechanical friction is required. (2) An RVDT is an electromechanical transducer that provides a variable alternating current output voltage. This output voltage is linearly proportional to the angular displacement of its input shaft. When energized with a fixed alternating current source, the output signal is linear within a specified range over the angular displacement. RVDT utilizes brushless, noncontacting technology to ensure long life, reliability, and repeatable position sensing with infinite resolution. Such reliable and repeatable performance ensures accurate position sensing under the most extreme operating conditions. As diagrammed in Fig. 1.11, rotating a ferromagnetic-core bearing supported within a housed stator assembly provides a basic RVDT construction and operation. The housing is passively stainless steel. The stator consists of a primary excitation coil and a pair of secondary output coils. A fixed alternating current excitation is applied to the primary stator coil that is electromagnetically coupled to the secondary coils. This coupling is proportional to the angle of the input shaft. The output pair is structured so that one coil is in phase with the excitation coil, and the second is 180° out of phase with the excitation coil. When the rotor is in a position that directs the available flux equally in both the in phase and out of phase coils, the output voltages cancel Rotary ferromagnetic core Vin Vout Figure 1.11 The working principles of a typical RVDT. Zhang_Ch01.indd 24 5/13/2008 5:45:20 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 25 and result in a zero value signal. This is referred to as the electrical zero position. When the rotor shaft is displaced from the electrical zero position, the resulting output signals have a magnitude and phase relationship proportional to the direction of rotation. Because the performance of an RVDT is essentially similar to that of a transformer, excitation voltage changes will cause directly proportional changes to the output (transformation ratio). However, the voltage out to excitation voltage ratio will remain constant. Since most RVDT signal conditioning systems measure signal as a function of the transformation ratio, excitation voltage drift beyond 7.5% typically has no effect on sensor accuracy and strict voltage regulation is not typically necessary. Excitation frequency should be controlled within ±1% to maintain accuracy. 1.1.5.2 Application Guide The following factors should be considered when selecting an LVDT (AC, alternating current; DC, direct current): (1) measurement range (2) armature type (3) AC–AC vs DC–DC (4) environment. LVDTs are available with ranges from ±0.01" to ±18.5". An LVDT with a ±18.5" range can be used in one direction to measure up to 37". If accuracy is important, the range selected should not be any larger than necessary. Three armature types are available: free unguided armatures, captive guided spring return armatures, and captive guided armatures. Free unguided armatures are recommended for applications in which the target being measured moves parallel to the transducer body as well as those which require frequent or continuous measurements. This armature type is well suited for dynamic applications. When using a free unguided armature, the armature and the LVDT body must be mounted so that their correct relative positions are maintained. This type of LVDT features an armature/ threaded push rod assembly which is completely separable from the LVDT body. Since the free unguided armature involves no mechanical coupling between the armature and the LVDT body, there are no springs or bearings to fatigue. This unit has a virtually unlimited fatigue life. Captive guided spring return armatures are well suited for those applications requiring the measurement of multiple targets or applications in which the target moves Zhang_Ch01.indd 25 5/13/2008 5:45:21 PM 26 INDUSTRIAL CONTROL TECHNOLOGY transverse to the armature and changes in the structure’s surface are to be measured. In this type of LVDT, the armature moves over bearings in the LVDT body. The armature is biased by an internal spring so that the ballended probe bears against the surface of the target whose displacement is being measured. The LVDT is held in position by clamping the body alone. The armature is not attached to the target being measured. Captive guided armatures are designed for applications requiring a longer working range. The armature moves freely over machined bearings but cannot be removed from the body. The LVDT body has a threaded mounting hole, and the armature is attached to the structure being measured. The armature end is threaded so that special adapters such as spherical bearings or rollers can be attached. The major advantages of DC–DC LVDTs are the ease of installation, the ability to operate from dry cell batteries in remote locations, and lower system cost, while the advantages of AC–AC LVDT include greater accuracy and a smaller body size. An AC–AC LVDT can be equipped with more sophisticated electronics such as SENSOTEC SC instrumentation. The SC instrument provides an AC power supply, a phase-sensitive demodulator, a scaling amplifier, and a DC output. The AC–AC LVDT system has less residual noise at minimum readings than DC–DC units which utilize internal electronics. For applications involving very high humidity or requiring submersion of the LVDT, a submersible LVDT is required. Submersible units are available for either AC–AC or DC–DC operation and with free unguided or captive spring return armatures. The unit selected should also operate and survive at the temperatures dictated by the application. Note that AC–AC units will operate at higher temperatures (up to 257°F) than the DC–DC units (up to 158°F) which have internal electronics. Side loads must be kept to a minimum since they will cause rubbing between the armature and the LVDT body. This friction will cause excessive wear of bearings, and in extreme cases the armature may bend. At a minimum, side loads will reduce the unit’s life and accuracy. 1.1.5.3 Calibration The manual calibration procedure for both the LVDT sensors and the RVDT sensors is to check and adjust the zero and gain settings of the signal conditioner, which includes these steps: (1) First, the signal conditioner at zero displacement should be made to be zero. (2) Second, the micrometer should be traversed to a maximum displacement that can be anticipated in the calibration experiment. (3) The gain setting should be adjusted Zhang_Ch01.indd 26 5/13/2008 5:45:21 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 27 to attain a transducer “high” output value. (4) Finally, the “reference values” of the zero, maximum displacement, and the corresponding transducer output must be recorded. In further experiments, it may be necessary to set the zero and gain of the signal conditioner to these “reference values” and use the calibration results or curves obtained from this laboratory for displacement measurements. The laboratory assignments are executed with the following procedure: (1) Take at least five different settings to cover the displacement range of 0–1 in. For each displacement setting, repeat five times for increasing displacement (or, low to high) and repeat five times for decreasing displacement (or, high to low) to check for hysteresis. (2) Establish a spread sheet and calculate the average voltage for each displacement. (3) Plot the averaged voltage output of the signal conditioner vs displacement and obtain a linear correlation between the averaged voltage output vs displacement using a least squares technique (e.g., in the format of y = a + bx ± c). 1.1.6 Magnetic Control Systems Magnetic control systems are dominated with magnetic field sensors, magnetic switches, and instruments that measure magnetic fields and or magnetic flux by evaluating a potential, current, or resistance change due to the field strength and direction. They are used to study the magnetic field or flux around the Earth, permanent magnets, coils, and electrical devices in displacement measurement, rail inspection system, and the linear potentiometer replacement, etc. Magnetic field sensors and switches can measure and control these properties without physical contact and have become the eyes of many industrial and navigation control systems. Magnetic field sensors and switches are typically applied in industrial control for proximity detection, displacement sensing, rotational reference detection, current sensing, and vehicle detection. Magnetic field sensors indirectly measure properties such as direction, position, rotation, angle, and current by detecting the magnetic field and its changes. The first application of a permanent magnet was a third-century bc Chinese compass, which is a direction sensor. Compared to other direct methods such as optical or mechanical sensor, most magnetic file sensors require some signal processing to get the property of interest. However, they provide reliable data without physical contact even in adverse conditions such as dirt, vibration, moisture, hazardous gas and oil, etc. At present, Zhang_Ch01.indd 27 5/13/2008 5:45:21 PM 28 INDUSTRIAL CONTROL TECHNOLOGY there are two kinds of magnetic switches: magnetic reed switches and magnetic level switches. Magnetic switches are suitable for applications requiring a switched output for proximity, linear limit detection, logging or counting, or actuation purposes. Flux gate and coil instruments perform a continuous measurement of the differences in the magnetic field at the ends of a vertical rod and plot these differences on a grid of the area. Hall effect describes a device that converts the energy stored in a magnetic field to an electrical signal by means of the development of a voltage between the two edges of a current carrying conductor whose faces are perpendicular to a magnetic field. 1.1.6.1 Operating Principle A unique aspect of using magnetic sensors and switches is that measuring magnetic fields is usually not the primary intent. Another parameter is usually desired such as wheel speed, presence of a magnetic ink, vehicle detection, or heading determination, etc. These parameters cannot be measured directly but can be extracted from changes or disturbances in magnetic fields. The most widely used magnetic sensors and switches are Hall effect sensor switches, magnetoresistive (MR) series of sensors switches, magnetic reed switch, magnetic level switch, etc. (1) Hall effect sensors and switches. The Hall effect is a conduction phenomenon which is different for different charge carriers. In most common electrical applications, the conventional current is used partly because it makes no difference whether positive or negative charge is considered to be moving. But the Hall voltage has a different polarity for positive and negative charge carriers, and it has been used to study the details of conduction in semiconductors and other materials which show a combination of negative and positive charge carriers. The Hall effect can be used to measure the average drift velocity of the charge carriers by mechanically moving the Hall probe at different speeds until the Hall voltage disappears, showing that the charge carriers are now not moving with respect to the magnetic field. Other types of investigations of carrier behavior are studied in the quantum Hall effect. An alternative application of the Hall effect is that it can be used to measure magnetic fields with a Hall probe. As shown in Fig. 1.12, if an electric current flows through a conductor in a magnetic field, the magnetic field exerts a transverse force on the moving charge carriers, which tends to push Zhang_Ch01.indd 28 5/13/2008 5:45:21 PM 29 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL VH Fm = Magenetic force on negative charge carriers I Magenetic field B + − Fe − − − d I + − F m − + + + + Fe = Electric force from charge buildup Direction of conventional electric current Figure 1.12 The Hall effect. them to one side of the conductor. This is most evident in a thin, flat conductor as illustrated. A build up of charge at the sides of the conductors will balance this magnetic influence, producing a measurable voltage between the two sides of the conductor. The presence of this measurable transverse voltage is called the Hall effect, after E. H. Hall who discovered it in 1879. Note that the direction of the current I in the diagram is that of conventional current, so that the motion of electrons is in the opposite direction. This further confuses all the “right-hand rule” manipulations you have to go through to get the direction of the forces. As displayed in Fig. 1.12, the Hall voltage VH is given by VH = IB/(ned), where I is the induced electric current, B is the strength Input signal Sensor Magnetic flux HAL Out signal VOUT Figure 1.13 The functional principle of a Hall sensor. Zhang_Ch01.indd 29 5/13/2008 5:45:21 PM 30 INDUSTRIAL CONTROL TECHNOLOGY of the magnetic filed, n is the density of mobile charges, e is the electron charge, and d is the thickness of the film. In the Hall sensor, the Hall element with its entire evaluation circuitry is integrated on a single silicon chip. The Hall plate with the current terminals and the taps for the Hall voltage are arranged on the surface of the crystal. This sensor element detects the components of the magnetic flux perpendicular to the surface of the chip and emits a proportional electrical signal which is processed in the evaluation circuits integrated on the sensor chip. The functional principle of a Hall sensor is, as displayed in Fig. 1.13, that the output voltage of the sensor and the switching state, respectively, depend on the magnetic flux density through the Hall plate. (2) Magnetoresistive sensors and switches. Magnetoresistance is the property of some conductive materials to gain or lose some of their electrical resistance when placed inside a magnetic field. The resistivity of some materials is greatly affected when the material is subjected to a magnetic field. The magnitude of this effect is known as magnetoresistance and can be expressed by the equation: MR = (r(H)–r(0))/r(0) where MR is the magnetoresistance, r(0) is the resistivity at zero magnetic field, and r(H) is the resistivity in an applied magnetic field. The magnetoresistance of conventional materials is quite small, but materials with large magnetoresistance have been synthesized now. Depending on the magnitude, it is either called giant magnetoresistance (GMR) or colossal magnetoresistance (CMR). Magnetoresistive sensor or switch elements are magnetically controllable resistors. The effect whereby the electric resistance of a thin, anisotropic ferromagnetic layer changes through a magnetic field is utilized in these elements. The determining factor for the specific resistance is the angle formed by the internal direction of magnetization (M) and the direction of the current flow (I). Resistance is largest if the current flow (I) and the direction of magnetization run parallel. The resistance in the base material is smallest at an angle of 90° between the current flow (I) and the direction of magnetization (M). In addition, highly conductive material is applied below an angle of 45°. The current passing the sensor element takes the shortest distance between these two ranges. This means that it flows at a preferred direction of 45° against the longitudinal axis of the sensor element. Without an external field, the resistance of the element is then in the medium range. An external magnetic Zhang_Ch01.indd 30 5/13/2008 5:45:23 PM 31 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL field with field strength (H) influences the internal direction of magnetization, which causes the resistance to change as a factor of the influence. Figure 1.14 gives an example using Permalloy (NiFe) film to illustrate that the resistance of a material depends upon the angle between the internal direction of magnetization M and the direction of the current flow I. The actual sensor element is often designed with four magnetic field sensitive resistors interconnected to form a measuring bridge (Fig. 1.15). The measuring bridge is energized and Current I Magnetization M q Easy axis No applied field I M HApplied Figure 1.14 As an example, the Permalloy (NiFe) film has a magnetization vector, M, that is influenced by the applied magnetic field being measured. The resistance of the film changes as a function of the angle between the vector M and current flow, I, flowing through it. This change in resistance is known as the magnetoresistive effect. Bias current Permalloy Out− Shorting bars Vb GND Easy axis Out+ Sensitive axis Figure 1.15 As an example, the magnetoresistive bridge is made up of four Permalloy parallel strips. A crosshatch pattern of metal is overlaid onto the strips to form shorting bars. The current then flows through the Permalloy, taking the shortest path, at a 45° angle from shorting bar to shorting bar. This establishes the bias angle between the magnetization vector M of the film and the current I flowing through it. Zhang_Ch01.indd 31 5/13/2008 5:45:23 PM 32 INDUSTRIAL CONTROL TECHNOLOGY supplies a bridge voltage. A magnetic field which influences the bridge branches in different degrees leads to a voltage difference between the bridge branches which is then amplified and evaluated. The sensor detects the movement of ferromagnetic structures (e.g., in gearwheels) caused by the changes in the magnetic flow. The sensor element is biased with a permanent magnet. A tooth or a gap moving past the sensor influences the magnetic field at different degrees. This causes changes in the magnetic field dependent on resistance values in a magnetoresistive sensor. The changes in the magnetic field can therefore be converted into an electric variable and can also be conditioned accordingly. The output signal from the sensor is a square wave voltage which reflects the changes in the magnetic field. Changes in the magnetic field cause the bridge voltage to be deflected. This voltage is amplified and supplied to a Schmitt trigger after conditioning. If the effective signal reaches an adequate level, the output stage is set accordingly. The sensor is used for the noncontact rotational speed detection on ferromagnetic sensing objects such as gearwheels. The distance between the sensed object and the surface of the active sensor is described as air gap. The maximum air gap is dependent on the geometry of the object. The measurement principle dictates the direction-dependent installation. The magnetoresistive sensor is sensitive to changes in the external magnetic field. For this reason the sensed objects should not have different degrees of magnetization. (3) Magnetic switches. Most magnetic switches actually work with two mechanisms: the magnetic reed switches and the magnetic level switches. Magnetic reed switches normally consist of two overlapping flat contacts which are sealed into a glass tube filled with inert gas. When approached by a permanent magnet the contact ends attract each other and make contact. When the magnet is removed, the contacts separate immediately (Fig. 1.16). For magnetic level switches, the operation is achieved using the time-proven principle of repelling magnetic forces. One permanent magnet forms part of a float assembly which rises and falls with changing liquid level. A second permanent magnet is positioned within the switch head so that the adjacent poles of the two magnets repel each other through a nonmagnetic diaphragm. A change in liquid level moves the float through its permissible range of travel causing the float magnet to pivot and repel the switch magnet. The resulting snap action of the repelling magnets actuates the switch. Zhang_Ch01.indd 32 5/13/2008 5:45:24 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL Flat contacts 33 Magnet Glass tube Figure 1.16 Operating principle of a simple magnetic reed switch. 1.1.6.2 Basic Types and Application Guide One way to classify the various magnetic sensors and switches is by the magnetic field sensing range. These sensors and switches can be arbitrarily divided into three categories: (1) low field, (2) medium field, and (3) high field sensing. Sensors that detect magnetic fields less than 1 µG will be classed as low field sensors. Sensors with a range of 1 µG to 10 G will be considered Earth’s field sensors, and those sensors that detect fields above 10 G will be considered bias magnet field sensors in this book. Only those magnetic field sensors and switches used in industrial control are listed below so that the low field magnetic sensors are neglected because these are primarily used for medical applications and laboratory research. (1) Earth’s field sensors. (1 µG to 10 G) The magnetic range for the medium field sensors lends itself well to using the Earth’s magnetic field. Several ways to use the Earth’s field are to determine compass headings for navigation, detect anomalies in it for vehicle detection, and measure the derivative of the change in field to determine yaw rate. (a) Fluxgate. Fluxgate magnetometers are the most widely used sensors for compass navigation systems. Fluxgate sensors have also been used for geophysical prospecting and airborne magnetic field mapping. The most common type of fluxgate magnetometer is called the second harmonic device. This device involves two coils, a primary and a secondary, wrapped around a high-ability ferromagnetic core. The magnetic induction of this core changes in the presence of an external magnetic field. Another way of looking at the fluxgate operating principle is to sense the ease, or resistance, of saturating the core caused by the change in its magnetic flux. The difference is due to the external magnetic field. Zhang_Ch01.indd 33 5/13/2008 5:45:24 PM 34 INDUSTRIAL CONTROL TECHNOLOGY (b) Magnetoinductive. Magnetoinductive magnetometers are relatively new with the first patent issued in 1989. The sensor is simply a single winding coil on a ferromagnetic core that changes permeability within the Earth’s field. The sense coil is the inductance element in an L/R relaxation oscillator. The frequency of the oscillator is proportional to the field being measured. A static DC current is used to bias the coil in a linear region of operation. (c) Anisotropic magnetoresistive (AMR). Magnetoresistive (MR) sensors come in a variety of shapes and forms. The newest market growth for MR sensors is high density read heads for tape and disk drives. Most AMR sensors are made of Permalloy (NiFe) thin film deposited onto a silicon substrate and patterned to form a Wheatstone resistor bridge. AMR sensors provide an excellent means of measuring both linear and angular position and displacement in the Earth’s magnetic field. Permalloy thin films of a sensor deposited on a silicon substrate in various resistor bridge configurations provide highly predictable outputs when subjected to magnetic fields. Low cost, high sensitivity, small size, noise immunity, and reliability are advantages over mechanical or other electrical alternatives. Highly adaptable and easy to assemble, these sensors solve a variety of problems in custom applications. (2) Bias magnet field sensors. (above 10 G) Most industrial sensors use permanent magnets as a source of the detected magnetic field. These permanent magnets magnetize, or bias, ferromagnetic objects close to the sensor. The sensor then detects the change in the total field at the sensor. Bias field sensors must not only detect fields which are typically larger than the Earth’s field, but they must also not be permanently affected or temporarily upset by a large field. Sensors in this category include reed switches, InSb magnetoresistors, Hall devices, and GMR sensors. (a) Reed switch. The reed switch can be considered the simplest magnetic sensor used to produce a usable output for industrial control. Reed switches are maintenance free and highly immune to dirt and contamination. Rhodium-plated contacts ensure long contact life. Typical capabilities are 0.1–0.2 A switching current and 100–200 V switching voltage. Contact life is measured at 106–107 operations at 10 mA. Reed switches are available with normally open, normally closed, and class C contacts. Latching reed switches are also available. Mercury-wetted reed switches can switch currents as high as 1 Å and have no contact bounce. Zhang_Ch01.indd 34 5/13/2008 5:45:24 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 35 Low cost, simplicity, reliability, and zero power consumption make reed switches popular in many applications. The addition of a separate small permanent magnet yields a simple proximity switch often used in security systems to monitor the opening of doors or windows. The magnet, affixed to the movable part, activates the reed switch when it comes close enough. The desire to sense almost everything in cars is increasing the number of reed switch sensing applications in the automotive industry. (b) Lorentz force devices. There are several sensors that utilize the Lorentz force, or Hall effect, on charge carriers in a semiconductor. The Lorentz force equation describes the force FL experienced by a charged particle with charge q moving with velocity v in a magnetic field B: FL = q (v × B). The Hall effect is a consequence of the Lorentz force in semiconductor materials. The following sensors work with the Lorentz force and the Hall effect. (i) Magnetoresistors. The simplest of Lorentz force devices are magnetoresistors using semiconductors with high room temperature carrier mobility. If a voltage is applied along the length of a thin slab of semiconductor material, a current will flow and a resistance can be measured. When a magnetic field is applied perpendicular to the slab, the Lorentz force will deflect the charge carriers. If the width of the slab is greater than the length, the charge carriers will cross the slab without a significant number of them collecting along the sides. The effect of the magnetic field is to increase the length of their path and, therefore, the resistance. An increase in resistance of several hundred percentage is possible in large fields. In order to produce sensors with hundreds to thousands of ohms of resistance, long, narrow semiconductor stripes a few microns wide are produced using photolithography. The required length to width ratio is accomplished by forming periodic low-resistance metal shorting bars across the traces. Each shorting bar produces an equipotent across the semiconductor stripe. The result is, in effect, a number of small semiconductor elements with the proper length to width ratio connected in series. (ii) Hall effect sensors. The second type of sensor, which utilizes the Lorentz force on charge carriers, is a Hall sensor. Zhang_Ch01.indd 35 5/13/2008 5:45:24 PM 36 INDUSTRIAL CONTROL TECHNOLOGY The Hall resistance and Hall voltage increase linearly with applied field to several teslas (10 s of kG). The temperature dependence of the Hall voltage and the input resistance of Hall sensors are governed by the temperature dependence of the carrier mobility and that of the Hall coefficient. The Hall voltage is measured between electrodes placed at the middle of each side. This differential voltage is proportional to the magnetic field perpendicular to the slab. It also changes sign when the sign of the magnetic field changes. The ratio of the Hall voltage to the input current is called the Hall resistance, and the ratio of the applied voltage to the input current is called the input resistance. (iii) Integrated Hall sensors. Hall devices are often combined with semiconductor elements to make integrated sensors. By adding comparators and output devices to a Hall element, manufacturers provide unipolar and bipolar digital switches. Adding an amplifier increases the relatively low voltage signals from a Hall device to produce radiometric linear Hall sensors with an output centered on one-half the supply voltage. (c) Giant magnetoresistive (GMR) devices. Large magnetic field dependent changes in resistance are possible in thin-film ferromagnetic and/or nonmagnetic metallic multilayers. This phenomenon was first observed in 1988. Changes in resistance with magnetic field of up to 70% were observed. Compared to the few percentage change in resistance observed in anisotropic magnetoresistance (AMR), this phenomenon was truly giant magnetoresistance (GMR). GMR devices involve a sandwich of two outer layers of a ferromagnetic material, such as cobalt or iron, with a center of a nonmagnetic metal. One of the ferromagnetic layers is kept under a constant magnetic field, while the other layer is exposed to the variable magnetic field to be sensed. Maximum current flows when both ferromagnetic layers are magnetized in the same direction; minimum current flows when the layers are magnetized in reverse directions. GMR sensors are currently used in read-write heads for disk drives. (i) Unpinned sandwich GMR. These materials consist of two soft magnetic layers of iron, nickel, and cobalt alloys separated by a layer of a nonmagnetic conductor such as copper. With magnetic layers 4–6 nm (40–60 Å) thick separated by a conductor layer typically 3–5 nm thick, there is relatively little magnetic coupling between Zhang_Ch01.indd 36 5/13/2008 5:45:24 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 37 the layers. For use in sensors, sandwich material is usually patterned into narrow stripes. The magnetic field caused by a current of a few milliamperes per micron of stripe width flowing along the stripe is sufficient to rotate the magnetic layers into antiparallel or high resistance alignment. An external magnetic field of 3–4 kA/m applied along the length of the stripe is sufficient to overcome the field from the current and rotate the magnetic moments of both layers parallel to the external field. A positive or negative external field parallel to the stripe will produce the same change in resistance. An external field applied perpendicular to the stripe will have little effect due to the demagnetizing fields associated with the extremely narrow dimensions of these magnetic objects. The value usually associated with the GMR effect is the percentage change in resistance normalized by the saturated or minimum resistance. Sandwich materials have values of GMR typically 4–9% and saturate with 2.4–5 kA/m applied field. Figure 1.21 shows a typical resistance vs field plot for sandwich GMR material. (ii) Antiferromagnetic multilayer. These materials consist of multiple repetitions of alternating conducting magnetic layers and nonmagnetic layers. Since multilayer has more interfaces than do sandwiches, the size of the GMR effect is larger. The thickness of the nonmagnetic layers is less than that for sandwich material (typically 1.5–2.0 nm) and the thickness is critical. Only for certain thicknesses, the polarized conduction electrons cause antiferromagnetic coupling between the magnetic layers. Each magnetic layer has its magnetic moment antiparallel to the moments of the magnetic layers on each side—exactly the condition needed for maximum spin-dependent scattering. A large external field can overcome the coupling which causes this alignment and can align the moments so that all the layers are parallel— the low-resistance state. If the conducting layer is not of proper thickness, the same coupling mechanism can cause ferromagnetic coupling between the magnetic layers resulting in no GMR effect. (iii) Spin valves. These materials, or antiferromagnetically pinned spin valves, are similar to the unpinned spin valves or sandwich materials described earlier. An additional layer of an antiferromagnetic material is provided Zhang_Ch01.indd 37 5/13/2008 5:45:24 PM 38 INDUSTRIAL CONTROL TECHNOLOGY on the top or the bottom. The antiferromagnetic material couples to the adjacent magnetic layer and pins it in a fixed direction. The other magnetic layer is free to rotate. These materials do not require the field from a current to achieve antiparallel alignment. (iv) Colossal magnetoresistance (CMR). CMR occurs in crystals of manganese oxide known as “magnates.” Under certain conditions these mixed oxides undergo a semiconductor to metallic transition with the application of a magnetic field of a few teslas (10 s of kG). The size of the resistance ratios, measured at 103–108%, has generated considerable excitement even though they required high fields and liquid nitrogen temperatures. The MR of these crystals actually decreases in the presence of a magnetic field. CMR requires cryogenic cooling. 1.1.7 Limit Switches A limit switch is an electromechanical device that can be used to determine the physical position of equipment. For example, an extension on a valve shaft mechanically trips a limit switch as it moves from open to shut or shut to open. The limit switch is designed to give a signal to an industrial control system when a moving component like an overhead door or piece of machinery has reached the limit (end point) for its travel or just a specific point on its journey. The primary purpose of the limit switch is to control the intermediate or end limits of a linear or rotary motion. In industrial control systems, the limit switch is often used as a safety device to protect against accidental damage to equipment. 1.1.7.1 Operating Principle A linear limit switch is an electromechanical device that requires the physical contact of an object with the activator of the switch to make the contacts change state. As an object (target) makes contact with the actuator of the switch, it moves the activator to the “limit” where the contacts change state. Limit switches can be used in almost any industrial environment because of their typically rugged design. However, the device uses mechanical parts that can wear over time and the device is “slower” when compared to noncontact, electrical devices such as proximity sensors and photoelectric sensors. Rotary limit switches are similar to relays in that they are used to allow or prevent current flow when in closed or open position. The groupings Zhang_Ch01.indd 38 5/13/2008 5:45:24 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 39 within this family are usually defined based on the manner in which the switch is actuated (e.g., rocker, foot, read, lever, etc.). Switches can range from simple push button devices, usually used to delineate between ON and OFF, to rotary and toggle devices, for varying levels, through to multiple entry keypads, for multiple control functions. In addition to maintaining or interrupting flow, and maintaining flow levels, switches are used in safety applications as security devices (locker switches) and as functionary actuators when controlled by sensors or computer systems. Normally, the limit switch gives ON/OFF output that corresponds to valve position. Limit switches are used to provide full open or full shut indications as illustrated in Fig. 1.17 which gives a typical linear limit switch operation. Many limit switches are of the push button variety. In Fig. 1.17, when the valve extension comes in contact with the limit switch, the switch depresses to complete, or turn on, the electrical circuit. As the valve extension moves away from the limit switches, spring pressure opens the switch, turning off the circuit. Limit switch failures are normally mechanical in nature. If the proper indication or control function is not achieved, the limit switch is probably faulty. In this case, local position indication should be used to verify equipment position. Full open limit switch Indicating and control circuite Stem Full closed limit switch Flow Figure 1.17 Operations of a linear limit switch. Zhang_Ch01.indd 39 5/13/2008 5:45:24 PM 40 INDUSTRIAL CONTROL TECHNOLOGY 1.1.7.2 Basic Types and Application Guide Limit switches come in many different forms, from small, enclosed switches to large, heavy-duty multicircuit switches and are divided into several types as given below. The basic types of limit switches are (1) linear limit switches where an object will move a lever (or simply depress a plunger) on the switch far enough for the contact in the switch to change state; (2) rotary limit switches where a shaft must turn a preset number of revolutions before the contact changes state, used in cranes, overhead doors, etc.; and (3) magnetic limit switches, or reed switches, where the object is not touched but sensed. One heavy-duty application would be in mine hoists where a stationary switch will sense a strong magnet mounted to a car going up or down the mine shaft. (1) Linear limit switches. Linear limit switches basically have these three types: (a) Safety limit switches. Safety limit switches are designed for use with moveable machine guards/access gates, which must be closed for operator safety and for any other presence, and position-sensing application normally addressed with conventional limit switches. Their positive opening network connection contacts provide a higher degree of reliability than conventional spring-driven switches whose contacts can weld or stick shut. These limit switches are of multiple actuator styles and four 90° head position so that they provide application versatility. (b) Comprehensive range limit switches. Comprehensive range limit switches are provided in the most popular industrial sizes, shapes, contact configurations, as well as an innovative series of encapsulated limit switches, available with a connection cable or plug. Their output contacts are offered in snap action, slow action, or overlapping configurations. Various types of push button and roller actuators, roller levers, and multidirectional levers are available. These switches are ideal for manufacturers of material handling, packaging, conveying, and machine tool equipment. (c) Mechanical limit switches. Mechanical limit switches are frequently used in position detection on doors and machinery and parts detection on conveyors and assembly lines. Their range comprises various housing and actuator styles, choice of slow or fast action contacts, and various contact arrangements. Zhang_Ch01.indd 40 5/13/2008 5:45:25 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 41 (2) Rotary limit switches. Rotary switches move in a circle and can stop in several positions in their range, which provide singledeck rotary limit and multiple-deck rotary limit. (a) Single-deck rotary switches. Single-deck rotary switches can control several circuits at a time. Actuator choices for singledeck rotary switches include flush actuator, bare shaft actuator, knobbed shaft, and locker. In a flush actuator configuration the actuator does not project above the switch body. Typically it requires a screwdriver for operation. In a bare shaft actuator configuration the shaft has no knob, but may be notched to accept various knob configurations. A knobbed shaft comes with an integral knob. In a locker configuration the actuation is done with a key or other security or tamperproof method. Important physical switch specifications to consider when searching for single-deck rotary switches include angle between positions, mechanical life, number of decks, number of poles per deck, and number of poles. The angular distance (in degrees) exists between positions. For example, for a 4-position switch, the angle of throw is 90°, and for a 100position switch, the angle of throw is 3.6°. The mechanical life is the maximum life expectancy of the switch. Often, electrical life expectancy is less than mechanical life (please consult manufacturer). The number of decks specifies the maximum number of decks that can be attached to a common actuating shaft. The number of poles per deck refers to the number of separate circuits that can be activated through a switch at any given time per deck. The number of poles refers to the number of separate circuits that can be activated through a switch at any given time. Important electrical switch specifications to consider include maximum current rating, maximum AC voltage rating, and maximum DC voltage rating. Common materials of construction for the base and actuator include plastics and metals. Other specifications to consider for single-deck rotary switches include stop style, contact style, actuator features, terminal type, features, and environmental parameters. Stop style choices include fixed stop, adjustable stop, and continuous or no stops. Contact style choices are shorting or nonshorting. Actuator features include integral potentiometer, actuator detents, tease proof, and guarded positions. Terminal type choices include wire leads, solder terminals, screw terminals, and PCB pins. An important environmental parameter to consider is the operating temperature. Zhang_Ch01.indd 41 5/13/2008 5:45:25 PM 42 INDUSTRIAL CONTROL TECHNOLOGY (b) Multiple-deck rotary switch. Multiple-deck rotary switches can control several circuits simultaneously. Actuator choices for multiple-deck rotary switches include flush actuator, bare shaft actuator, knobbed shaft, and locker. In a flush actuator configuration the actuator does not project above the switch body, and typically requires a screwdriver for operation. In a bare shaft actuator configuration the shaft has no knob, but may be notched to accept various knob configurations. A knobbed shaft comes with an integral knob. In a locker configuration the actuation is done with a key or other secure or tamperproof method. Important physical switch specifications to consider when searching for multiple-deck rotary switches include angle between positions, mechanical life, number of decks, and number of poles per deck. The angular distance (in degrees) exists between positions. For example, for a 4-position switch, the angle of throw is 90°; for a 100-position switch, the angle of throw is 3.6°. The mechanical life is the maximum life expectancy of the switch. Often, electrical life expectancy is less than mechanical life (please consult manufacturer). The number of decks specifies the maximum number of decks that can be attached to a common actuating shaft. The number of poles per deck refers to the number of separate circuits that can be activated through a switch at any given time per deck. Important electrical switch specifications to consider include maximum current rating, maximum AC voltage rating, and maximum DC voltage rating. Common materials of construction for the base and actuator include plastics and metals. Other specifications to consider for multiple-deck rotary switches include stop style, contact style, actuator features, terminal type, features, and environmental parameters. Stop style choices include fixed stop, adjustable stop and continuous or no stops. Contact style choices are shorting or nonshorting. Actuator features include integral potentiometer, actuator detents, tease proof, and guarded positions. Terminal type choices include wire leads, solder terminals, screw terminals, and PCB pins. Common features for multiple-deck rotary switches include optional coded outputs, momentary on, wiping contacts, CE certification, CSA certification, UL listed, dustproof, and weather resistant or waterproof. An important environmental parameter to consider is the operating temperature. Zhang_Ch01.indd 42 5/13/2008 5:45:25 PM 43 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL (c) Magnetic limit switches. Magnetic limit switches work based on the operation of reed switches (see Section 1.2.8), and are more reliable than the read switches because of their simplified construction. The switches are constructed of flexible ferrous strips (reeds) and are placed near the intended travel of the valve stem or control rod extension. When using reed switches, the extension used is a permanent magnet. As the magnet approaches the reed switch, the switch shuts. When the magnet moves away, the reed switch opens. This ON/OFF indicator is similar to a mechanical limit switch. By using a large number of magnetic reed switches, incremental position can be measured. Failures are normally limited to a reed switch, which is stuck open or stuck shut. If a reed switch is stuck shut, the open (closed) indication will be continuously illuminated. If a reed switch is stuck open, the position indicator for that switch remains extinguished regardless of valve position. 1.1.7.3 Calibration Limit switches are not adjusted at the factory. Limit switches should be set during installation according to the specifications from the factories and vendors. In most cases, turning some screws performs these adjustments. Figure 1.18 is an example of a rotary limit switch that gives eight positions. By turning some screws, each of these positions can be fitted in installations. Position 1 Position 2 Position 3 Position 4 Position 5 Position 7 Position 6 Position 8 Figure 1.18 The positions of a rotary limit switch. Zhang_Ch01.indd 43 5/13/2008 5:45:25 PM 44 1.1.8 INDUSTRIAL CONTROL TECHNOLOGY Photoelectric Devices Photoelectric sensors and switches represent perhaps the largest variety of problem-solving choices in the industrial sensor market. Today, photoelectric technology has advanced to the point where it is common to find a sensor or a switch that can detect a target less than 1 mm in diameter while other units have a sensing range up to 60 m. These factors make them extremely adaptable in an endless array of applications. Photoelectric sensors and switches and their future successors will continue to be key detection devices that can be depended on for these applications. Photoelectric sensors and switches are used extensively on packaging machinery, automatic door systems, automotive and metal industries, and food processing industry. For example, they are used for detecting the presence of automobile wheel rims and tire presence on an assembly line in automotive and metal industries, or for detecting the part cases on an assembly line in food processing and packaging. A very familiar application of photoelectric switches is that they can turn the trap on at dark and off at daylight. This enables the user to set the trap out earlier and retrieve it later in the morning while reducing wear on the battery. Quite often, a garage door opener has a through beam photoelectric sensor mounted near the floor, across the width of the door. This sensor makes sure nothing is in the path of the door when it is closing. A more industrial application for a photoelectric device is detecting objects on a conveyor. An object will be detected any place on a conveyor running between the emitter and the receiver as long as there is a gap between the objects and the sensor’s light does not “burn through” the object. This is more a figurative term than a literal one. It refers to an object that is thin or light in color and allows the light emitted from the emitter to penetrate the target so the receiver never detects the object. 1.1.8.1 Operating Principle Almost all photoelectric sensors and switches contain an emitter, which is a light source such as a light emitting diode or laser diode, a photodiode, or a phototransistor receiver to detect the light source, as well as the supporting electronics designed to amplify the signal relayed from the receiver. Photoelectric sensing uses a beam of light to detect the presence or absence of an object: the emitter transmits a beam of light either visible or infrared, which in some fashion is directed to and detected by the receiver. All photoelectric sensors and switches identify their output as “dark on” and “light on,” which refer to output of the sensor or switch in Zhang_Ch01.indd 44 5/13/2008 5:45:26 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 45 relation to when the light source is hitting the receiver. If an output is present while no light is received, this would be called a “dark-on” output. In reverse, if the output is ON while the receiver is detecting the light from the emitter, the sensor or switch would have a “light-on” output. Either way, a light-on or dark-on output needs to be selected prior to purchasing the sensor unless it is user adjustable. In this case it can be decided upon during installation by either flipping a switch or wiring the sensor accordingly. The method in which light is emitted and delivered to the receiver is the way to categorize the different photoelectric configurations. They can be categorized into three main categories: through beam, retroreflective, and proximity. (1) Through beam photoelectric sensors or switches. are configured with the emitter and detector opposite the path of the target and sense presence when the beam is broken. (2) Retroreflective photoelectric sensors or switches. are configured with the emitter and detector in the same housing and rely on a reflector to bounce the beam back across the path of the target. This type may be polarized to minimize false reflections. (3) Proximity photoelectric sensors or switches. have the emitter and detector in the same housing and rely upon reflection from the surface of the target. This mode can include presence sensing and distance measurement via analog output. The proximity category can be further broken down into five submodes: diffuse, divergent, convergent, fixed field, and adjustable field. With a diffuse sensor the presence of an object is detected when any portion of the diffuse reflected signal bounces back from the detected object. Divergent beam sensors and switches are shortrange, diffuse-type sensors or switches without collimating lenses. Convergent, fixed focus, or fixed distance optics (such as lenses) are used to focus the emitter beam at a fixed distance from the sensor or switch. Fixed-field sensors or switches are designed to have a distance limit beyond which they will not detect objects, no matter how reflective. Adjustable field sensors or switches utilize a cut-off distance beyond which a target will not be detected, even if it is more reflective than the target. Some photoelectric sensors and switches can be set for multiple different optical sensing modes. Reflective properties of the target and environment are important considerations in the choice and use of photoelectric sensors and switches. Zhang_Ch01.indd 45 5/13/2008 5:45:26 PM 46 INDUSTRIAL CONTROL TECHNOLOGY Diffuse sensors or switches operate under a somewhat different style than retroreflective and through-beams although the operating principle remains the same: diffuse photoelectric sensors and switches actually use the target as the “reflector,” such that detection occurs upon reflection of the light off the object back onto the receiver as opposed to an interruption of the beam. The emitter sends out a beam of light. Most often it is a pulsed infrared, visible red, or laser beam, which is reflected by the target when it enters the detectable area. The beam is diffused off of the target in all directions. Part of the beam will actually return to the receiver inside the same housing from which the sensor or switch originally emitted it. Detection occurs and the output will either turn on or off (depending upon if it is light on or dark on) when sufficient light is reflected to the receiver. This can be commonly witnessed in airport washrooms, where a diffuse photo will detect your hands as they are placed under the faucet and the attending output will turn the water on. In this application, your hands act as the reflector. To ensure repeatability and reliability, photoelectric sensors and switches are available with three different types of operating principles: fixed-field sensing, adjustable field sensing, and background suppression through triangulation. In the simplest terms, these sensors and switches are focused on a specific point in the foreground, ignoring anything beyond that point. (1) Standard fixed-field sensors and switches. operate optimally at their preset “sweet spot,” the distance at which the foreground receiver will detect the target. As a result, these sensors and switches must be mounted within a certain fixed distance of the target. In fixed-field technology, when the emitter sends out a beam of light, two receivers sense the light on its return. The shortrange receiver is focused on the target object’s location. The long-range receiver is focused on the background. If the longrange receiver detects a higher intensity of reflected light than the short-range receiver, the output will not turn on. If the shortrange receiver detects a higher intensity of reflected light than the long-range receiver, an output occurs and the object is detected. (2) Adjustable field sensors and switches. operate under the same principle as fixed-field sensors or switches, but the sensitivity of the receivers can be electrically adjusted using a potentiometer. By adjusting the level of light needed to trigger an output, the range and sensitivity of the sensor or switch can be altered to fit the application. Zhang_Ch01.indd 46 5/13/2008 5:45:26 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 47 (3) Background suppression by triangulation. also emits a beam of light that is deflected back to the sensor or switch. Unlike fixedand adjustable field sensors and switches, which rely on the intensity of the light reflected back to them, background suppression sensors rely completely on the angle at which the beam of light returns. Like fixed- and adjustable field sensors or switches, background suppression sensors or switches feature short-range and long-range receivers in fixed positions. In addition, background suppression sensors or switches have a pair of lenses that are mechanically adjusted to precisely focus the reflected beam to the appropriate receiver, changing the angle of the light received. The long-range receiver is focused through the lens on the background. Deflected light returning along that focal plane will not trigger an output. The short-range receiver is focused, through a second lens, on the target. Any deflected light returning along that focal plane will trigger an output—an object will be detected. 1.1.8.2 Application Guide In industrial control systems which require photoelectric sensors and switches, it is important to check whether the parameters and principle of the sensors and switches satisfy your applications. (1) Choosing the right parameters. Important parameters to consider when looking for photoelectric sensors and switches include sensing mode, detecting range, position measurement window, minimum detectable object, and response time. Sensing modes can be used for detecting presence or absence and position measurement. With a presence or absence sensor, the sensor detects presence or absence in an ON or OFF mode. In position measurement, the sensing mode of the sensor can detect position in a linear region by the intensity of reflected light. Analog output is linear with position in the measurement range. The detecting range is the range of sensor detection. For presence sensors, this goes up to the maximum distance for which the signal is stable. For position measurement sensors, this is the distance or range over which the position vs output response is linear and stable. The position measurement window is the width of linear region for the sensor. For example, if the sensor could measure between 14 and 24 cm, this window would be 10 cm. The minimum detectable object is the smallest sized object detectable by the sensor. The response time is the time from target object entering detection zone to the production of the detection signal. Zhang_Ch01.indd 47 5/13/2008 5:45:26 PM 48 INDUSTRIAL CONTROL TECHNOLOGY Common configuration features for photoelectric sensors and switches include beam visibility, light-on or dark-on modes, light and dark programmability, adjustable sensitivity, self-teaching, laser source, fiber-optic glass, and fiber-optic plastic. The body style of the sensor can be threaded barrel, cylindrical, limit switch, rectangular, slot, ring, and window or frame. The sensor may be self-contained and may have a remote head. Repeatability and reliability are critical to the overall performance of a photoelectric sensor or switch in an industrial processing line. One of the most common type of sensor and switch used for object detection is the diffuse photoelectric sensor which performs well in a wide range of industrial processing applications. However, these sensors and switches can experience problems with some target or background materials. The accuracy of diffuse sensors is often at the mercy of the surface properties of the target and background materials. A nonreflective target, such as a matte or dull black material, is difficult for diffuse photoelectric sensors to detect, because it reflects much less light than a brightly colored or white target. Similarly, if the target is presented against a light-colored or reflective background, the sensor can be falsely triggered by light reflected from the background material rather than the target object. To overcome these challenges, a variety of technologies have been developed to allow the sensors to see an object while ignoring background materials. (2) Choosing the right principle. Photoelectric sensors and switches are reliable, versatile, and able to sense and take on or off action with objects of almost any material, size, and shape at distances ranging from 5 mm to 40 m depending on type and configuration used. The addition of fiber cables considerably extends application opportunities for photoelectric sensors, allowing their installation in confined areas, as well as in areas in which intrinsic safety would normally disallow the use of electronics. For applications where backgrounds are not within sensing range and target color is consistent, a standard diffuse sensor or switch is completely sufficient for object detection. These sensors and switches are also quite effective for detecting large objects. Similarly, if a background within the sensing range is not particularly reflective and the color and reflectivity of the target will remain relatively constant, a fixed- or adjustable field sensor will likely provide trouble-free performance. These sensors are also appropriate for smaller targets than standard diffuse sensors. When reliable sensing is challenging due to shiny backgrounds and targets, shifting colors, and reflectivity, background Zhang_Ch01.indd 48 5/13/2008 5:45:26 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 49 suppression by triangulation is the most repeatable and reliable solution. These sensors and switches, especially laser varieties, are very effective for detecting ultra-small targets. The precisely focused, finely collimated beam allows them to detect extremely small items. When an application requires the durability and performance of a full-featured photoelectric sensor or switch but distances are shorter and space is tight, you can take a 90° turn to right sight of photoelectric sensors and switches. Right sight of photoelectric sensor and switches takes many of the features of the Series 9000 and puts them in a smaller, more adaptable package to deliver excellent detection capabilities where size and shape matter. These photoelectric sensors and switches combine universal voltages (24–264 V AC/DC) with short-circuit protection across the full voltage range. 1.1.8.3 Basic Types (1) Diffuse photoelectric sensors (a) Standard diffuse sensors. The emitter and receiver are in the same housing. The emitter sends out a beam of pulsed red or infrared light that is reflected directly by the target. When the beam of light hits the target at any angle, it is diffused in all directions and some light is reflected back. The receiver sees only a small portion of the original light, switching the sensor when a target is detected within the effective scan range. The simplest diffuse photoelectric sensors use the target object as the reflective surface for object detection. Detection occurs when a beam of infrared, visible red, or laser light emitted from the sensor is deflected off the target material in all directions and detected by the receiver. Standard diffuse sensors have these features: (1) the sensing range depends largely on the reflective properties of the target’s surface, (2) suitable for distinguishing between black and white targets, (3) relatively large active range, and (4) positioning and monitoring with only one sensor. The typical applications of standard diffuse sensors are (1) distinguishing and sorting of objects according to their volume or degree of reflection, (2) counting of objects, and (3) presence detection of boxes. (b) Diffuse sensors with background suppression. These sensors are a special development of the diffuse sensor. The beam of light is closely focused, and therefore able to distinguish a Zhang_Ch01.indd 49 5/13/2008 5:45:26 PM 50 INDUSTRIAL CONTROL TECHNOLOGY target within a precisely defined scan range and ignore targets outside the range. Diffuse sensors with background suppression have these features: (1) sensing range largely independent of the color and surface of the target and (2) they detect small objects. They obtain the following typical applications: (a) sorting objects without concern for the background color, purely on their distance from the sensor and (b) sensing contents within transparent packaging. (2) Retroreflective photoelectric sensors (a) Retroreflective sensors. With the emitter and receiver in the same housing, this sensor transmits a pulsed infrared or red light beam which is reflected back from a “triple prism” reflector or reflective tape. The sensor switches when the light beam is interrupted. These devices recognize objects independent of their surface qualities, as long as they are not too shiny. Retroreflective sensors offer these features: (1) large sensing range and (2) matte-finished objects are recognized independent of their surface properties. The typical applications are (1) height detection of stacked objects and (2) control of randomly positioned objects on a conveyor. (b) Retroreflective sensors with polarization filter. Retroreflective sensors with polarization filters correctly recognize highly reflective objects. The polarizing filter prevents false switching with shiny objects. Only the stray and nonpolarized light from the reflector actuates the sensor. Features are similar to retroreflective sensors, but with the added advantage of being able to accurately distinguish shiny objects. Typical application is for monitoring shiny cans on a conveyor belt. (3) Through-beam photoelectric sensors. Emitter and receiver are in two separate housings facing each other. The sensor switches whenever the light beam is interrupted. The features of the through-beam photoelectric sensors are (1) through-beam sensors offer the largest sensing ranges, (2) the switching point is independent of the surface nature of the object, and (3) due to the narrow effective beam, through-beam sensors have excellent repeatability. Typical applications are (1) monitoring doors and gates and (2) counting and monitoring of objects over large distances. (4) Fiber-optic photoelectric sensors. The front surfaces of the fibers, which are set and glued into the sensing head, are precisely Zhang_Ch01.indd 50 5/13/2008 5:45:26 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 51 ground and polished to provide outstanding optics. Even difficult multiple sensing problems can be solved by using fiber optics. There are two types of fibers: Reflective fiber types may be applied using the same guidelines as diffuse sensors. Throughbeam type fiber optics may be applied using the same guidelines as through-beam sensors. Typical applications are (1) sorting various objects, (2) measuring of diameters and heights, (3) checking for double sheets, (4) detecting small objects, (5) monitoring flow of bread in an oven, and (6) detecting absence/presence of lids on a process filling line. (5) Light barrier photoelectric sensors. The infrared light barrier photoelectric sensors are a series of infrared light through beams, mounted in a tower-type emitter and receiver housing. The beam arrays can be used to recognize objects or to make continuous measurements. The system consists of individual emitters and receivers separately mounted in two towers, placed opposite each other. In addition, a micro controller is also mounted in one of the housings to control the light beams. During a measuring cycle, individual emitting diodes are activated in sequence. At the same time the corresponding receiving diode is enabled. Each light beam is defined as interrupted as soon as the imaginary line from transmitter to receiver is blocked. The same principle is followed for all subsequent beams; hence a light barrier is created. During a measuring cycle all interrupted beams are registered. Light grid sensors with retroreflective technology are simple in installation and setup. (6) Level monitoring photoelectric sensors. Levels can be measured simply and accurately using infrared light, without the need for any electrical or thermal connection between the target medium and sensor. The ratio of reflective indices changes depending on whether the tip of the sensor is surrounded by liquid or air. If the sensor tip is immersed in liquid, the light rays will be deflected into the liquid and the electronics of the receiver changes its switching status. The operating principle remains the same irrespective of whether the liquid medium can conduct electricity or not. The medium can also be clear or cloudy. (7) Line photoelectric sensor. Line photoelectric sensors can easily detect positions, edges, or widths of objects. The accurate information can be read out either as a 4–20 mA or via serial interface. The adopted integrated illumination allows a reliable function without spending too much time on maintenance and installation. Zhang_Ch01.indd 51 5/13/2008 5:45:26 PM 52 INDUSTRIAL CONTROL TECHNOLOGY The three different measuring principles (width, edge, middle) are reachable by a button—the current measuring mode, if the sensor is powerless for a certain time. (8) Photoelectric safety switches. Single-beam or through-beam photoelectric safety switches are used as noncontact access protection to hazardous zones. Photoelectric safety switches consist of testable sender and receiver units in combination with a safety evaluation unit, which are mainly used on robot systems and processing machines. (9) Photoelectric proximity switches. Photoelectric proximity switches are sought for reliable detection of objects within a defined scanning range on a conveyor system. Objects which reduce distance from scanning plane to sensor are detected. Adjusting sensitivity can set scanning range and switching point. In the case of photoelectric switches with fiber-optic cable, the sender and receiver are contained in a single housing. A separate fiber-optic cable is used for the sender and the receiver for operation as a throughbeam system. For use as a proximity switch the sender and receiver fiber-optic cables are combined in one cable. 1.1.9 Proximity Devices Proximity sensing is the ability of a device to tell when it is near an object or when something is near it. This sense keeps a device from running into things. It can also be used to measure the distance from a device to some object. Proximity sensors detect the presence of an object without physical contact, and proximity switches execute necessary responses when sensing the presence of the targets or some critical positions located by the targets. A position sensor determines an object’s coordinates (linear or angular) with respect to a reference; displacement means moving from one position to another for a specified distance (or angle). In effect, a proximity sensor is a threshold version of a position sensor. Proximity sensing is the technique of detecting the presence or absence of an object using a critical distance. Typical applications include the control, detection, position, inspection, and automation of machine tools and manufacturing systems. They are also used in the following machinery: packaging, production, printing, plastic merging, metal working, and food processing, etc. The measurement of proximity, position, and displacement of objects is essential in many different applications: valve position, level detection, process control, machine control, security, etc. Special purpose proximity sensors perform in extreme environments (exposure to high temperatures or harsh chemicals) and address specific Zhang_Ch01.indd 52 5/13/2008 5:45:26 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 53 needs in automotive and welding environments. Inductive proximity sensors are ideal for virtually all metal sensing applications, including detecting all metals or nonferrous metals only. 1.1.9.1 Operating Principle In terms of physics, proximity sensors and switches operate with capacitive, inductive, photoelectric, ultrasonic, and magnetic mechanisms to achieve both the proximity sensing and proximity switching in industrial control. The sensing principle with ultrasonic waves is given in Section 1.1.3; the operating principle with magnetism is given in Section 1.1.6 and with photoelectric physics is given in Section 1.1.8; this subsection therefore introduces the working principle for capacitive and inductive proximity sensors and switches. (1) Capacitive proximity sensors and switches make use of the variation of the parasitic capacitance that develops between the sensor and the object to be detected. When the object is at a predetermined distance from the sensitive side of the sensor, an electronic circuit inside the sensor begins to oscillate. A capacitive sensor can detect metallic and nonmetallic objects like wood, plastic, and liquid materials. The operating distance can be trimmed, making the sensor useful for each specific application. Capacitive proximity sensors are housed in smooth or threaded cylindrical metallic cases. Capacitive proximity sensors sense “target” objects, owing to the target’s ability to be electrically charged. Since even nonconductors can hold charges, this means that just about any object can be detected with this type of sensor. Figure 1.19 demonstrates the working principle of capacitive proximity sensing. As given in Fig. 1.19, a capacitive proximity sensor or switch normally contains four essential components: an electrode assembly, an oscillator circuit, an evaluation circuit, and an output circuit. When the increase in capacitance is large enough, an oscillation is set up. This oscillation is detected by the evaluation circuit, which then changes the state of the output circuit. An electrode assembly is designed so that an electrostatic field is formed between the active electrode and the earth electrode. Any object entering this field will increase the capacitance. The increase in capacitance depends on the following factors: the distance and position of the object in front of the active electrode, the dimensions of the object, and the dielectric constant of the object. Zhang_Ch01.indd 53 5/13/2008 5:45:26 PM 54 INDUSTRIAL CONTROL TECHNOLOGY Internal capacitor plate Effective capacitor plate in target Current sensor Oscillator + DC supply DC output − Air (dielectric) + Figure 1.19 Capacitive proximity sensor and its sensing principle. (2) Inductive proximity sensors and switches comprise an oscillating circuit, a signal evaluator, and a switching amplifier. The coil of this oscillating circuit generates a high-frequency electromagnetic alternating field. This field is emitted at the sensing face of the sensor. If a metallic object (switching trigger) nears the sensing face, eddy currents are generated. The resultant losses draw energy from the oscillating circuit and reduce the oscillations. The signal evaluator behind the oscillating circuit converts this information into a clear signal. Figure 1.20 demonstrates its operating principle. The supply DC is used to generate AC in an internal coil, which in turn causes an alternating magnetic field. If no conductive materials are near the face of the sensor, the only impedance to the internal AC is due to the inductance of the coil. If, however, a conductive material enters the changing magnetic field, eddy currents are generated in that conductive material, and there is a resultant increase in the impedance to the Oscillator (generates AC) Induction coil (generates changing magnetic field) + Magnetic field (metal sensing region) DC supply − + DC output (NO or NC available) Current sensor Figure 1.20 Inductive proximity sensor and its sensing principle. Zhang_Ch01.indd 54 5/13/2008 5:45:26 PM 55 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL AC in the proximity sensor. A current sensor, also built into the proximity sensor, detects when there is a drop in the internal AC current due to increased impedance. The current sensor controls a switch providing the output. The operating principle for both capacitive and inductive is based on a high-frequency oscillator that creates a field in the close surroundings of the sensing surface. The presence of a metallic object (inductive) or any material (capacitive) in the operating area causes a change in the oscillation amplitude. The rise or fall of such oscillation is identified by a threshold circuit that changes the output state of the sensor. The operating distance of the sensor depends on the shape and size of both capacitive and inductive proximity sensing devices and is strictly linked to the nature of the material. Table 1.1 gives the sensitivity of the capacitive proximity sensing devices with respect to several typical metals, and Table 1.2 gives the sensitivity of the inductive proximity sensing devices with respect to several typical metals. Normally, both a capacitive and inductive proximity sensor and switch have a screw that allows regulation of the operating distance. This sensitivity regulation is useful in applications such as detection of full containers and nondetection of empty containers. Table 1.1 The Sensitivity of Capacitive Proximity Sensors for Different Metals Metal Water Plastic Glass Wood 1 ⫻ Sn 1 ⫻ Sn 0.5 ⫻ Sn 0.5 ⫻ Sn 0.4 ⫻ Sn Note: Sn is the operating distance. Table 1.2 The Sensitivity of Inductive Proximity Sensors for Different Metals Fe37 (iron) Stainless steel Brass–bronze Aluminum Copper 1 ⫻ Sn 0.9 ⫻ Sn 0.5 ⫻ Sn 0.4 ⫻ Sn 0.4 ⫻ Sn Note: Sn is the operating distance. Zhang_Ch01.indd 55 5/13/2008 5:45:27 PM 56 INDUSTRIAL CONTROL TECHNOLOGY 1.1.9.2 Application Guide The most important parameter to consider when specifying proximity sensors is the operating distance. The rated operating distance is the distance at which switching takes place. Common body styles for proximity sensors are barrel, limit switch, rectangular, slot style, and ring. Important dimensions to consider when specifying proximity sensors include barrel diameter, length, width, and height. Proximity sensors can be a sensor element or chip, a sensor or transducer, an instrument or meter, a gauge or indicator, a recorder or totalizer, or a controller. A sensor element or chip denotes a “raw” device such as a strain gage, or one with no integral signal conditioning or packaging. A sensor or transducer is a more complex device with packaging and/or signal conditioning that is powered and provides an output such as DC voltage, a current loop, etc. An instrument or meter is a self-contained unit that provides an output such as a display locally at or near the device. Typically it also includes signal processing and/or conditioning. A gauge or indicator is a device that has a (usually analog) display and no electronic output such as a tension gauge. A recorder or totalizer is an instrument that records, totalizes, or tracks force measurement over time. It includes simple data logging capability or advanced features such as mathematical functions, graphing, etc. Load configurations are also important parameters to consider. Proximity sensors may switch an AC load or a DC load. DC load configurations can be NPN or PNP. NPN is a transistor output that switches the common or negative voltage to the load; load is connected between sensor output and positive voltage supply. PNP is a transistor output that switches the positive voltage to the load; load is connected between sensor output and voltage supply common or negative. Wire configurations are 2-wire, 3-wire NPN, 3-wire PNP, 4-wire NPN, and 4-wire PNP. Switch types can be normally open or normally closed. 1.1.9.3 Basic Types and Specifications Proximity sensors and switches can have one of many physics and technology types. The physics types of proximity sensors and switches include capacitive, inductive, photoelectric, ultrasonic, and magnetic proximity sensors or switches. Common terms for technology types of proximity sensors and switches include these kinds of proximity sensing devices: eddy current, air, capacitance, infrared, fiber optics, etc. Proximity sensors and switches can be of the contact or noncontact type. Zhang_Ch01.indd 56 5/13/2008 5:45:27 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 57 (1) Physics types of proximity sensors and switches (a) Capacitive proximity sensors and switches. Capacitive sensing devices utilize the face or surface of the sensor as one plate of a capacitor and the surface of a conductive or dielectric target object as the other. Capacitive proximity sensors can be a sensor element or chip, a sensor or transducer, an instrument or meter, a gauge or indicator, a recorder or totalizer, or a controller. Common body styles for capacitive proximity sensors are barrel, limit switch, rectangular, slot style, and ring. A barrel body style is cylindrical in shape, typically threaded. A limit switch body style is similar in appearance to a contact limit switch. The sensor is separated from the switching mechanism and provides a limit of travel detection signal. A rectangular or block body style is a one-piece rectangular or block-shaped sensor. A slot style body is designed to detect the presence of a vane or tab as it passes through a sensing slot, or “U” channel. A ring-shaped body style is a doughnutshaped sensor, where the object passes through the center of the ring. Electrical connections for capacitive proximity sensors can be fixed cable, connector(s), and terminals. A fixed cable is an integral part of a sensor and often includes “bare” stripped leads. A sensor with connectors has an integral connector for attaching into an existing system. A sensor with terminals has the ability to screw or clamp down. Important specifications for capacitive proximity sensors include operating distance, repeatability, and switching frequency. Rated operating distance is the distance at which switching takes place. Repeatability is the distance within which the sensor repeatably switches. It is a measure of precision. The switching frequency is the frequency at which the switch may be turned ON and OFF. Other important parameters to consider when specifying capacitive proximity sensors include housing materials, dimensions, whether or not the sensor is shielded and intrinsically safe, and environmental operating condition parameters. (b) Inductive proximity sensors and switches. Inductive proximity sensors are noncontact proximity devices that set up a radio frequency field with an oscillator and a coil. The presence of an object alters this field and the sensor is able to detect this alteration. The body style of inductive proximity sensors can be barrel, limit switch, rectangular, slot, or ring. Electrical connections Zhang_Ch01.indd 57 5/13/2008 5:45:27 PM 58 INDUSTRIAL CONTROL TECHNOLOGY for inductive proximity sensors can be fixed cable, connector(s), and terminals. A fixed cable is an integral part of the sensor and often includes “bare” stripped leads. A sensor with connectors has an integral connector for attaching into an existing system. A sensor with terminals has the ability to screw or clamp down. Important specifications for inductive proximity sensors include operating distance, repeatability, field adjustability, and minimum target distance. Rated operating distance is the distance at which switching takes place. Repeatability is the distance within which the sensor repeatably switches. It is a measure of precision. Field adjustable sensors can be adjustable while in use. Depending on the sensor’s technology, there can be minimum target size requirements. Other important parameters to consider when specifying inductive proximity sensors include power requirements, housing materials, dimensions, special features, and environmental operating conditions. (c) Photoelectric proximity sensors and switches. These sensors utilize photoelectric emitters and receivers to detect distance, presence, or absence of target objects. Proximity photoelectric sensors have the emitter and detector in the same housing and rely upon reflection from the surface of the target. This mode can include presence sensing and distance measurement via analog output. The proximity category can be further broken down into five submodes: diffuse, divergent, convergent, fixed field, and adjustable field. A diffuse sensor presence is detected when any portion of the diffuse reflected signal bounces back from the detected object. Divergent beam sensors are short-range, diffuse-type sensors without any collimating lenses. Convergent, fixed focus, or fixed distance optics (such as lenses) are used to focus the emitter beam at a fixed distance from the sensor. Fixed-field sensors are designed to have a distance limit beyond which they will not detect objects, no matter how reflective. Adjustable field sensors utilize a cutoff distance beyond which a target will not be detected, even if it is more reflective than the target. Some photoelectric sensors can be set for multiple different optical sensing modes. Reflective properties of the target and environment are important considerations in the choice and use of photoelectric sensors. Important parameters to consider when looking for photoelectric sensors include sensing mode, detecting range, position measurement window, minimum detectable object, and Zhang_Ch01.indd 58 5/13/2008 5:45:27 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 59 response time. The modes can be presence or absence sensing and position measurement. With a presence or absence sensor, the sensor detects presence or absence in an ON/OFF mode. In a position measurement sensing mode, the sensor can detect position in a linear region by the intensity of reflected light. Analog output is linear with position in the measurement range. The detecting range is the range of sensor detection. For presence sensors, this goes up to the maximum distance for which the signal is stable. For position measurement sensors, this is the distance range over which the position vs output response is linear and stable. The position measurement window is the width of the linear region for the sensor. The minimum detectable object is the smallest sized object detectable by the sensor. The response time is the time from target object entering detection zone to the production of the detection signal. Common configuration features for photoelectric proximity sensors include beam visibility, light-on or dark-on modes, light and dark programmability, adjustable sensitivity, selfteaching, laser source, fiber-optic glass, and fiber-optic plastic. The body style of the sensor can be threaded barrel, cylindrical, limit switch, rectangular, slot, ring, and window or frame. The sensor may be self-contained and may have a remote head. (d) Ultrasonic proximity sensors and switches. Ultrasonic proximity sensing can be a sensor element or chip, a sensor or transducer, an instrument or meter, a gauge or indicator, a recorder or totalizer, or a controller. The body style of the ultrasonic proximity sensors can be barrel, limit switch, rectangular, slot, or ring. Electrical connections can be fixed cable, connector(s), or terminals. Intrinsically safe ultrasonic proximity sensors are incapable of releasing sufficient electrical or thermal energy under normal or abnormal conditions to cause ignition of a specific hazardous atmospheric mixture in its most ignited concentration. Important performance specifications to consider when searching for ultrasonic proximity sensors include maximum operating distance, repeatability, sonic cone angle, impulse frequency, and transmitter frequency. Load configurations are also important parameters to consider. Ultrasonic proximity sensors may switch an AC load or a DC load. Additional parameters that are important to consider when searching for ultrasonic proximity sensors include switch types, housing materials, dimensions, and environmental operating parameters. Zhang_Ch01.indd 59 5/13/2008 5:45:27 PM 60 INDUSTRIAL CONTROL TECHNOLOGY (e) Magnetic proximity sensors and switches. These noncontact proximity devices utilize inductance, Hall effect principles, variable reluctance, or magnetoresistive technology. Magnetic proximity sensors are characterized by the possibility of large switching distances, available from sensors with small dimensions. They detect magnetic objects (usually permanent magnets), which are used to trigger the switching process. As the magnetic fields are able to pass through many nonmagnetic materials, the switching process can also be triggered without the need for direct exposure to the target object. By using magnetic conductors (e.g., iron), the magnetic field can be transmitted over greater distances so that, for example, the signal can be carried away from high-temperature areas. Important specifications for magnetic proximity sensors include operating distance, repeatability, field adjustable, and minimum target distance. Rated operating distance is the distance at which switching takes place. Repeatability is the distance within which the sensor repeatably switches. It is a measure of precision. Field adjustable sensors can be adjustable while in use. Depending on the sensor’s technology, there can be minimum target size requirements. Other important parameters to consider when specifying magnetic proximity sensors include power requirements, housing materials, dimensions, special features, and environmental operating conditions. (2) Technical types of proximity sensors and switches (a) Eddy current proximity sensor or switch. In an eddy current proximity sensor, electrical currents are generated in a conductive material by an induced magnetic field. Interruptions in the flow of the electric currents (eddy currents), which are caused by imperfections or changes in a material’s conductive properties, will cause changes in the induced magnetic field. These changes, when detected, indicate the presence of change in the test object. Eddy current proximity sensors and switches detect the proximity or presence of a target by sensing the magnetic fields generated by a reference coil. They also measure variations in the field due to the presence of nearby conductive objects. Field generation and detection information is provided in the kilohertz to the megahertz range. They can be used as proximity sensors to detect presence of a target, or they can be configured to measure the position or displacement of a target. Target materials for eddy current proximity sensors can be magnetic, nonmagnetic, ferrous, and nonferrous. Magnetic Zhang_Ch01.indd 60 5/13/2008 5:45:27 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 61 target materials are magnetized, usually with a permanent magnet component. Nonmagnetic detection targets do not require magnetization. Ferrous targets for position detection include iron or iron-based materials such as steel, stainless steel, etc. Nonferrous target materials are metallic but are not iron- or steel-based, such as aluminum, brass, and copper. Electrical connections for eddy current proximity sensors can be fixed cable, connector(s), and terminals. A fixed cable is an integral part of a sensor and often includes “bare” stripped leads. A sensor with connectors has an integral connector for attaching into an existing system. A sensor with terminals has the ability to screw or clamp down. Other important parameters to consider include switched output types, position or distance output type, housing materials, dimensions, and environmental operating parameters. (b) Air proximity sensor or switch. The air proximity sensor is a noncontact, no moving part sensor. In the absence of an object, air flows freely from the sensor resulting in a near zero output signal. The presence of an object within the sensing range deflects the normal air flow and results in a positive output signal. At low supply pressure, flow from the sensor exerts only minute forces on the object being sensed and is consequently appropriate for use where the object is light weight or easily marred by mechanical sensors. Since there are no moving mechanical parts in the air proximity sensor, there are no inherent wear mechanisms or life limitations. In this regard, the sensor is not cycle dependent and is particularly appropriate for applications requiring large numbers of cycles. Also, the air proximity sensor is inherently explosion-proof and self-purging. Consequently, it is suitable for many adverse environments. (c) Capacitance proximity sensor or switch. Many industrial capacitance sensors or switches work by means of the physics of capacitance. The physics of capacitance claims that the capacitance varies inversely with the distance between capacitor plates in this arrangement, and a certain value can be set to trigger target detection. Note that the capacitance is proportional to the plate area but is inversely proportional to the distance between the plates. When the plates are close to each other, even a small change in distance between the plates can result in a sizeable change in capacitance. Some of the capacitance proximity switches are tiny 1-in. cube electronic modules that operate using a capacitance Zhang_Ch01.indd 61 5/13/2008 5:45:27 PM 62 INDUSTRIAL CONTROL TECHNOLOGY change technique. These sensors or switches contain two switch outputs: a latched output, which toggles the output ON and OFF with each cap input activation, and a momentary output, which will remain activated as long as the sensor input capacitance is higher than the level set by the module’s adjustment screw. (d) Infrared proximity sensor or switch. Infrared light is beyond the light range visible to the naked human eye and falls between the visible light and microwave spectra (the wavelength is longer than visible light). The longest wavelengths are red, which is where infrared got its name (“beyond red”). Infrared waves are electromagnetic waves and may be detected as also heat; heat from campfires, sunlight, etc., is actually infrared radiation. Infrared proximity sensors work by sending out a beam of infrared light, and then computing the distance to any nearby objects employing the characteristics of the returned signal. (e) Fiber-optic proximity sensor or switch. Fiber-optic proximity sensors are used to detect the proximity of target objects. Light is supplied and returned via glass fiber-optic cables. Fiber-optic cables can fit in small spaces, are not susceptible to electrical noise, and exhibit no danger of sparking or shorting. Light is supplied and returned via glass fiber-optic cables. Glass fiber exhibits very good optical qualities and typically carries high-temperature ratings. Plastic fiber can be cut to length in the field and can be flexible enough to accommodate various routing configurations. Important parameters to consider when specifying fiberoptic proximity sensors include detecting range, position measurement window, minimum detectable object, and response time. The detecting range is the range of sensor detection. For presence sensors, this goes up to the maximum distance for which the signal is stable. For position measurement sensors, this is the distance range over which the position vs output response is linear and stable. The position measurement window is the width of linear region for the sensor. For example, if the sensor could measure between 14 and 24 cm, this window would be 10 cm. The minimum detectable object is the smallest sized object detectable by the sensor. The response time is the time from target object entering detection zone to the production of the detection signal. Other important parameters to consider include output options, dimensions, electrical connections, and environmental operating conditions. Zhang_Ch01.indd 62 5/13/2008 5:45:27 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 1.1.10 63 Scan Sensors Scan sensors, also called image sensors or vision sensors, are built for industrial applications. Common applications for these sensors in industrial control include alignment or guidance, assembly quality, bar or matrix code, biotechnology or medical, color mark or color recognition, container or product counting, edge detection, electronics or semiconductor inspection, electronics rework, flaw detection, food and beverage, gauging, scanning and dimensioning, ID detection or verification, materials analysis, noncontact profilometry, optical character recognition, parcel or baggage sorting, pattern recognition, pharmaceutical packaging, presence or absence, production and quality control, seal integrity, security and biometrics, tool and die monitoring, and web inspection. 1.1.10.1 Operating Principle A scan or vision or image sensor can be thought of as an electronic input device that converts analog information of a document like a map, photograph, or an overlay into an electronic image of a digital format that can be used by the computer. Scanning is the main operation of a scan or vision or image sensor, which automatically captures document features, text, and symbols as individual cells, or pixels, and produces an electronic image. While scanning, a bright white light strikes the image and is reflected onto the photosensitive surface of the sensor. Each pixel transfers a gray value (values given to the different shades of black in the image ranging from 0 (black) to 255 (white), that is, 256 values to the chipset (software). The software interprets the value in terms of 0 (black) or 1 (white), thereby forming a monochrome image of the scanned portion. As the sensor moves ahead, it scans the image in tiny strips and the sensor continues to store the information in a sequential fashion. The software running the scanner pieces together the information from the sensor into a digital form of the image. This type of scanning is known as one-pass scanning. Scanning a color image is slightly different as the sensor has to scan the same image for three different colors: red, green, and blue (RGB). Nowadays most of the color scans or vision or image sensors operate in one-pass scanning all the three colors in one go by using color filters. In principle, a color sensor works in the same way as a monochrome sensor. But in this each color is constructed by mixing red, green, and blue as given in Fig. 1.21. Thus, a 24-bit RGB sensor presents each pixel by 24 bits of information. Usually, a sensor using these three colors (in full 24 RGB mode) can create up to 16.8 million colors. Zhang_Ch01.indd 63 5/13/2008 5:45:27 PM 64 INDUSTRIAL CONTROL TECHNOLOGY Red 85 Green 43 Blue 6 “Brown” Figure 1.21 The scan sensor operation of scanning a color image. In this figure, a pixel of red = 85, and green = 43, and blue = 6 is being scanned which is identified as “brown.” A new technology: full width, single-line contact sensor array scanning has emerged in which the document to be scanned passes under a line of chips which captures the image. In this technology, a scanned line could be considered as the cartography of the luminosity of points on the line observed by the sensor. This new technology enables the scanner to operate at previously unattainable speeds. (1) CCD image sensors. A charge-coupled device (CCD) gets its name from the way the charges on its pixels are read after an exposure. After the exposure the charges on the first row are transferred to a place on the sensor called the read out register. From there, the signals are fed to an amplifier and then on to an analog-to-digital converter. Once the row has been read, its charges on the readout register row are deleted, the next row enters, and all of the rows above march down one row. The charges on each row are “coupled” to those on the row above so when one moves down, the next moves down to fill its old space. In this way, each row can be read one row at a time. Figure 1.22 is an elucidation of the CCD scanning process. (2) CMOS image sensors. A complementary metal oxide semiconductor (CMOS) typically has an electronic rolling shutter design. In a CMOS sensor the data is not literally passed from bucket to bucket. Instead, each bucket can be read independently to the output. This has enabled designers to build an electronic rolling slit shutter. This shutter is typically implemented by causing a reset to an entire row and then, some time later, reading the row out. Zhang_Ch01.indd 64 5/13/2008 5:45:27 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 65 Last row read First row read To output amplifier Figure 1.22 The CCD image sensor shifts one whole row at a time into the readout register. The readout register then shifts one pixel at a time to the output amplifier. The readout speed limits the speed of a wave that passes over the sensor from top to bottom. If the readout wave is preceded by a similar wave of resets, then uniform exposure time for all rows is achieved (albeit, not at the same time). With this type of electronic rolling shutter there is no need for a mechanical shutter except in certain cases. With these advantages, CMOS image sensors are used in some of the finest industrial control devices or finest cameras. Figure 1.23 gives a typical architecture of industrial control devices with CMOS image sensor. 1.1.10.2 Basic Types All scan (or image or vision) sensors can be monochrome or color sensors. Monochrome sensing sensors present the image in black and white or grayscales. Color sensing sensors are able to read the spectrum range using varying combinations of different discrete colors. One common technique is sensing the red, green, and blue components (RGB) and combining them to create a wide spectrum of colors. Multiple chip colors are available on some scan (image or vision) sensors. In a widely used method, the colors are captured in multiple chips, each of them being dedicated to capturing part of the color image, such as one color, and the results are combined to generate the full color image. They typically employ color separation devices such as beam-splitters rather than having integral filters on the sensors. Zhang_Ch01.indd 65 5/13/2008 5:45:27 PM 66 INDUSTRIAL CONTROL TECHNOLOGY WR RD Address Data RAM Address Pixel data CMOS image sensor Pixel clock Line valid Frame valid Clock out Programmable logic Data RD CS 12c data 12c clock Figure 1.23 Block diagram of an industrial control device having CMOS image sensor. The imaging technology used in scan or image or vision sensors includes CCD, CMOS, tube, and film. (1) CCD image sensors (charge-coupled device) are electronic devices that are capable of transforming a light pattern (image) into an electric charge pattern (an electronic image). The CCD consists of several individual elements that have the capability of collecting, storing, and transporting electrical charges from one element to another. This together with the photosensitive properties of silicon is used to design image sensors. Each photosensitive element will then represent a picture element (pixel). With semiconductor technologies and design rules, structures are made that form lines or matrices of pixels. One or more output amplifiers at the edge of the chip collect the signals from the CCD. An electronic image can be obtained in this way: after having exposed the sensor with a light pattern, apply a series of pulses that transfer the charge of one pixel after another to the output amplifier, line after line. The output amplifier converts the charge into a voltage. External electronics will transform this output signal into a form suitable for monitors or frame grabbers. Zhang_Ch01.indd 66 5/13/2008 5:45:27 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 67 CCD image sensors have extremely low noise figures and can also be a color sensor or a monochrome sensor. Choices for array type include linear array, frame transfer area array, full-frame area array, and interline transfer area array. Digital imaging optical format is a measure of the size of the imaging area. Optical format is used to determine what size lens is necessary for use with the imager. Optical format refers to the length of the diagonal of the imaging area. Optical format choices include 1/7, 1/6, 1/5, ¼, 1/3, ½, 2/3, ¾, and 1 in. The number of pixels and pixel size are important to consider. Horizontal pixels refer to the number of pixels in a row of the image sensor. Vertical pixels refer to the number of pixels in a column of the image sensor. The greater the number of pixels, the higher the resolution of the image. Important image sensor performance specifications to consider when searching for CCD image sensors include spectral response, data rate, quantum efficiency, dynamic range, and number of outputs. The spectral response is the spectral range (wavelength range) for which the detector is designed. The data rate is the speed of a data transfer process, normally expressed in megahertz. Quantum efficiency is the ratio of photon-generated electrons that the pixel captures to the photons incident on the pixel area. This value is wavelength dependent so the given value for quantum efficiency is generally for the peak sensitivity wavelength for the CCD. Dynamic range is the logarithmic ratio of well depth to the readout noise in decibels, the higher the number, the better. Common features for CCD image sensors include antiblooming and cooling. Some arrays for CCD image sensors offer an optional antiblooming gate designed to bleed off overflow from a saturated pixel. Without this feature, a bright spot, which has saturated the pixels, will cause a vertical streak. Some arrays are cooled for lower noise and higher sensitivity. An important environmental parameter to consider is the operating temperature. (2) CMOS image sensors operate at lower voltages than CCD image sensors, reducing power consumption for portable applications. In addition to their lower power consumption when compared with CCD image sensors, CMOS image sensors are generally of a much simpler design: often just a crystal and decoupling. For this reason, they are easier to design with, generally smaller, and require less support circuitry. Each CMOS active pixel sensor cell has its own buffer amplifier and can be addressed and read individually. A commonly Zhang_Ch01.indd 67 5/13/2008 5:45:28 PM 68 INDUSTRIAL CONTROL TECHNOLOGY used cell has four transistors and a photo-sensing element. The cell has a transfer gate separating the photo sensor from a capacitive “floating diffusion,” a reset gate between the floating diffusion and power supply, a source-follower transistor to buffer the floating diffusion from readout-line capacitance, and a row-select gate to connect the cell to the readout line. All pixels on a column connect to a common sense amplifier. In addition to being a color sensor or a monochrome sensor, CMOS sensors have two categories as defined by their manner of output: analog and digital. Analog sensors feed their encoded signal in a video format that can be fed directly to standard video equipment. Digital CMOS image sensors provide digital output, typically via a 4/8- or 16-bit bus. The digital signal is direct not requiring transference or conversion via a video capture card. CMOS image sensors can offer many advantages over CCD image sensors. Just some of the technical advantages of CMOS sensors are (1) no blooming, (2) low power consumption, ideal for battery-operated devices, (3) direct digital output (incorporates ADC and associated circuitry), (4) small size and little support circuitry, and (5) simple to design. (3) Tube camera is also an electronic device in which the image is formed on a fluorescent screen. It is then read by an electron beam in a raster scan pattern and converted to a voltage proportional to the image light intensity. (4) Film technology exposes the image onto photosensitive film, which is developed to play or store. The shutter, a manual door that admits light to the film, typically controls exposure. CCD and CMOS are the important types of image sensors. A comparison of CCD and CMOS features is given in Table 1.3. Table 1.3 Comparison of CCD and CMOS Image Sensors Features CCD Smallest pixel size Low noise Lowest dark current –100% fill factor for full-frame CCD Established technology market base Highest sensitivity Electron shutter without artifacts Zhang_Ch01.indd 68 CMOS Single power supply Single master clock Low power consumption X,Y addressing and subsampling Smallest system size Easy integration of circuitry 5/13/2008 5:45:28 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 69 1.1.10.3 Technical Specifications Inspection functions include object detection, edge detection, image direction, alignment, object measurement, object position, bar or matrix code, optical character recognition (OCR), and color mark or color recognition. Other parameters to consider when specifying scan or vision or image sensors include performance features, physical features, lens mounting, shutter control, sensor specifications, dimensions, and operating environment parameters. Sensor specifications to consider when searching for scan or image or vision sensors include number of images stored and maximum inspection rate. The number of images stored represents captured images that can be stored into on-board memory or nonvolatile storage. The maximum inspection rate is the maximum number of parts or process steps that can be inspected or evaluated per unit time. This is usually given in units of inspections per second. Other important parameters of the sensor specifications include (1) Image sensor resolution. Image resolution is a way of expressing how sharp or detailed images are. There are two kinds of resolution: optical and interpolated. The optical resolution of an image sensor is an absolute number because an image sensor’s pixels or photo-elements are physical devices that can be counted. To improve resolution in certain limited respects, the optical resolution can be increased using software. This process, called interpolated resolution, adds pixels to the image to increase the total number of pixels. To do so, software evaluates those pixels surrounding each new pixel to determine what its color should be. For example, if all of the pixels around a newly inserted pixel are red, the new pixel will be made red. It is important to keep in mind that interpolated resolution does not add any new information to the image; it just adds pixels and enlarges the file. This same thing can be done in a photo-editing program such as Photoshop by resizing the image. (2) Color depth. Resolution is not the only factor governing the quality of your images. Equally important is color. When you view a natural scene, or a well done photographic color print, you are able to distinguish millions of colors. Digital images can approximate this color realism, but whether they do so depends on their capabilities and settings. For example, almost all newer computer systems can display what’s called 24-bit True Color. It’s called True Color because these systems display 16 million colors, about the number the human eye can distinguish. Zhang_Ch01.indd 69 5/13/2008 5:45:28 PM 70 INDUSTRIAL CONTROL TECHNOLOGY (3) Shutter control. There is much confusion about the need for a mechanical shutter with scan and image sensors. This discussion below clarifies the differences. Most progressive scan and image sensors can be considered to be long chains of pixels or buckets that are each sensitive to light. Sensing begins by clearing the sensor, and then exposing it to light. After the proper exposure time, the buckets pass from pixel to pixel in a bucket brigade fashion to the output pin. If the sensor is being exposed to light while it is passing the data, the pixels will be polluted with additional light that confuses the image. Therefore, this type of a progressive scan sensor requires a mechanical shutter to block the sensor while it is shifting the data out. Alternatively, some other progressive scan and image sensors have an entire frame store. This frame store is a place to save the contents of each pixel in a shielded bucket that is insensitive to light. The shielded buckets are then passed to the output pin and are, by their nature, not corrupted by additional light. Unfortunately, these sensors must be almost twice the size of their counterparts without the shielded frame storage area. So, it is important to compare the cost of the larger sensor to the savings associated with not needing a mechanical shutter. Both of these implementations can be used for flash photography since the flash can be fired when the sensor is in integration mode. Interlaced scan and image sensors are similar to progressive sensors except that there is a shielded row store located between each pair of odd and even rows. For normal use, alternating frames copy either the odd or even rows into the shielded store prior to shifting while the other row (even or odd) is being exposed. In this way there is the advantage of not requiring a mechanical shutter. However, note that each frame has only half the vertical resolution of the entire sensor. This is the type of sensor commonly found in television cameras. When the flash fires only one-half of the rows will be in integration mode. So, this type of sensor cannot be used for flash photography unless you are willing to limit the vertical resolution. (4) Sensitivity. An International Organization for Standardization (ISO) number that appears on the film package specifies the speed, or sensitivity, of a silver-based film. The higher the number the “faster” or more sensitive the film is to light. Each doubling of the ISO number indicates a doubling in film speed so each of these films is twice as fast as the next fastest. Image sensors are also rated using equivalent ISO numbers. Just as with film, an image sensor with a lower ISO needs more light for a good exposure than one with a higher ISO. All things Zhang_Ch01.indd 70 5/13/2008 5:45:28 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 71 being equal, it is better to get an image sensor with a higher ISO because it will enhance freezing motion and shooting in low light. Typically, ISOs range from 100 (fairly slow) to 3200 or higher (very fast). Some cameras have more than one ISO rating. In low-light situations, you can increase the sensor’s ISO by amplifying the image sensor’s signal (increasing its gain). Some cameras even increase the gain automatically. This not only increases the sensor’s sensitivity, it also increases the noise or “grain,” making the images softer and less sharp. (5) Aspect ratio. Image sensors have different aspect ratios—the ratio of image height to width. The ratio of a square is 1:1 (equal width and height) and that of 35 mm film is 1.5:1 (1.5 times wider than it is high). Most image sensors fall in between these extremes. The aspect ratio of a sensor is important because it determines the shape and proportions of the photographs you create. When an image has a different aspect ratio than the device it’s displayed or printed on, it has to be cropped or resized to fit. Your choice is to lose part of the image or waste part of the paper. To imagine this better, try fitting a square image on a rectangular piece of paper. The aspect ratio of an image sensor determines the shape of your prints. An image will only perfectly fill a sheet of paper if both have the same aspect ratio. If the ratios are different, you have to choose between losing part of the image or leaving some white space on the paper. To calculate the aspect ratio of any camera, divide the largest number in its resolution by the smallest number. For example, if a sensor has a resolution of 3000 × 2000, divide 3000 by 2000. In this case the aspect ratio is 1.5, the same as 35 mm film. (6) Dynamic range. Dynamic range is the ratio of signal to noise of an image sensor. (7) Package. The sensor package is often neglected in sensor selection. It is common in smaller sensors for the package cost to be at least half of the total cost of the product. Sensor packages are costly because they are produced in relatively low volumes, have optical quality glass tops, must be dirt free, have low humidity, and require precise die positioning. (8) Image quality. The size of an image file depends in part on the resolution of the image. The higher the resolution, the more pixels there are to store, so the larger the image file becomes. To make large image files smaller and more manageable most cameras store images in a format called JPEG after its developer, the Joint Photographic Experts Group. This file format not Zhang_Ch01.indd 71 5/13/2008 5:45:28 PM 72 INDUSTRIAL CONTROL TECHNOLOGY only compresses images, but it also allows specifying how much they are compressed. This is a useful feature because there is a trade-off between compression and image quality. Less compression gives better images but cannot store as many images. More compression allows storing more images, but the only problem is that image quality would not be as good. (9) Frame rate. Most digital cameras have automatic exposure controls. There are two delays built into digital cameras that affect the ability to respond to fast action when taking pictures. The first brief delay is between pressing the shutter button and actually capturing the image. This delay, called the refresh rate, occurs because the camera clears the image sensor, sets white balance to correct for color, sets the exposure, and focuses the image. Finally, it fires the flash if it is needed and takes the picture. The second delay, the recycle time, occurs when the captured image is processed and stored. This delay can range from a few seconds to half a minute. Both of these delays affect how quickly a series of photos can be taken one after another, called the frame rate, shot-toshot rate, or click-to-click rate. (10) Clocking and power supply design. This specifies the requirement for a wider variety of power supply voltages and clocks or single power supply voltage and includes clocking. 1.1.11 Force and Load Sensors Force and load sensors cover electrical sensing devices that are used to measure tension, compression, and shear forces. Tension cells are used for measurement of a straight line force “pulling apart” along a single axis, typically annotated as positive force. Compression tension cells are used for measurement of a straight line force “pushing together” along a single axis, typically annotated as negative force. Shear is induced by tension or compression along offset axes. They are manufactured in many different packages and mounting configurations. In industries, force and load sensors are used for security devices, packaging devices, production automation, etc. 1.1.11.1 Operating Principle The most common technologies for the operation of force and load sensors are various types of strain gauges. Strain gauges are measuring elements Zhang_Ch01.indd 72 5/13/2008 5:45:28 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 73 that convert force, pressure, tension, etc., into an electrical signal. They are the most universally used measuring devices for electrical measurement of mechanical quantities. A strain gauge is a resistive elastic sensor whose resistance is a function of applied strain (unit deformation). Many types of strain gauges exit, depending on the electrical resistance to strain. These types include piezoresistive or semiconductor, carbonresistive, bonded metallic wire, and foil gauges. The most widely used characteristic that varies in proportion to strain is electrical resistance. In these gauges the electrical resistance varies linearly with strain. The resistance of an electrically conductive material changes with dimensional changes that take place when the conductor is deformed elastically. When such a material is stretched, the conductors become longer and narrower, which causes an increase in resistance. A Wheatstone bridge then converts this change in resistance to an absolute voltage. The resulting value is linearly related to strain by a constant called the gauge factor. Capacitance devices, which depend on geometric features, can be used to measure strain. Changing the plate area or the gap can vary the capacitance. The electrical properties of the materials used to form the capacitor are relatively unimportant, so capacitance strain gauge materials can be chosen to meet the mechanical requirements. This allows the gauges to be more rugged, providing a significant advantage over resistance strain gauges. (1) The strain gauge. Strain is the amount of deformation of a body due to an applied force. More specifically, strain is defined as the fractional change in length. While there are several methods of measuring strain, the most common is with a strain gauge, a device whose electrical resistance varies in proportion to the amount of strain in the device. The most widely used gauge, however, is the bonded metallic strain gauge. The metallic strain gauge consists of a very fine wire or, more commonly, metallic foil arranged in a grid pattern. The grid pattern maximizes the amount of metallic wire or foil subject to strain in the parallel direction (Fig. 1.24). The cross-sectional area of the grid is minimized to reduce the effect of shear strain and Poisson strain. The grid is bonded to a thin backing, called the carrier, which is attached directly to the test specimen. Therefore, the strain experienced by the test specimen is transferred directly to the strain gauge, which responds with a linear change in electrical resistance. Strain gauges are available commercially with nominal resistance values from 30 to 3000 Ω, with 120, 350, and 1000 Ω being the most common values. Zhang_Ch01.indd 73 5/13/2008 5:45:28 PM 74 INDUSTRIAL CONTROL TECHNOLOGY Alignment marks Solder tabs Active grid length Carrier Figure 1.24 Bonded metallic strain gauge. It is very important that the strain gauge be properly mounted onto the test specimen so that the strain is accurately transferred from the test specimen, through the adhesive and strain gauge backing, to the foil itself. Manufacturers of strain gauges are the best source of information on proper mounting of strain gauges. (2) Strain gauge measurement. In practice, the strain measurements rarely involve quantities larger than a few millistrain ε × 10−3. To measure such small changes in resistance, and compensate for the temperature sensitivity, proper selection and use of the bridge, signal conditioning, wiring, and data acquisition components are required for reliable measurements. (a) Bridge completion. Unless you are using a full-bridge strain gauge sensor with four active gauges, you will need to complete the bridge with reference resistors. Therefore, strain gauge signal conditioners typically provide half-bridge completion networks consisting of two high-precision reference resistors. Figure 1.25 diagrams the wiring of a half-bridge strain gauge circuit to a conditioner with completion resistors R1 and R2. The nominal resistance of the completion resistors is less important than how well the two resistors are matched. Ideally, the resistors are well matched and provide a stable reference voltage of VEX/2 to the negative input lead of the measurement channel. For example, the half-bridge Zhang_Ch01.indd 74 5/13/2008 5:45:28 PM 75 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL EC+ R1 VEX + In+ + – – R2 RG In– EC– RG Strain gauges Signal conditioner Figure 1.25 Connection of half-bridge strain gauge circuit. completion resistors provided on the SCXI-1122 signal conditioning module are 2.5 kΩ resistors, with a ratio tolerance of 0.02%. The high resistance of the completion resistors helps minimize the current drawn from the excitation voltage. (b) Bridge excitation. Strain gauge signal conditioners typically provide a constant voltage source to power the bridge. While there is no standard voltage level that is recognized industry-wide, excitation voltage levels of around 3 and 10 V are common. While a higher excitation voltage generates a proportionately higher output voltage, the higher voltage can also cause larger errors due to self-heating. Again, it is very important that the excitation voltage be very accurate and stable. Alternatively, one can use a less accurate or stable voltage, and accurately measure, or sense, the excitation voltage so the correct strain can be calculated. (c) Excitation sensing. If the strain gauge circuit is located at a distance away from the signal conditioner and excitation source, a possible source of error is voltage drop caused by resistance in the wires connecting the excitation voltage to the bridge. Therefore, some signal conditioners include a feature called remote sensing to compensate for this error. There are two common methods of remote sensing. With feedback remote sensing, you connect extra sense wires to the point where the excitation voltage wires connect to the bridge circuit. The extra sense wires serve to regulate the excitation supply to compensate for lead losses and deliver the needed voltage at the bridge. This scheme is used with the SCXI-1122. An alternative remote sensing scheme uses a separate measurement channel to measure directly the excitation voltage Zhang_Ch01.indd 75 5/13/2008 5:45:29 PM 76 INDUSTRIAL CONTROL TECHNOLOGY delivered across the bridge. Because the measurement channel leads carry very little current, the lead resistance has negligible effect on the measurement. The measured excitation voltage is then used in the voltage-to-strain conversion to compensate for lead losses. (d) Signal amplification. The output of strain gauges and bridges is relatively small. Therefore, strain gauge signal conditioners usually include amplifiers to boost the signal level to increase measurement resolution and improve signal-to-noise ratios. SCXI signal conditioning modules, for example, include configurable gain amplifiers with gains up to 2000. (e) Bridge balancing, offset nulling. When a bridge is installed, it is very unlikely that the bridge will output exactly 0 V when no strain is applied. Rather, slight variations in resistance among the bridge arms and lead resistance will generate some nonzero initial offset voltage. There are a few different ways that a system can handle this initial offset voltage: (i) Software compensation. The first method compensates for the initial voltage in software. With this method, you take an initial measurement before strain input is applied. This initial voltage is then used in the strain equations listed at the end of this application note. This method is simple, fast, and requires no manual adjustments. The disadvantage of the software compensation method is that the offset of the bridge is not removed. If the offset is large enough, it limits the amplifier gain you can apply to the output voltage, thus limiting the dynamic range of the measurement. (ii) Offset nulling circuit. The second balancing method uses an adjustable resistance, or potentiometer, to physically adjust the output of the bridge to zero. For example, Fig. 1.26 illustrates the offset nulling circuit of the SCXI-1321 terminal block. By varying the position of R1 + – VEX RPOT R4 – RNULL R2 VO + R3 Figure 1.26 Offset nulling circuit of SCXI-1321 terminal block. Zhang_Ch01.indd 76 5/13/2008 5:45:29 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 77 the potentiometer (RPOT), you can control the level of the bridge output and set the initial output to 0 V. The value of RNULL sets the range that the circuit can balance. On the SCXI-1321, this resistor is socked for easy adjustment of the balancing range. (iii) Buffered offset nulling. The third method, like the software method, does not affect the bridge directly. With buffered nulling, a nulling circuit adds an adjustable DC voltage to the output of the instrumentation amplifier. For example, the SC-2043-SG strain gauge accessory uses this method. The SC-2043-SG includes a useradjustable potentiometer that can add ±50 mV to the output of an instrumentation amplifier that has a fixed gain of 10. Therefore, the nulling range, referred to input, is ±5 mV. (f) Shunt calibration. The normal procedure to verify the output of a strain gauge measurement system relative to some predetermined mechanical input or strain is called shunt calibration. Shunt calibration involves simulating the input of strain by changing the resistance of an arm in the bridge by some known amount. Shunting, or connecting, a large resistor of known value accomplishes this across one arm of the bridge, creating a known drift resistance. The output of the bridge can then be measured and compared to the expected voltage value. The results can then be used to correct span errors in the entire measurement path, or to simply verify general operation to gain confidence in the setup. 1.1.11.2 Basic Types (1) Force and load sensors. Force and load sensors can be devices of many different types including sensor element or chip, sensor or transducer, instrument or meter, gauge or indicator, and recorder and totalizers. A sensor element or chip denotes a “raw” device such as a strain gauge, or one with no integral signal conditioning or packaging. A sensor or transducer is a more complex device with packaging and/or signal conditioning that is powered and provides an output such a DC voltage, a 4–20 mA current loop, etc. An instrument or meter is a self-contained unit that provides an output such as a display locally at or near the device. Typically it also includes signal processing and/or conditioning. A gauge or indicator is a device that has a (usually analog) display and no electronic output such as a tension gauge. A recorder Zhang_Ch01.indd 77 5/13/2008 5:45:29 PM 78 INDUSTRIAL CONTROL TECHNOLOGY or totalizer is an instrument that records, totalizes, or tracks force measurement over time. It includes simple data logging capability or advanced features such as mathematical functions, graphing, etc. Features common to force and load sensors include biaxial measurement, triaxial measurement, and temperature compensation. Biaxial load cells can provide load measurements along two, typically orthogonal, axes. Triaxial load cells can provide load measurements along three, typically orthogonal, axes. Temperature compensated load cells provide special circuitry to reduce/eliminate sensing errors due to temperature variations. Other parameters to consider include operating temperature, maximum shock, and maximum vibration. (2) Strain gauges. The most common technology used by force and load sensors is the principle of strain gauges. In a photoelectric strain gauge a beam of light is passed through a variable slit, actuated by the extensometer, and directed to a photoelectric cell. As the gap opening changes, the amount of light reaching the cell varies, causing a varying intensity in the current generated by the cell. Semiconductor or piezoelectric strain gauges are constructed of ferroelectric materials. In ferroelectric materials, such as crystalline quartz, a change in the electronic charge across the faces of the crystal occurs when the material is mechanically stressed. The piezoresistive effect is defined as the change in resistance of a material due to an applied stress, and this term is used commonly in connection with semiconducting materials. Optical strain gauge types include photoelastic, moiré interferometer, and holographic interferometer strain gauges. In a fiber-optic strain gauge, the sensor measures the strain by shifting the light frequency of the light reflected down the fiber from the Bragg grating, which is embedded inside the fiber itself. The gauge pattern refers cumulatively to the shape of the grid, the number and orientation of the grids in a multiple grid (rosette) gauge, the solder tab configuration, and various construction features that are standard for a particular pattern. Arrangement types include uniaxial, dual linear, strip gauges, diaphragm, tee rosette, rectangular rosette, and delta rosette. Specialty applications for strain gauges include crack detection, crack propagation, extensometer, temperature measurement, residual stress, shear modulus gauge, and transducer gauge. The three primary specifications when selecting strain gauges are operating temperature, the stat of the strain (including Zhang_Ch01.indd 78 5/13/2008 5:45:29 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 79 gradient, magnitude, and time dependence), and the stability required by the application. The operating temperature range is the range of ambient temperature where the use of the strain gauge is permitted without permanent changes of the measurement properties. Other important parameters to consider include the active gauge length, the gauge factor, nominal resistance, and strain sensitive material. The gauge length of a strain gauge is the active or strain-sensitive length of the grid. The end loops and solder tabs are considered insensitive to strain because of their relatively large cross-sectional area and low electrical resistance. The strain sensitivity, k, of a strain gauge is the proportionality factor between the relative changes of the resistance. The strain sensitivity is a figure without dimension and is generally called gauge factor. The resistance of a strain gauge is defined as the electrical resistance measured between the two metal ribbons or contact areas intended for the connection of measurement cables. The principal component that determines the operating characteristics of a strain gauge is the strain-sensitive material used in the foil grid. 1.1.11.3 Technical Specifications Important parameters for force and load sensors include the force and load measurement range and the accuracy. The measurement range is the range of required linear output. Most force sensors actually measure the displacement of a structural element to determine force. The force is associated with a deflection as a result of calibration. There are many form factors or packages to choose from: S-beam, pancake, donut or washer, plate or platform, bolt, link, miniature, cantilever, canister, load pin, rod end, and tank weighing. Shear cell type can be shear beam, bending beam, or single point bending beam. Force and load sensors can have one of many output types. These include analog voltage, analog current, analog frequency, switch or alarm, serial, and parallel. (1) Force and load sensor specifications (a) Force to measure (i) Force/load measurement range. The range required of linear output. Search Logic: User may specify either, both, or neither of the “At Least” and “No More Than” values. Zhang_Ch01.indd 79 5/13/2008 5:45:29 PM 80 INDUSTRIAL CONTROL TECHNOLOGY Products returned as matches will meet all specified criteria. (ii) Accuracy. The accuracy required of the device. Search Logic: All matching products will have a value less than or equal to the specified value. (b) Force sensor type (i) Tension. Tension cell for measurement of a straight line force “pulling apart” is along a single axis; typically annotated as positive force. (ii) Compression. Tension cell for measurement of a straight line force “pushing together” is along a single axis; typically annotated as negative force. (iii) Shear. Shear is induced by tension or compression along offset axes. Search Logic: All products with ANY of the selected attributes will be returned as matches. Leaving all boxes unchecked will not limit the search criteria for this question; products with all attribute options will be returned as matches. (c) Load cell package. Most force sensors actually measure the displacement of a structural element to determine force. The force is associated with a deflection as a result of calibration. There are many form factors or packages to choose from: S-beam, pancake, donut or washer, plate or platform, bolt, link, miniature, cantilever, canister, load pin, rod end, and tank weighing. Your choices are (i) S-beam. S-beam units are shaped like a squared-off S. Variable resistors (whose resistance is a function of strain induced by the load, e.g., strain gauges or piezoresistive elements) are bonded to the regions of maximum strain and change resistance as a load is applied. These resistance changes are typically measured in a Wheatstone bridge circuit. (ii) Pancake. Pancake cells are similarly instrumented short, low-profile cylinders. They are quite popular and are capable of measuring very small through very large loads. (iii) Donut/washer. Donut cells are like pancake cells but with a through bore or hole. (iv) Plate/platform (v) Bolt. Load sensor with one or two threaded ends for attachment to measured system; measures force along the long axis of the bolt. Zhang_Ch01.indd 80 5/13/2008 5:45:29 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 81 (vi) Link. Sensor for inline measurement of tension or compression. (vii) Miniature. Miniature is a characteristic assigned by the supplier. If the supplier considers the load cell to be miniature, it will be carried in the database as such. (viii) Cantilever. Cantilever units are designed to have the load applied to a cantilever that is typically instrumented at the base. (ix) Canister. Canister cells are instrumented cylinders. They are of considerably higher aspect ratio than pancake cells. (x) Load pin. Load pins are typically instrumented shear elements that undergo a strain when a load is applied. A typical application is an instrumented wrist pin that attaches a hook to a cable on a crane. (xi) Rod end—male. Rod end—male is an instrumented rod with male threads. (xii) Rod end—female. Rod end—female is an instrumented rod with female threads. (xiii) Tank weighing. Tank weighing load cells are specially designed to support tanks. Search Logic: All products with ANY of the selected attributes will be returned as matches. Leaving all boxes unchecked will not limit the search criteria for this question; products with all attribute options will be returned as matches. (d) Sensor output. It includes the type of electrical signal that will be produced. (i) Analog voltage. Output voltage is a simple (usually linear) function of the measurement, including voltage ranges such as 0–10 V, 5 V, and voltage ratios dependent upon excitation, typically expressed as millivolts per volt. (ii) Analog current. Often called a transmitter, a current is imposed on the output circuit proportional to the measurement; typical ranges are 4–20 mA, 0–50 mA, etc. Feedback is used to provide the appropriate current regardless of line noise, impedance, etc. Current outputs are often useful when sending signals over long distances. (iii) Analog frequency. The output signal is encoded via amplitude modulation (AM), frequency modulation Zhang_Ch01.indd 81 5/13/2008 5:45:29 PM 82 INDUSTRIAL CONTROL TECHNOLOGY (FM), or some other modulation scheme; the signal is analog in nature. (iv) Switch/alarm. Sensor triggers on a sensed force level to close or open a switch, or provide a signal to an alarm or interlock. (v) Serial is a standard serial digital output protocol such as RS232, RS422, RS485, USB, etc. (vi) Parallel is a standard parallel digital output protocol such as IEEE 488, a Centronics or printer port, etc. (vii) Other. Any digital outputs other than the standard serial or parallel signals. Simple TTL logic signals are an example. Search Logic: All products with ANY of the selected attributes will be returned as matches. Leaving all boxes unchecked will not limit the search criteria for this question; products with all attribute options will be returned as matches. (e) Category of devices. You can think of products as belonging to general categories based on what they are designed to do and what you have to do to use them. The “category” criteria attempts to distinguish “unpacked” sensors that might be used as part of a larger sensor from, say, a gauge which can be read just by looking at it. (i) Sensor element/chip denotes a “raw” device such as a strain gauge or one with no integral signal conditioning or packaging. (ii) Sensor/transducer. A more complex device with packaging and/or signal conditioning that is powered and provides an output such a DC voltage, a 4–20 mA current loop, etc. (iii) Instrument/meter is a self-contained unit that provides an output such as a display locally at or near the device. Typically it also includes signal processing and/or conditioning. (iv) Gauge/indicator. A device that has a (usually analog) display and no electronic output such as a tension gauge. (v) Recorder/totalizer is an instrument that records, totalizes, or tracks force measurement over time including simple data logging capability or advanced features such as mathematical functions, graphing, etc. Search Logic: All products with ANY of the selected attributes will be returned as matches. Leaving all boxes unchecked will not limit the search criteria for this Zhang_Ch01.indd 82 5/13/2008 5:45:29 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 83 question; products with all attribute options will be returned as matches. (f) Sensor technology (i) Piezoelectric. For piezoelectric devices, a piezoelectric material is compressed and generates a charge that is conditioned by a charge amplifier. (ii) Strain gauge. For strain gauge devices, strain gauges (strain-sensitive variable resistors) are bonded to parts of the structure that deform when making the measurement. These strain gauges are typically used as elements in a Wheatstone bridge circuit, which is used to make the measurement. Strain gauges typically require an excitation voltage and provide output sensitivity proportional to that excitation. Search Logic: All products with ANY of the selected attributes will be returned as matches. Leaving all boxes unchecked will not limit the search criteria for this question; products with all attribute options will be returned as matches. (g) Features (i) Biaxial measurement. Biaxial load cells can provide load measurements along two, typically orthogonal, axes. Search Logic: “Required” and “Must Not Have” criteria limit returned matches as specified. Products with optional attributes will be returned for either choice. (ii) Triaxial measurement. Triaxial load cells can provide load measurements along three, typically orthogonal, axes. Search Logic: “Required” and “Must Not Have” criteria limit returned matches as specified. Products with optional attributes will be returned for either choice. (iii) Temperature compensation. Temperature compensated load cells provide special circuitry to reduce/eliminate sensing errors due to temperature variations. Search Logic: “Required” and “Must Not Have” criteria limit returned matches as specified. Products with optional attributes will be returned for either choice. (2) Strain gauge specifications (a) Construction (i) Electrical resistance. The resistance of an electrically conductive material changes with dimensional changes that take place when the conductor is deformed elastically. When such a material is stretched, the conductors Zhang_Ch01.indd 83 5/13/2008 5:45:29 PM 84 INDUSTRIAL CONTROL TECHNOLOGY become longer and narrower, which causes an increase in resistance. A Wheatstone bridge then converts this change in resistance to an absolute voltage. The resulting value is linearly related to strain by a constant called the gauge factor. (ii) Capacitance. Capacitance devices, which depend on geometric features, can be used to measure strain. Changing the plate area or the gap can vary the capacitance. The electrical properties of the materials used to form the capacitor are relatively unimportant, so capacitance strain gauge materials can be chosen to meet the mechanical requirements. This allows the gauges to be more rugged, providing a significant advantage over resistance strain gauges. (iii) Photoelectric. A beam of light is passed through a variable slit, actuated by the extensometer, and directed to a photoelectric cell. As the gap opening changes, the amount of light reaching the cell varies, causing a varying intensity in the current generated by the cell. (iv) Semiconductor (piezoresistive). In ferroelectric materials, such as crystalline quartz, a change in the electronic charge across the faces of the crystal occurs when the material is mechanically stressed. The piezoresistive effect is defined as the change in resistance of a material due to an applied stress, and this term is used commonly in connection with semiconducting materials. The resistivity of a semiconductor is inversely proportional to the product of the electronic charge, the number of charge carriers, and their average mobility. The effect of applied stress is to change both the number and average mobility of the charge carriers. By choosing the correct crystallographic orientation and dopant type, both positive and negative gauge factors may be obtained. Silicon is now almost universally used for the manufacture of semiconductor strain gauges. (v) Optical photoelastic strain gauges. When a photoelastic material is subjected to a load and illuminated with polarized light from the measurement instrumentation (called a reflection polariscope), patterns of color appear which are directly proportional to the stresses Zhang_Ch01.indd 84 5/13/2008 5:45:29 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 85 and strains within the material. The sequence of colors observed as stress increases is black (zero stress), yellow, red, blue, green, etc. The transition lines seen between the red and green bands are known as “fringes.” The stresses in the material increase proportionally as the number of fringes increases. A closely spaced fringe means a steeper stress gradient, and uniform color represents a uniformly stressed area. Hence, the overall stress distribution can easily be studied by observing the numerical order and spacing of the fringes. Furthermore, a quantitative analysis of the direction and magnitude of the strain at any point on the coated surface can be performed with the Polaris reflection and a digital strain indicator. (vi) Moire interferometry strain gauges. Moire interferometry is an optical technique that uses coherent laser light to produce a high contrast, two-beam optical interference pattern. Moire interferometry reveals planar displacement fields on a part’s surface, which is caused by external loading or other source deformation. It responds only to geometric changes of the specimen and is effective for diverse engineering materials. Contour maps of planar deformation fields can be generated from x and y components of displacements. (vii) Holographic interferometry strain gauges. Holographic interferometry allows the evaluation of strain, rotation, bending, and torsion of an object in three dimensions. Since holography is sensitive to the surface effects of an opaque body, extrapolation into the interior of the body is possible in some circumstances. In one or more double-exposure holograms, changes in the object are recorded. From the fringe patterns in the reconstructed image of the object, the interference phase-shifts for different sensitivity vectors are measured. A computer is then used to calculate the strain and other deformations. (viii) Fiber optic. The sensor measures the strain by shifting the light frequency of the light reflected down the fiber from the Bragg grating, which is embedded inside the fiber itself. Since it is possible to put several sensors on the same fiber, the amount of cabling required is reduced significantly compared to other types of strain gauges. Zhang_Ch01.indd 85 5/13/2008 5:45:29 PM 86 INDUSTRIAL CONTROL TECHNOLOGY Also, since the signal is optical rather than electronic, it is not affected by electromagnetic interference. (ix) Other. Other is unlisted, specialized, or proprietary strain gauge construction. Search Logic: All products with ANY of the selected attributes will be returned as matches. Leaving all boxes unchecked will not limit the search criteria for this question; products with all attribute options will be returned as matches. (b) Physical specifications (i) Active gauge length (grid length). The gauge length of a strain gauge is the active or strain-sensitive length of the grid. The end loops and solder tabs are considered insensitive to strain because of their relatively large cross-sectional area and low electrical resistance. Search Logic: User may specify either, both, or neither of the “At Least” and “No More Than” values. Products returned as matches will meet all specified criteria. (ii) Number of gauges in gauge pattern. The total number of strain gauges in the gauge pattern. Search Logic: User may specify either, both, or neither of the “At Least” and “No More Than” values. Products returned as matches will meet all specified criteria. (iii) Operating temperature. The operating temperature range is the range of ambient temperature where the use of the strain gauge is permitted without permanent changes of the measurement properties. Search Logic: User may specify either, both, or neither of the limits in a “From–To” range; when both are specified, matching products will cover entire range. Products returned as matches will meet all specified criteria. (iv) Gauge factor. The strain sensitivity, k, of a strain gauge is the proportionality factor between the relative changes of the resistance. The strain sensitivity is a figure without dimension and is generally called gauge factor. Search Logic: All matching products will have a value greater than or equal to the specified value. 1.1.11.4 Calibration Calibration and temperature compensation of strain gauge–based weight sensors using the precision sensor signal conditioner integrated circuits is Zhang_Ch01.indd 86 5/13/2008 5:45:30 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 87 becoming increasingly popular. Leading automotive suppliers of safety products are increasingly turning to the use of force sensors in their quest to optimize airbag deployment forces appropriate for the mass of the occupant and severity of the deployment situation. A typical weight sensor characterization requires the use of a deadweight test stand (also sometimes called a creep tester) in order to obtain accurate and repeatable sensor loading. Several points must be observed in order to achieve the desired results. (1) fixture orientation for positive and negative force loads on the test stand; (2) sensor and cable orientation; (3) torque of the sensor mounting bolts; (4) weight numbering; (5) shaft-to-weight clearance (when using an automatic weight lift for removing weights from load); (6) preconditioning sensor and fixtures after sensor mounting; (7) monotonic application and removal of weights; (8) golden samples and data tracking. 1.2 Actuators An actuator is simply defined as a device that produces a linear, rotary motion from a source of power under the action of a source of control. The sources of power driving actuators can be from electric, pneumatic, fluid, and piezoelectric, or some others such as our hands. Actuators are accordingly classed into electric actuators, pneumatic actuators, hydraulic actuators, piezoelectric actuators, as well as manual actuators, based on the applied sources of power. Basic actuators are used to move valves or switches to either fully opened or fully closed positions. Actuators for control or position regulating valves or switches are also given a positioning signal to move to any intermediate position with a high degree of accuracy. Although the most common and important use of an actuator is to open and close valves or switches, current actuator designs go far beyond the basic open and close function to implement more and more positioning functions. Therefore, in some instances of industrial control technology, actuators are also termed as positioners. In addition to directly positioning, an actuator can be packaged together with position sensing equipment, torque sensing, motor protection, logic control, digital communication capacity, Zhang_Ch01.indd 87 5/13/2008 5:45:30 PM 88 INDUSTRIAL CONTROL TECHNOLOGY and even PID control to play a role as a position detector or position indicator. 1.2.1 Electric Actuators Electric actuators, utilizing the simplicity of electrical operation, provide the most reliable means of positioning a valve in a safe condition including fail-safe to close or open, or lock in position on power or system failure. However, electric actuators are not restricted to open or close applications; with the addition of one or more of the available kit options, the requirements for fully fledged control units can often be met. For example, with both weatherproof and flameproof models, the range simplifies process automation by providing true electronic control from process variable to valve and supplies a totally electric system for all environments. The unit can be supplied with the appropriate electronic controls to match any process control system requirement. Electric actuators are actively marketed and considered as replacements for pneumatic actuators. Although pneumatic actuators are still an important method of actuation, more and more often, electric actuators provide a superior solution, especially when high accuracy, high duty cycle, excellent reliability, long life expectancy, and low maintenance are required by extra switches, speed controllers, potentiometers, position transmitters, positioners, and local control station. These options may be added to factory-built units, or supplied in kit form. When supplied as kits all parts are included together with an easy to follow installation sheet. 1.2.1.1 Operating Principle Architecture for an electric actuator is given in Fig. 1.27, which consists basically of gears, a motor, and switches. In these components, the motor plays a key role. In most applications, the motor is the primary torquegenerating component. Motors are available for a variety of supply voltages, including standard single-phase alternating current, three-phase and DC voltages. In some applications, three-phase current for the asynchronous is generated by means of the power circuit module in the electronic, regardless of the power supply (one- or three phase). Frequency converters and microcontrollers allow different speeds and precise tripping torques to be set (no overtorque). When an electric actuator is running, the phase angle is checked and automatically adjusted so that the rotation is always correct. To prevent heat damage due to excessive current draw in a stalled Zhang_Ch01.indd 88 5/13/2008 5:45:30 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL Gears 89 Motor Hand wheel Switches Figure 1.27 Basic components for electric actuator (courtesy of Emerson). condition, or due to overwork, electric actuator motors usually include a thermal overload sensor or switch embedded in the winding of the stator. The sensor or switch is installed in series with the power source, and opens the circuit when the motor is overheated, and then closes the circuit once it has cooled to a safe operating temperature. Electric actuators rely on a gear train (a series of interconnected gears) to enhance the motor torque and to regulate the output speed of the actuator. Some gear styles are inherently self-locking. This is particularly important in the automation of butterfly valves or when an electric actuator is used in modulating control applications. In these situations, seat and disc contact, or fluid velocity, act upon the closure element of the valve and cause a reverse force that can reverse the motor and camshaft. This causes a reenergization of the motor through the limit switch when the cam position is changed. This undesirable cycling will continue to occur unless a motor brake is installed, and usually leads to an overheated motor. Spur gears are sometimes used in rotary electric actuators, but are not selflocking. They require the addition of an electromechanical motor brake for these applications. A few of the self-locking gear styles include the worm and wheel and some configurations of planetary gears. A basic worm gear system operates as follows. A motor applies a force through the primary worm gear to the worm wheel. This, in turn, rotates the secondary worm gear which applies a force to the larger radius of the secondary worm wheel to increase the torque. Zhang_Ch01.indd 89 5/13/2008 5:45:30 PM 90 INDUSTRIAL CONTROL TECHNOLOGY An electric actuator system replacing the traditional hydraulic piston system is given in Fig. 1.28: it is made up of a motor, a reducer, and a ball screw. The motor receives its power from an electrical unit (no longer generated hydraulically) situated in the aircraft’s avionics bay. Electric cables that carry the power to the motor have replaced hydraulic pipes. The control unit is able to directly and individually transmit the braking order to each brake, thus optimizing both braking and the use of each brake in operation. Electric brake technology offers aircraft manufacturers and airline companies significant gains in mass, installation costs (optimized aircraft assembly line integration), and operating costs (maintenance costs). 1.2.1.2 Basic Types Electric actuators are divided into two different types: rotary and linear. Rotary electric actuators rotate from open to closed using butterfly, ball, and plug valves. With the use of rotary electric actuators, the electromagnetic power from the motor causes the components to rotate, allowing for numerous stops during each stroke. Either a circular shaft or a table can be used as the rotational element. When selecting an electric rotary actuator, important factors to consider include actuator torque and range of motion. The actuator torque refers to the power that causes the rotation, while the Reduction gear Stator Ball screw and nut Electric motor Rotor Figure 1.28 Working principle of an electric actuator system. Zhang_Ch01.indd 90 5/13/2008 5:45:30 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 91 full range of motion can be either nominal, quarter-turn, or multiturn. Linear electric actuators, in contrast, open and close using pinch, globe, diaphragm, gate, or angle valves. Linear electric actuators are often used when tight tolerances are required. These electric actuators use an acme screw assembly or motor-driven ball screw to supply linear motion. Within linear electric actuators, the load is connected to the end of a screw that is belt or gear driven. Important factors to consider when selecting linear electric actuators include the number of turns, actuating force, and the length of the valve stem stroke. (1) Linear electric actuators provide linear motion via a motordriven ball screw or screw assembly. The linear actuator’s load is attached to the end of a screw, or rod, and is unsupported. The screw can be direct, belt, or gear driven. Important performance specifications to consider when searching for linear actuators include stroke, maximum rated load or force, maximum rated speed, continuous power, and system backlash. Stroke is the distance between fully extended and fully retracted rod positions. The maximum rated load or force is not the maximum static load. The maximum rated speed is the maximum actuator linear speed, typically rated at low or no load. Continuous power is sustainable power; it does not include short-term peak power ratings. Backlash is position error due to direction change. Motor choices include DC, DC servo, DC brushless, DC brushless servo, AC, AC servo, and stepper. Input power can be specified for DC, AC, or stepper motors. Drive screw specifications to consider for linear actuators include drive screw type and screw lead. Features include selflocking, limit switches, motor encoder feedback, and linear position feedback. Screw choices include acme screws and ball screws. Acme screws will typically hold loads without power but are usually less efficient than ball screws. They also typically have a shorter life but are more robust to shock loads. If backlash is a concern, it is usually better to select a ball screw. Ball screws exhibit lower friction and therefore higher efficiency than “lead screws.” Screw lead is the distance the rod advances with one revolution of the screw. Other features for linear actuators to consider include holding brakes, integrated overload slip clutch or torque limiters, water-resistant construction, protective boot, and thermal overload protection. Design units can be English or metric. Some manufacturers specify both. Dimensions to consider when specifying linear actuators include retracted length, width, height, and weight. The housing can have flanges, rear Zhang_Ch01.indd 91 5/13/2008 5:45:30 PM 92 INDUSTRIAL CONTROL TECHNOLOGY clevis, side angle brackets, side lugs, tapped holes, and spherical bearings. Rod ends can be clevis, female eye, female thread, male thread, and spherical bearing. An important environmental parameter to consider is the operating temperature. (2) Rotary electric actuators provide incremental rotational movement of the output shaft. In its most simple form, a rotary actuator consists of a motor with a speed reducer. These AC and DC motors can be fabricated to the exact voltage, frequency, power, and performance specified. The speed reducer is matched with the ratio to the speed, torque, and acceleration required. Life, duty cycle, limit load, and accuracy are considerations that further define the selection of the speed reducer. Hardened, precision spur gears are supported by antifriction bearings as a standard practice in these speed reducers. Compound gear reduction is accomplished in compact, multiple load path configurations, as well as in planetary forms. The specifications for rotary actuator include angular rotation, torque, and speed, as well as control signals and feedback signals, and the environment temperature. Rotary actuators can incorporate a variety of auxiliary components such as brakes, clutches, antibacklash gears, and/or special seals. Redundant schemes involving velocity or torque summing of two or more motors can also be employed. Today the linear motion in actuators is converted to a rotary one in many applications. By delivering the rotary motion directly, some fittings can be saved in the bed. This enables the bed manufacturer to build in a rotary actuator far more elegantly than a linear actuator. The result is a more “pure” design because the actuator is not experienced as a product hanging under the bed, but as a part of the bed. Those rotary electric actuators are used for modulating valves, which are divided based on the range from multiturn to quarterturn. Electrically powered multiturn actuators are one of the most common and dependable configurations of actuators. A single or three-phased electric motor drives a combination of spurs and/or level gears, which in turn drive a stem nut. The stem nut engages the stem of the valve to open or close it, frequently via an acme threaded shaft. Electric multiturn actuators are capable of quickly operating very large valves. To protect the valve, the limit switch turns off the motor at the ends of travel. The torque sensing mechanism of the actuator switches off the electric motor when a safe torque level is exceeded. Position indicating switches are utilized to indicate the open and closed position of the valve. Zhang_Ch01.indd 92 5/13/2008 5:45:31 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 93 Typically a declutching mechanism and hand wheel are included so that the valve can be operated manually should a power failure occur. The main advantage of this type of actuator is that all of the accessories are incorporated in the package and are physically and environmentally protected. It has all the basic and advanced functions incorporated in a compact housing which can be water tight, explosion proof, and in some circumstances, submersible. The primary disadvantage of an electric multiturn actuator is that should a power failure occur, the valve remains in the last position and the fail-safe position cannot be obtained easily unless there is a convenient source of stored electrical energy. Electric quarter-turn actuators are very similar to electric multiturn actuators. The main difference is that the final drive element is usually in one quadrant that puts out a 90° motion. The newer generation of quarter-turn actuators incorporates many of the features found in most sophisticated multiturn actuators, for example, a nonintrusive, infrared, human machine interface for set up, diagnostics, etc. Quarter-turn electric actuators are compact and can be used on smaller valves. They are typically rated to around 1500 foot pounds. An added advantage of smaller quarter-turn actuators is that because of their lower power requirements, they can be fitted with an emergency power source such as a battery to provide fail-safe operation. Thrust actuators can be fitted to valves which require a linear movement. Thrust actuators transform the torque of a multi-turn actuator into an axial thrust by means of an integrated thrust unit. The required (switch-off) actuating force (thrust and traction) can be adjusted continuously and reproducibly. Linear actuators are mainly used to operate globe valves. Thrust units, fitted to the output drive of a multiturn actuator, consist mainly of a threaded spindle, a metric screw bolt to join the valve shaft, and a housing to protect the spindle against environmental influences. The described version is used for “direct mounting” of the actuator to the valve. However, thrust actuators version “fork joint” (indirect mounting) can also operate butterfly valves or dampers, when direct mounting of a part turn actuator is not possible or efficient. The thrust units of the thrust actuators for modulating duty also comply with the high demands of the modulating duty. Also, for these thrust units, high-quality materials and accurate tolerances secure perfect function for many years of operation. The thrust units are operated by modulating actuators. Zhang_Ch01.indd 93 5/13/2008 5:45:31 PM 94 INDUSTRIAL CONTROL TECHNOLOGY 1.2.1.3 Technical Specification When selecting an electric actuator the specification including power source, correct type, and size can be found utilizing the following criteria: (1) Power source. When electric power is selected, a three-phase supply depends upon the valve driven by the actuator. It is usually required for large valves; however, small valves can be operated on a single-phase supply. Usually an electric valve actuator can accommodate any of the common voltages. Sometimes a DC supply is available. This is often an emergency back-up power supply. Variations of fluid power are much greater. First there is a variety of fluid media such as compressed air, nitrogen, hydraulic fluid, or natural gas. Then, there are the variations in the available pressures of those media. With a variety of cylinder sizes, most of the variations can be accommodated for a particular valve size. (2) Type of valve. Whenever sizing an actuator for a valve, the type of valve has to be known, so that the correct type of actuator can be selected. There are some valves that need multiturn input, whereas others need quarter-turn. This has a great impact on the type of actuator that is required. When combined with the available power supply, the size and type of actuator quickly come into focus. Generally multiturn fluid power actuators are more expensive than multiturn electric actuators. However, for rising nonrotating stem valves a linear fluid power actuator may be less expensive. A definitive selection cannot be made until the power requirements of the valve are determined. After that decision has been made, the torque requirement of the valve will be the next selection criterion. The next task is to calculate the torque required by the valve. For a quarter-turn valve, the best way of determining the torque required is by obtaining the valve maker’s torque data. Most valve makers have measured the torque required to operate their valves over the range of operating line pressures. They make this information available for customers. The situation is different for multiturn valves. These can be subdivided into several groups: the rising rotating, rising nonrotating, and nonrising rotating valves. In each of these cases the measurement of the stem diameter together with the lead and pitch of the valve stem thread is required in order to size the automation for the valve. This information coupled with the size of the valve and the differential pressure across the valve can be used to calculate torque demand. Zhang_Ch01.indd 94 5/13/2008 5:45:31 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 95 (3) Type and size of the electric actuator. The type and size of the actuator can be determined after the power supply, the type of valve, and the torque demand of that valve have been defined. Once the actuator type has been selected and the torque requirement of the valve has been determined, then the actuator can be sized using one of the actuator manufacturer’s sizing programs or tables. A further consideration in sizing the actuator is the required speed of operation of the valve. As speed has a direct relationship to the power required from the actuator, more horsepower would be needed to operate a valve at a faster speed. The electric motor operators of the three-phase type have a fixed speed of operation. Smaller, quarter-turn actuators utilize DC motors and may have adjustable speed of operation. (4) Predictive maintenance. Motor operators can utilize built-in data loggers coupled with highly accurate torque sensing mechanisms to record data on the valve as it moves through its stroke. The torque profiles can be used to monitor changes in the operating conditions of the valve and to predict when maintenance is required. They can also be used to troubleshoot valves. Forces on a valve can include the following: (1) valve seal or packing friction; (2) valve shaft, bearing friction; (3) valve closure element seat friction; (4) closure element travel friction; (5) hydrodynamic forces on closure elements; (6) stem piston effect; (7) valve stem thread friction. Most of these are present in all types of valves, but in varying degrees of magnitude. For example, closure element travel friction in a butterfly valve is negligible, whereas a nonlubricated plug valve has significant travel friction. Valve actuators are designed to limit their torque to a preset level using a torque switch, usually in a closing direction. An increase in torque above this level will stop the actuator. In the opening direction, the torque switch is frequently bypassed for the initial unseating operation. The resulting torque profile is useful in analyzing the valve condition. Different types of valves have different profiles. For example, a wedge gate valve has significant torque at the opening and closing positions. During the remaining portion of the stroke the torque demand is made up of packing and thread friction on the acme threaded shaft. On seating, the hydrostatic force on the closure element increases the seating friction, and finally the wedging effect of the closure element in the seat causes a rapid increase in torque demand until seating is completed. Changes in torque profile can, therefore, give a good indication of pending problems and can provide valuable information for an effective predictive valve maintenance program. Zhang_Ch01.indd 95 5/13/2008 5:45:31 PM 96 INDUSTRIAL CONTROL TECHNOLOGY 1.2.1.4 Application Guides There are many applications where an electric actuator may be considered for the process control. Although electric actuators may be used anywhere a power source (electricity) is available, there are many applications where they are particularly well suited. For instance, in many remote installations, it may be impractical to run an air supply and to maintain it. Air lines that freeze up may clog and render the equipment inoperable or damage more delicate instruments. If only a few actuators are to be installed in an area, electric actuators offer a simple means of automation for these smaller systems. Perhaps one of the most important reasons for the trend toward using electric actuators has been the decreasing cost of using computers as system controllers and the ease and economy with which the actuators can be interfaced to such systems. This trend can be expected to accelerate with the advent of new microprocessors, or smart controllers, based on the versatile, low-cost microprocessor chips. Because of the increased speed and decision- and control-making capability that the computer adds to a process system, there is less need for final control elements, which have high control capability, such as characterized by globe and plug valves. As a result, the simpler and less expensive electric actuators and ball and butterfly valves have become more acceptable and are proving more than adequate for many applications. Probably the most important reason for the widespread use of electric actuators is their control circuit versatility. As an electric device, electric actuators naturally lend themselves for use as an enclosure for a variety of control and feedback devices. Furthermore, the switch and cams may be set and wired for almost any contact development for process and valve control. It is more economical to install and maintain electric valve actuators than pneumatic ones. A pneumatic system includes not only actuators, but also compressors, piping, filters, air lubrication systems, and dryers. However, electric actuators eliminate the need for air, an expensive source of energy, and do not require energy when not in motion. There is no need to be concerned with compressor noise, housing to shield against noise, air venting, or other operating restrictions associated with pneumatic systems. One important advantage of an electric actuator is its ability to manually “jog” the valve position when it is used in filling operations. By installing a feedback potentiometer an operator can monitor the exact position of the actuators and stop it at any point between open and closed with a manual control switch. Zhang_Ch01.indd 96 5/13/2008 5:45:31 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 97 A few examples of the control circuit versatility of electric actuators are three-position control and interposing relay. Three-position control is especially useful for the automation of multiported (three- or four-way) valves. A simple ON/OFF switch powers an interposing relay. This circuit is similar to the type used in energizing single-acting solenoid valves in pneumatic actuator installations. (1) Controls. The great advantage of having an automated valve is that it can be remotely controlled. This means that operators can sit in a control room and control a process without having to physically go to the valve and give it an open or close command, the most basic type of control for an automated valve. The ability to remotely control a valve is easily achieved by running a pair of wires out to the actuator from the control room. Applying power across the wires can energize a coil, initiating motion in an electric or fluid power actuator. Positioning a valve in an intermediate position can be done using this type of control. However, feedback would be needed to verify whether the actuator is at the desired position. A more common method of positioning an actuator is to feed a proportional signal to the actuator, such as 4–20 mA, so that the actuator, using a comparator device, can position itself in direct proportion to the received signal. (2) Modulating control. In some workplaces where an actuator is required to control a level, flow, or pressure in a system, it may be required to move frequently. Modulating or positioning control can be achieved using the same 4–20 mA signal. However, the signal would change as frequently as the process required. If very high rates of modulation are required then special modulating control valve actuators are needed that can accommodate the frequent starts required for such duty. Where there are many actuators on a process, the capital cost of installation can be reduced by utilizing digital communication over a communicating loop that passes from one actuator to another (Fig. 1.29). A digital communication loop can deliver commands and collect actuator status rapidly and cost effectively. There are many types of digital communication such as Foundation Fieldbus, Profibus, DeviceNet, Hart, as well as proprietary communication systems custom designed for valve actuator use such as Pakscan. Digital communication systems have many advantages over and above the saving in capital cost. They are able to collect a lot of data about the condition of the valve, and as such can be used for predictive maintenance programs. Zhang_Ch01.indd 97 5/13/2008 5:45:31 PM 98 INDUSTRIAL CONTROL TECHNOLOGY Figure 1.29 Digital communication systems for remote control of valves (courtesy of Rotork Controls, Inc.). 1.2.1.5 Calibrations Here, VA-7202 Electric Valve Actuator (Johnson Controls, Inc.) is taken as an example to introduce a method and a process for calibrating electric actuators. (1) Set the stroke jumper to approximate the stroke of the valve. See Fig. 1.30 for jumper location that includes (1) Jumper 8: 5/16 in. or 8 mm; (2) Jumper 10: 3/8 in. or 10 mm; (3) Jumper 13: 1/2 in. or 13 mm; (4) Jumper 19: 3/4 in. or 19 mm. Stroke jumpers Stroke adjustment Input signal selection Span value 8 10 13 19 Action selection DA RA V mA *Supply disconnect Starting point Down Up 1 2 3 4 Fail-safe input signal Down Up LED * Disconnects power supply to the circuit must be in place for actuator operation. Figure 1.30 VA-7202 electric actuator (Johnson Controls, Inc.) components. Zhang_Ch01.indd 98 5/13/2008 5:45:31 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 99 (2) Set the direct/reverse action jumper so that the valve stem travels in the desired direction (per changes in control signal) including (1) DA (top jumper) = stroke down on signal increase; (2) RA (bottom jumper) = stroke up on signal increase. (3) Set the input signal selection jumper for voltage input or current (mA) input to match the controller output; see Fig. 1.30. (If the input signal selection jumper is removed, the actuator defaults to voltage input.) However, if mA input is selected, multiply the start and span scales by 2. (4) Set the signal fail position jumper to select default position of fully up or fully down. If the signal is lost at the actuator (open connection), the actuator will default to the predesignated position of full up or full down. However, if mA input is selected, the actuator will default to the low input signal position. (5) Adjust the potentiometers to the nominal values. Set the stroke adjustment to the midpoint as shown in Fig. 1.30. Set the starting point (offset) to the low input signal using the scale printed on the circuit board as a reference. Set the span value to the high input signal minus the offset and then use the scales for reference. (6) Apply voltage specified by application (RA/DA) requirements to drive the actuator to the full up position. If mA input is selected, multiply all values by 2. (7) Slowly turn the starting point potentiometer (shown in Fig. 1.30) CW (clockwise) until the valve stem reaches the end of stroke to ensure that the valve stem is in the full-up position. LED will be on; there should be no gear movement. (8) Slowly turn the starting point potentiometer counterclockwise (CCW); stop when the LED flashes or goes out. If the LED does not flash or go out, verify Dimension “A” gaps. Excessive gap may not allow full-up calibration. The actuator circuit contains a time-out feature. If calibration takes longer than 3–10 min, the LED will go out giving a false satisfied condition. If this occurs, cycle the power to the actuator and readjust the starting point. (9) Apply the input voltage specified by application (RA/DA) requirements to drive the valve stem to the full-down position per chart in Step 6. (10) To ensure that the valve stem is in the full-down position, slowly turn the stroke potentiometer CW until the valve stem reaches the end of stroke. LED will be on, and there should be no gear movement. (11) Slowly turn the stroke potentiometer CCW until the LED goes off. Zhang_Ch01.indd 99 5/13/2008 5:45:33 PM 100 INDUSTRIAL CONTROL TECHNOLOGY (12) If the full-down position cannot be reached, return the stroke potentiometer to the nominal position and slowly turn the span potentiometer CCW until full down is reached. Then, repeat Step 11. (13) Adjust voltage to drive the actuator to the full-up position. Verify starting point adjustment. (14) Check for proper operation using the desired minimum and maximum operating voltages. Allow the actuator to operate through several complete cycles. The LED will remain on for 3–10 min after the actuator has completed the operation cycle. (15) Replace the cover and secure with the screws. At this point, the unit is ready for operation. 1.2.2 Pneumatic Actuators Pneumatics have obtained a variety of applications in manufacturing to control industrial processes, in automotive and aircraft settings to modulate valves, even in medical equipment such as dentistry drills to actuate torque movements, etc. In contrast with other physics like electrics and hydraulics, the operating torque of pneumatics makes possible a compact actuator that is economical to both install and operate. Pneumatic devices are also used where electric motors cannot be used for safety reasons and where no water is supplied, such as mining applications where rock drills are powered by air motors to preclude the need for electric motors deep in the mine where explosive gases may be present. In many cases, it is easier to use a liquid or gas at high pressure rather than electricity to provide power for the actuator. Pneumatic actuators provide a very fast response but little power, whereas hydraulic systems can provide very great forces, but act more slowly. This is partly because gases are compressible and liquids are not. The pneumatic actuators (Fig. 1.31) offer the latest technology; a premium quality ball valve, a quality actuator designed to meet the torque requirements of the valve, and a mounting system which ensures alignment and rigidity. 1.2.2.1 Operating Principle Industrial pneumatics may be contrasted with hydraulics that use uncompressible liquid media such as oil, or water combined with soluble oil, instead of air. Air is compressible, and therefore it is considered to be a fluid. The pneumatic principles conclude that the pressure formed in compressible liquids can be harnessed to a high potential of power. This gives us new potential for several pneumatic-powered operations and Zhang_Ch01.indd 100 5/13/2008 5:45:33 PM 101 H0 H0 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL D D H H Air inlet Air inlet Air to open Air to close Figure 1.31 Components of a spring-type pneumatic actuator (courtesy of Forbes Marshall). hence creates many new developments. Both pneumatics and hydraulics are applications of fluid power. Both pneumatic linear and rotary actuators use pressurized air to drive or rotate mechanical components. The flow of pressurized air produces the shift or rotation of moving components via a stem and spring, rack and pinion, cams, direct air or fluid pressure on a chamber or rotary vanes, or other mechanical linkage. A valve actuator is a device mounted on a valve that, in response to a signal, automatically moves the valve to the desired position using an outside power source. Pneumatic valve actuators convert air pressure into motion. (1) Linear pneumatic actuators. A simplified diagram of a pneumatic linear actuator is shown in Fig. 1.32. It operates with a combination of force created by air and spring force. The actuator shifts the positions of a control valve by transmitting its motion through the stem. A rubber diaphragm separates the actuator housing into two air chambers. The left or upper chamber receives a supply of air through an opening in the top of the housing. The right or bottom chamber contains a spring that forces the diaphragm against mechanical stops in the upper chamber. Finally, a local indicator is connected to the stem to indicate the position of the valve. Zhang_Ch01.indd 101 5/13/2008 5:45:33 PM 102 INDUSTRIAL CONTROL TECHNOLOGY Positioner Stem Spring Air Chamber Figure 1.32 Operation principle of a simplified linear pneumatic actuator. The position of the valve is controlled by varying supply air pressure in the left or upper chamber, which results in a varying force on the top of the diaphragm. At the beginning, with no supply air, the spring forces the diaphragm upward against the mechanical stops and holds the valve fully open. As supply air pressure is increased from zero, its force on top of the diaphragm begins to overcome the opposing force of the spring. The causes the diaphragm to move rightward or downward and the control valve to close. With increasing supply air pressure, the diaphragm will continue to move rightward or downward and compress the spring until the control valve is fully closed. Conversely, if supply air pressure is decreased, the spring will force the diaphragm leftward or upward and open the control valve. Additionally, if supply pressure is held constant at some value between zero and maximum, the valve will position at an intermediate point. The valve can hence be positioned anywhere between fully open and fully closed in response to changes in supply air pressure. A positioner is a device that regulates the supply air pressure to a pneumatic actuator. It does this by comparing the position demanded by the actuator with the control position of the valve. The requested position is transmitted by a pneumatic or electrical control signal from a controller to the positioner. The controller generates an output signal that represents the requested position. This signal is sent to the positioner. Externally, the positioner consists of an input connection for the control signal, a supply air input connection, a supply air output connection, a supply air vent connection, and a feedback linkage. Internally, it contains an intricate network of electrical transducers, air lines, valves, linkages, and necessary adjustments. Zhang_Ch01.indd 102 5/13/2008 5:45:34 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 103 Other positioners may also provide controls for local valve positioning and gauges to indicate supply air pressure and controller pressure. (2) Rotary pneumatic actuators. Pneumatic rotary actuators may have fixed or adjustable angular strokes and can include such features as mechanical cushioning, closed-loop hydraulic dampening (oil), and magnetic features for reading by a switch. When the compressed air enters the actuator from the first tube nozzle, the air will push the double pistons toward both ends (cylinder end) for straight line movement. The gear on the piston drives the gear on the rotary shaft to rotate counterclockwise, and then the valve can be opened. This time, the air at both ends of the pneumatic actuator will drain with another tube nozzle. Conversely, when the compressed air enters the actuator from the second tube nozzle, the gas will push the double pistons toward the middle for straight line movement. The rack on the piston drives the gear on the rotary shaft to rotate clockwise and then the valve can be closed. This time, the air at the middle of the pneumatic actuator will drain with the first tube nozzle. Above is the standard-type driving principle. According to users’ requirement, the pneumatic actuator can be assembled into the driving principle beyond the standard type, which means opening the valve while rotating the rotary shaft clockwise and closing the valve while rotating the rotary shaft counterclockwise. Figure 1.33(a) is for the double-acting type. For clockwise operation, Port 2 (P2) is open to atmosphere, and air pressure is directed to Port 1 (P1). As the pistons move apart, the pinion rotates clockwise. The linear movement of the pistons is converted to rotary motion by the piston racks and the output pinion gear. For counterclockwise operation, Port 1 is open to atmosphere and air pressure is directed to Port 2. The pressure differential moves the pistons together, rotating the pinion counterclockwise. Figure 1.33(b) is for the spring-return type. For clockwise operation, Port 2 is open to atmosphere and air pressure is directed to Port 1. The air pressure compresses the springs and moves the pistons outward. As the pistons move apart, the pinion rotates clockwise. The linear movement of the pistons is converted to rotary motion by the piston racks and the output pinion gear. For counterclockwise operation, Port 1 is open to atmosphere and air pressure is directed to Port 2. High pressure and/ or spring force moves the pistons inward, rotating the pinion counterclockwise. Zhang_Ch01.indd 103 5/13/2008 5:45:34 PM 104 INDUSTRIAL CONTROL TECHNOLOGY P1 P2 Clockwise operation P1 P2 Clockwise operation P1 P2 Counterclockwise operation P1 P2 Counterclockwise operation (a) (b) Figure 1.33 Operation principle of rotary pneumatic actuators: (a) double acting and (b) spring return. 1.2.2.2 Basic Types and Specifications In terms of the actuated movements, pneumatic actuators can be two types: linear and rotary. (1) Pneumatic linear motion specifications: (a) breakaway torque (in. lb) (b) actuation type: spring return or double acting (c) fail safe: no or yes (d) positioner: no or yes; if yes: pneumatic or electropneumatic (e) limit switch: no, two, or four. (2) pneumatic rotary valve specifications: (a) output torque (in. lb) (b) pipe size (specify) (c) product flowing in pipe (specify) (d) temperature (oF) (e) pressure (psig) (f) flow (GPM) (g) valve material (specify) (h) connections (specify). Zhang_Ch01.indd 104 5/13/2008 5:45:34 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 105 In terms of operators, pneumatic actuators can be of four types: (1) Piston-style pneumatic actuators. Piston-type, air-operated valves offer a unique, reliable design providing for a long and dependable life. These valves are more compact than diaphragm valves and are appropriate for applications such as high-flow gas and liquid delivery systems to reactors and mixers and vaporizers. The technical data for the piston-style pneumatic actuators include (a) area of piston (sq. in.) (b) maximum allowable working pressure (psi or bar) (c) allowable piston temperature range (oF) (d) approximate air usage and air cycle ( SCF per 100 psi) (e) tested to 100,000 cycles at 100 psi (6.89 bar) with no leakages or signs of wear or fatigue. (2) Diaphragm-style pneumatic actuators. Diaphragm-type, airoperated valves are an efficient and economical means for “remote ON–OFF” of a wide range of process requirements. Diaphragmtype actuators are designed to provide a dependable alternative to piston-type actuators. The technical data for the diaphragmstyle pneumatic actuators include (a) area of diaphragm (sq. in.) (b) maximum allowable working pressure (psi or bar) (c) allowable diaphragm temperature range (oF) (d) approximate air usage and air cycle ( SCF per 100 psi). (3) Solenoid valve packages. Solenoid valves are used to supply ON–OFF control of air to the valve actuator. They are normally mounted on the valve actuator, but they can be mounted remotely as well. Solenoid valves can be supplied in different voltages and configurations if required. Solenoid manifolds are available and used when a large number of valve actuators require control or contain power to a local area reducing assembly time. Remotemounted solenoids also permit the usage of actuated valves in hazardous sensitive locations. These indices are assigned to solenoid valve packages of actuators: (a) Piston and diaphragm operators: light and heavy-light duty (b) piston and diaphragm operators: medium and heavy duty (c) piston and diaphragm operators: extra heavy duty. (4) Servo pneumatic actuator package. The servo pneumatic actuator has an integral displacement transducer and is designed to operate on standard compressed air available in most factories and laboratories. The package is aimed at engineers building specialpurpose systems including (a) Displacement control. The servo pneumatic actuator can be used in systems configured for displacement control using Zhang_Ch01.indd 105 5/13/2008 5:45:38 PM 106 INDUSTRIAL CONTROL TECHNOLOGY feedback from the integral displacement transducer and signal conditioning card supplied. (b) Load control. Load control may be implemented by providing a load cell and signal conditioning. (c) Strain control. Strain control may be implemented by providing a clip gauge and signal conditioning. 1.2.2.3 Application Guide and Assemble on Valve (1) Preparation for installation (a) Actuator checks. When the actuator arrives, the actuator checks that determine whether it is mounted on the valve should be carried out: If the actuator arrives already assembled onto the valve, the setting of the mechanical stops and of the electric limit switches (if existing) has already been made by the person who assembled the actuator onto the valve. If the actuator arrives separately from the valve, the settings of the mechanical stops and of the electric limit switches (if existing) must be checked and, if necessary, carried out while assembling the actuator onto the valve. Furthermore, it is often necessary to check that the actuator has not been damaged during transport. If necessary, repair all damages to the paintcoat, etc. Thereafter, it is often required to check that the model, the serial number of the actuator, and the performance data written on the data plate are in accordance with those described on the order acknowledgment, test certificate, and delivery note. Then, check that the fitted accessories comply with those listed in the order acknowledgment and the delivery note. (b) Store checks. The actuators leave the factory in excellent working condition and with an excellent finish (these conditions are guaranteed by an individual inspection certificate); in order to maintain these characteristics until the actuator is installed, it is necessary to observe a few rules and take appropriate measures during the storage period. It should be ensured that plugs are fitted in the air connections and in the cable entries. The plastic plugs which close the inlets do not have a weatherproof function, but are only a means of protection against the entry of foreign matter during transport. If long-term storage is necessary and especially if the storage is out of doors, the plastic protection plugs must be replaced by metal plugs, which guarantee a complete weatherproof protection. Zhang_Ch01.indd 106 5/13/2008 5:45:38 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 107 If the actuators are supplied separately from the valves, they must be placed onto a wooden pallet so as not to damage the coupling flange to the valve. In case of long-term storage, the coupling parts (flange, drive sleeve, insert bush) must be coated with protective oil or grease. If possible, blank off the flange by a protection disk. In case of long-term storage, it is advisable to keep the actuators in a dry place or to provide some means of weather protection. If possible, it is also advisable to periodically operate the actuator with filtered, dehydrated, and lubricated air; after such operations all the threaded connections of the actuator and the valves of the control panel (if present) should be carefully plugged. (2) Installation and start-up (a) Pneumatic connections. Pneumatic connections connect the actuator to the pneumatic feed line with fittings and pipes in accordance with the plant specifications. They must be sized correctly in order to guarantee the necessary air flow for the operation of the actuator, with pressure drops not exceeding the maximum allowable value. The shape of the connecting piping must not cause excessive stress to the inlets of the actuator. The piping must be suitably fastened so as not to cause excessive stress or loosening of threaded connections, if the system undergoes strong vibrations. Every precaution must be taken to ensure that any solid or liquid contaminants which may be present in the pneumatic pipe work to the actuator are removed to avoid possible damage to the unit or loss of performance. The inside of the pipes used for the connections must be well cleaned before use, which includes washing with suitable substances and blowing through them with air or nitrogen. The ends of the tubes must be well debarred and cleaned. Once the connections are completed, operate the actuator and ensure that it functions correctly, that the operation times meet the plant requirements, and that there are no leaks in the pneumatic connections. (b) Electrical connections. Electric connections connect the electrical feed, control, and signal lines to the actuator, by linking them up with the terminal blocks of the electrical components. In order to do this, the housing covers must be removed without damaging the coupling surfaces, the O-rings, or the gaskets. Then, the plugs should be removed from the cable entries. For electrical connections, we can use components (cable Zhang_Ch01.indd 107 5/13/2008 5:45:38 PM 108 INDUSTRIAL CONTROL TECHNOLOGY glands, cables, hoses, conduits), which meet the requirements and codes applicable to the plant specifications (mechanical protection and/or explosion-proof protection). The cable glands should be screwed tightly into the threaded inlets so as to guarantee weatherproof and explosion-proof protection (when applicable). The connection cables are inserted into the electrical enclosures through the cable glands, and the cable wires are connected to the terminals according to the applicable wiring diagram. If conduits are used, it is advisable to carry out the connection to the electrical enclosures by inserting hoses so as not to cause anomalous stress on the housing cable entries. Replace the plastic plugs of the unused enclosure entries with metal ones to guarantee perfect weatherproof tightness and to comply with the explosion-proof protection codes where applicable. Once the connections are completed, check that the controls and signals work properly. After the installation is complete, it is time for the start-up of the actuator that proceeds as follows: (i) Check that the pressure and quality of the air supply (filtering degree, dehydration) are as prescribed. Check that the feed voltage values of the electrical components (solenoid valve coils, micro switches, pressure switches, etc.) are as prescribed. (ii) Check that the actuator controls work properly (remote control, local control, emergency controls, etc.) (iii) Check that the required remote signals (valve position, air pressure, etc.) are correct. (iv) Check that the setting of the components of the actuator control unit (pressure regulators, pressure switches, flow control valves, etc.) meet the plant requirements. (v) Check that there are no leaks in the pneumatic connections. If necessary, tighten the nuts of the pipe fittings. (vi) Remove all rust and, in accordance with the applicable painting specifications, repair paint coat that has been damaged during transport, storage, or assembly. (3) Mounting the actuator onto the valve. The actuator can be assembled onto the valve flange either by using the actuator housing flanges with threaded holes, or by the interposition of an adaptor flange or a spool piece. The actuator drive sleeve is generally connected to the valve stem by an insert bush or a stem extension. The assembly position of the actuator, with reference to the valve, must comply with the plant requirements (cylinder axis Zhang_Ch01.indd 108 5/13/2008 5:45:38 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 109 parallel or perpendicular to the pipeline axis). To assemble the actuator onto the valve, proceed as follows: (a) Check that the coupling dimensions of the valve flange and stem, or of the relevant extension, meet the actuator coupling dimensions. (b) Bring the valve to the “closed” position. (c) Lubricate the valve stem with oil or grease in order to make the assembly easier. Be careful not to pour any of it onto the flange. (d) Clean the valve flange and remove anything that might prevent a perfect adherence to the actuator flange, especially all traces of grease, since the torque is transmitted by friction. (e) If an insert bush or stem extension for the connection to the valve stem is supplied separately, assemble it onto the valve stem and fasten it by tightening the proper stop dowels. (f) Bring the actuator to the “closed” position. (g) Connect a sling to the support points of the actuator and lift it: make sure the sling is suitable for the actuator weight. When possible, it is easier to assemble the actuator to the valve if the valve stem is in the vertical position. In this case the actuator must be lifted while keeping the flange in the horizontal position. (h) Clean the actuator flange and remove anything that might prevent a perfect adherence to the valve flange, especially all traces of grease. (i) Lower the actuator onto the valve in such a way that the insert bush, assembled on the valve stem, enters the actuator drive sleeve. This coupling must take place without forcing and only with the weight of the actuator. When the insert bush has entered the actuator drive sleeve, check the holes of the valve flange. If they do not meet with the holes of the actuator flange or the stud bolts screwed into them, the actuator drive sleeve must be rotated; feed the actuator cylinder with air at the proper pressure or actuate the manual override, if existing, until coupling is possible. (j) Tighten the nuts of the connecting stud bolts evenly with the torque prescribed in the table. (k) If possible, operate the actuator to check that it moves the valve smoothly. It is important that the mechanical stops of the actuator (and not those of the valve) stop the angular stroke at both extreme valve positions (fully open and fully closed), except when otherwise required by the valve operation Zhang_Ch01.indd 109 5/13/2008 5:45:38 PM 110 INDUSTRIAL CONTROL TECHNOLOGY (e.g., metal-seated butterfly valves). The setting of the open valve position is performed by adjusting the travel stop screw in the left wall of the mechanism housing, or in the end flange of the manual override, if that exists. The setting of the closed valve position is performed by adjusting the travel stop screw in the cylinder end flange. Proceed as follows: (i) Loosen the lock nut. (ii) If the actuator angular stroke is stopped before reaching the end position (fully open or closed), unscrew the stop screw by turning it counterclockwise, until the valve reaches the correct position. When unscrewing the stop screw, keep the lock nut still with a wrench so that the sealing washer does not withdraw together with the screw. (iii) Tighten the lock nut. (iv) If the actuator angular stroke is stopped beyond the end position (fully open or closed), screw the stop screw by turning it clockwise until the valve reaches the correct position. (v) Tighten the lock nut. (4) Maintenance. Before carrying out any maintenance operation, it is necessary to close the pneumatic feed line and exhaust the pressure from the actuator cylinder and from the control unit, to ensure the safety of maintenance staff. (a) Routine maintenance. Most actuators have been designed to work for long periods in the severest conditions with no need for maintenance. It is, however, advisable to periodically check the actuator as follows: (i) Check that the actuator operates the valve correctly and with the required operating times. If the actuator operation is very infrequent, we can carry out a few opening and closing operations with all the existing controls (remote, local, emergency controls, etc.), if this is allowed by the plant conditions. (ii) Check that the signals to the remote control desk are correct. (iii) Check that the air supply pressure value is within the required range. (iv) If there is an air filter on the actuator, bleed the condensed water accumulated in the cup by opening the drain cock. Disassemble the cup periodically and wash it with soap and water; disassemble the filter: if this is made of a sintered cartridge, wash it with nitrate solvent and blow through it with air. If the filter is made of cellulose, it must be replaced when clogged. Zhang_Ch01.indd 110 5/13/2008 5:45:39 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 111 (v) Check that the external components of the actuator are in good condition. (vi) Check all the paint coat of the actuator. If some areas are damaged, repair the paint coat according to the applicable specification. (vii) Check that there are no leaks in the pneumatic connections. If necessary tighten the nuts of the pipe fittings. (b) Special maintenance. If there are air leaks in the pneumatic cylinder or a malfunction in the mechanical components, or in case of scheduled preventative maintenance, the actuator must be disassembled and seals must be replaced with reference to the sectional drawing, adopting the following procedures: (i) disassemble the actuator correctly; (ii) carry out the seal replacement in the actuator; (iii) reassemble the actuator correctly. 1.2.3 Hydraulic Actuators Pneumatic actuators are normally used to control processes requiring quick and accurate response, as they do not require a large amount of motive force. However, when a large amount of force is required to operate a valve such as the main steam system valves, hydraulic actuators are normally used. A hydraulic actuator receives pressure energy and converts it to mechanical force and motion. Fluid power systems are manufactured by many organizations for a very wide range of applications, which often embody differing arrangements of components to fulfill a given task. Hydraulic components are manufactured to provide the control functions required for the operation of systems. 1.2.3.1 Operating Principle (1) Hydraulic cylinders. A cylinder is a hydraulic actuator that is constructed of a piston or plunger that operates in a cylindrical housing by the action of liquid under pressure. Cylinder housing is a tube in which a plunger (piston) operates. In a ram-type cylinder, a ram actuates a load directly. In a piston cylinder, a piston rod is connected to a piston to actuate a load. At the end of a cylinder from which a rod or plunger protrudes is a rod end. Its opposite end is the head end. The hydraulic connections are a head-end port and a rod-end port (fluid supply). (a) Single-acting cylinder. This cylinder has only a head-end port and is operated hydraulically in one direction. When oil Zhang_Ch01.indd 111 5/13/2008 5:45:39 PM 112 INDUSTRIAL CONTROL TECHNOLOGY is pumped into a port, it pushes on a plunger, thus extending it. To return or retract a cylinder, oil must be released to a reservoir. A plunger returns either because of the weight of a load or from some mechanical force such as a spring. In mobile equipment, a reversing directional valve of a singleacting type controls flow to and from a single-acting cylinder. (b) Double-acting cylinder. This cylinder must have ports at the head and rod ends. Pumping oil into the head end moves a piston to extend a rod while any oil in the rod end is pushed out and returned to a reservoir. To retract a rod, flow is reversed. Oil from a pump goes into the rod end, and the head-end port is connected to allow return flow. The flow direction to and from a double-acting cylinder can be controlled by a double-acting directional valve or by actuating control of a reversible pump. (c) Differential cylinder. In a differential cylinder, the areas where pressure is applied on a piston are not equal. On a head end, a full piston area is available for applying pressure. At a rod end, only an annular area is available for applying pressure. The area of a rod is not a factor, and what space it does take up reduces the volume of oil it will hold. Two general rules about a differential cylinder: with an equal GPM delivery to either end, a cylinder will move faster when retracting because of a reduced volume capacity. With equal pressure at either end, a cylinder can exert more force when extending because of the greater piston area. In fact, if equal pressure is applied to both ports at the same time, a cylinder will extend because of a higher resulting force on a head end. (d) Nondifferential cylinder. This cylinder has a piston rod extending from each end. It has equal thrust and speed either way, provided that pressure and flow are unchanged. A nondifferential cylinder is rarely used on mobile equipment. (e) Ram-type cylinder. A ram-type cylinder is a cylinder in which the cross-sectional area of a piston rod is more than one-half the cross-sectional area of the piston head. In many cylinders of this type, the rod and piston heads have equal areas. A ram-type actuating cylinder is used mainly for push rather than pull functions. (f) Piston-type cylinder. In this cylinder, a cross-sectional area of a piston head is referred to as a piston-type cylinder. A piston-type cylinder is used mainly when the push and pull functions are needed. Zhang_Ch01.indd 112 5/13/2008 5:45:39 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 113 A single-acting, piston-type cylinder uses fluid pressure to apply force in one direction. In some designs, the force of gravity moves a piston in the opposite direction. However, most cylinders of this type apply force in both directions. Fluid pressure provides force in one direction and spring tension provides force in the opposite direction. Most piston-type cylinders are double acting, which means that fluid under pressure can be applied to either side of a piston to provide movement and apply force in a corresponding direction. This cylinder contains one piston and pistonrod assembly and operates from fluid flow in either direction. The two fluid ports, one near each end of a cylinder, alternate as inlet and outlet, depending on the directional-control valve flow direction. This is an unbalanced cylinder, which means that there is a difference in the effective working area on the two sides of a piston. A cylinder is normally installed so that the head end of a piston carries the greater load; that is, a cylinder carries the greater load during a piston-rod extension stroke. (g) Cushioned cylinder. To slow an action and prevent shock at the end of a piston stroke, some actuating cylinders are constructed with a cushioning device at either or both ends of a cylinder. This cushion is usually a metering device built into a cylinder to restrict the flow at an outlet port, thereby slowing down the motion of a piston. (h) Lockout cylinders. A lockout cylinder is used to lock a suspension mechanism of a tracked vehicle when a vehicle functions as a stable platform. A cylinder also serves as a shock absorber when a vehicle is moving. Each lockout cylinder is connected to a road arm by a control lever. When each road wheel moves up, a control lever forces the respective cylinder to compress. Hydraulic fluid is forced around a piston head through restrictor ports causing a cylinder to act as a shock absorber. When hydraulic pressure is applied to an inlet port on each cylinder’s connecting eye, an inner control-valve piston is forced against a spring in each cylinder. This action closes the restrictor ports, blocks the main piston’s motion in each cylinder, and locks the suspension system. (2) Hydraulic motors. Hydraulic motors convert hydraulic energy into mechanical energy. In industrial hydraulic circuits, pumps and motors are normally combined with a proper valve and pipe to form a hydraulic-powered transmission. A pump, which is mechanically linked to a prime mover, draws fluid from a reservoir Zhang_Ch01.indd 113 5/13/2008 5:45:39 PM 114 INDUSTRIAL CONTROL TECHNOLOGY and forces it to a motor. A motor, which is mechanically linked to the workload, is actuated by this flow so that motion or torque, or both, are conveyed to the work. (a) Gear-type motors. Both gears are driven gears, but only one is connected to the output shaft. Operation is essentially the reverse of that of a gear pump. Flow from the pump enters chamber A and flows in either direction around the inside surface of the casing, forcing the gears to rotate as indicated. This rotary motion is then available for work at the output shaft. (b) Vane-type motors. Flow from the pump enters the inlet, forces the rotor and vanes to rotate, and passes out through the outlet. Motor rotation causes the output shaft to rotate. Since no centrifugal force exists until the motor begins to rotate, something, usually springs, must be used to initially hold the vanes against the casing contour. However, springs usually are not necessary in vane-type pumps because a drive shaft initially supplies centrifugal force to ensure vane-to-casing contact. Vane motors are balanced hydraulically to prevent a rotor from side-loading a shaft. A shaft is supported by two ball bearings. Torque is developed by a pressure difference as oil from a pump is forced through a motor. On the trailing side open to the inlet port, the vane is subject to full system pressure. The chamber leading the vane is subject to the much lower outlet pressure. The difference in pressure exerts the force on the vane that is, in effect, tangential to the rotor. This pressure difference is effective across vanes. The other vanes are subject to essentially equal force on both sides. Each will develop torque as the rotor turns. The body port is the inlet, and the cover port is the outlet. Reverse the flow and the rotation becomes clockwise; otherwise the rotation is counterclockwise. In a vane-type pump, the vanes are pushed out against a cam ring by centrifugal force when a pump is started up. A design motor uses steel-wire rocker arms to push the vanes against the cam ring. The arms pivot on pins attached to the rotor. The ends of each arm support two vanes that are 90° apart. When the cam ring pushes vane A into its slot, vane B slides out. The reverse also happens. The pressure plate of a motor functions the same as a pump’s. It seals the side of a rotor and ring against internal leakage, and it feeds system pressure under the vanes to hold them out against a ring. This is a simple operation in a pump because a pressure plate is right by a high-pressure port in the cover. (c) Piston-type motors. Although some piston-type motors are controlled by directional-control valves, they are often used in Zhang_Ch01.indd 114 5/13/2008 5:45:39 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 115 combination with variable-displacement pumps. This pump– motor combination (hydraulic transmission) is used to provide a transfer of power between a driving element, such as an electric motor, and a driven element. Piston-type motors can be inline-axis or bent-axis types: (i) Inline-axis piston-type motors. These motors are almost identical to the pumps. They come in built-in, fixed-, and variable-displacement models in several sizes. Torque is developed by a pressure drop through the motor. Pressure exerts a force on the ends of the pistons, which is translated into shaft rotation. Shaft rotation of most models can be reversed anytime by reversing the flow direction. Oil from a pump is forced into the cylinder bores through a motor’s inlet port. Force on the pistons at this point pushes them against a swash plate. They can move only by sliding along a swash plate to a point further away from a cylinder’s barrel, which causes it to rotate. The barrel is then splined to a shaft so that it must turn. The displacement of a motor depends on the angle of the swash plate. At maximum angle, displacement is at its highest because the pistons travel at maximum length. When the angle is reduced, piston travel shortens, reducing displacement. If flow remains constant, a motor runs faster, but torque is decreased. Torque is greatest at maximum displacement because the component of piston force parallel to the swash plate is greatest. (ii) Bent-axis piston-type motors. These motors are almost identical to the pumps. They are available in fixed- and variable-displacement models, in several sizes. Variabledisplacement motors can be controlled mechanically or by pressure compensation. These motors operate similar to inline motors except that the piston thrust is against a drive-shaft flange. A parallel component of thrust causes a flange to turn. Torque is the maximum displacement; speed is at a minimum. This design of piston motor is very heavy and bulky, particularly the variabledisplacement motor. Use of these motors on mobile equipment is limited. 1.2.3.2 Basic Types and Specifications Table 1.4 gives the basic types of hydraulic actuators in three columns which are cylinder, valve, and motor, and the valve controlling source in three rows which are electro, servo, and piezoelectric. The motion type for Zhang_Ch01.indd 115 5/13/2008 5:45:39 PM 116 INDUSTRIAL CONTROL TECHNOLOGY Table 1.4 Basic Types of Hydraulic Actuators Types of Valve Controller Hydraulic Cylinder Actuators Hydraulic Valve Actuators Hydraulic Motor Actuators Electro Servo Piezoelectric Linear Linear Linear Linear Rotary Linear Rotary Linear Rotary Rotary Rotary Rotary each type of hydraulic actuator device is specified in each cell of this table, which indicates that cylinders have linear motion only, valves can have both linear and rotary motions, and motors rotary motion only. An actuator can be linear or rotary. A linear actuator gives force and motion outputs in a straight line. It is more commonly called a cylinder but is also referred to as a ram, reciprocating motor, or linear motor. A rotary actuator produces torque and rotating motion. It is more commonly called a hydraulic motor. (1) Hydraulic cylinders and linear actuators. Hydraulic cylinders are actuation devices that utilize pressurized hydraulic fluid to produce linear motion and force. Hydraulic cylinders are used in a variety of power transfer applications. Hydraulic cylinders can be single action or double action. A single action hydraulic cylinder is pressurized for motion in only one direction. A double action hydraulic cylinder can move along the horizontal (x-axis) plane, the vertical (y-axis) plane, or along any other plane of motion. Operating specifications, configuration or mounting, materials of construction, and features are all important parameters to consider when searching for hydraulic cylinders. Important operating specifications for hydraulic cylinders include the cylinder type, stroke, maximum operating pressure, bore diameter, and rod diameter. Choices for cylinder type include tie-rod, welded, and ram. A tie-rod cylinder is a hydraulic cylinder that uses one or more tie-rods to provide additional stability. Tie-rods are typically installed on the outside diameter of the cylinder housing. In many applications, the cylinder tierod bears the majority of the applied load. A welded cylinder is a smooth hydraulic cylinder that uses a heavy-duty welded cylinder housing to provide stability. A ram cylinder is a type of hydraulic cylinder that acts as a ram. A hydraulic ram is a device in which the cross-sectional area of the piston rod is more than Zhang_Ch01.indd 116 5/13/2008 5:45:39 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 117 one-half the cross-sectional area of the moving component. Hydraulic rams are primarily used to push rather than pull and are most commonly used in high-pressure applications. Stroke is the distance that the piston travels through the cylinder. Hydraulic cylinders can have a variety of stroke lengths, from fractions of an inch to many feet. The maximum operating pressure is the maximum working pressure the cylinder can sustain. The bore diameter refers to the diameter at the cylinder bore. The rod diameter refers to the diameter of the rod or piston used in the cylinder. Choices for cylinder configuration are simple configuration or telescopic configuration. A simple configuration hydraulic cylinder consists of a single cylindrical housing and internal components. A telescopic configuration hydraulic cylinder uses “telescoping” cylindrical housings to extend the length of the cylinder. Telescopic configuration cylinders are used in a variety of applications that require the use of a long cylinder in a space-constrained environment. Choices for mounting method include flange, trunnion, threaded, clevis or eye, and foot. The mount location can be cap, head, or intermediate. Materials of construction include steel, stainless steel, and aluminum. Common features for hydraulic cylinders include integral sensors, double end rod, electrohydraulic cylinders, and adjustable stroke. (2) Hydraulic valves. Hydraulic valve actuators convert a fluid pressure supply into a motion. A valve actuator is a hydraulic actuator mounted on a valve that, in response to a signal, automatically moves the valve to the desired position using an outside power source. The hydraulic actuators in hydraulic valves can be either linear like cylinders or rotary like motors. The hydraulic actuator operates under servo-valve control; this provides regulated hydraulic fluid flow in a closed loop system having upper and lower cushions to protect the actuator from the effects of high speed and high mass loads. Piston movement is monitored via a linear voltage displacement transducer (LVDT), which provides an output voltage proportional to the displacement of the movable core extension to the actuator. The outside power sources used by hydraulic valves are normally in these types: (a) electronics (b) servo (c) piezoelectricity. (3) Hydraulic motors and rotary actuator. Hydraulic motors are powered by pressurized hydraulic fluid and transfer rotational kinetic energy to mechanical devices. Hydraulic motors, when Zhang_Ch01.indd 117 5/13/2008 5:45:39 PM 118 INDUSTRIAL CONTROL TECHNOLOGY powered by a mechanical source, can rotate in reverse direction and act as a pump. Hydraulic rotary actuators use pressurized fluid to rotate mechanical components. The flow of pressurized hydraulic fluid produces the rotation of moving components via a rack and pinion, cams, direct fluid pressure on rotary vanes, or other mechanical linkage. Hydraulic rotary actuators and pneumatic rotary actuators may have fixed or adjustable angular strokes and can include such features as mechanical cushioning, closed-loop hydraulic dampening (oil), and magnetic features for reading by a switch. Motor type is the most important consideration when searching for hydraulic motors. Choices for motor type include axial piston, radial piston, internal gear, external gear, and vane. An axial piston motor uses an axially mounted piston to generate mechanical energy. High-pressure flow into the motor forces the piston to move in the chamber, generating output torque. A radial piston hydraulic motor uses pistons mounted radially about a central axis to generate energy. An alternate-form radial piston motor uses multiple interconnected pistons, usually in a star pattern, to generate energy. Oil supply enters the piston chambers, moving each individual piston and generating torque. Multiple pistons increase the displacement per revolution through the motor, increasing the output torque. An internal gear motor uses internal gears to produce mechanical energy. Pressurized fluid turns the internal gears, producing output torque. An external gear motor uses externally mounted gears to produce mechanical energy. Pressurized fluid forces the external gears to turn, producing output torque. A vane motor uses a vane to generate mechanical energy. Pressurized fluid strikes the blades in the vane, causing it to rotate and produce output torque. Additional operating specifications to consider for hydraulic motors include operating torque, operating pressure, operating speed, operating temperature, power, maximum fluid flow, maximum fluid viscosity, displacement per revolution, and motor weight. The operating torque is the torque that the motor is capable of delivering. Operating torque depends directly on the pressure of the working fluid delivered to the motor. The operating pressure is the pressure of the working fluid delivered to the hydraulic motor. Working fluid is pressurized by an outside source before it is delivered to the motor. Working pressure affects operating torque, speed, flow, and horsepower of the motor. The operating speed is the speed at which the hydraulic motors’ moving parts rotate. Operating speed is expressed in Zhang_Ch01.indd 118 5/13/2008 5:45:39 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 119 revolutions per minute or similar terms. The operating temperature is the fluid temperature range the motor can accommodate. Minimum and maximum operating temperatures are dependent on the internal component materials of the motor and can vary greatly between products. The power the motor is capable of delivering is dependent on the pressure and flow of the fluid through the motor. The maximum volumetric flow through the motor is expressed in terms of gallons per minute or similar units. The maximum fluid viscosity the motor can accommodate is a measure of the fluid’s resistance to shear, and is measured in centipoises (cP), a common metric unit of dynamic viscosity equal to 0.01 poise or 1 mP. The dynamic viscosity of water at 20°C is about 1 cP (the correct unit is cP, but cPs and cPo are sometimes used). The fluid volume displaced per revolution of the motor is measured in cubic centimeters (cc) per revolution, or similar units. The weight of the motor is measured in pounds or similar units. 1.2.3.3 Application Guide (1) Proactive maintenance for hydraulic cylinders. Damaged hydraulic cylinder rods and wiper seals are an eternal problem for users of hydraulic machinery. Dents and gouges on the surface of hydraulic cylinder rods reduce seal life and give dust and other contaminants an easy path into the hydraulic system. These siltsized particles act like lapping compound, initiating a chain of wear in hydraulic components. The top four causes of hydraulic seal failure in cylinders are the following: (a) Improper installation is a major cause of hydraulic seal failure. The important things to watch during seal installation are (1) cleanliness, (2) protecting the seal from nicks and cuts, and (3) proper lubrication. Other problem areas are over tightening of the seal gland where there is an adjustable gland follower or folding over a seal lip during installation. Installing the seal upside down is a common occurrence, too. The solution to these problems is commonsense and taking reasonable care during assembly. (b) Hydraulic system contamination is another major factor in hydraulic seal failure. It is usually caused by external elements such as dirt, grit, mud, dust, ice, and internal contamination from circulating metal chips, breakdown products of fluid, hoses, or other degradable system components. As most external contamination enters the system during rod Zhang_Ch01.indd 119 5/13/2008 5:45:39 PM 120 INDUSTRIAL CONTROL TECHNOLOGY retraction, the proper installation of a rod wiper and scraper is the best solution. Proper filtering of system fluid can prevent internal contamination. Contamination is indicated by scored rod and cylinder bore surfaces, excessive seal wear and leakage, and sometimes, tiny pieces of metal imbedded in the seal. (c) Chemical breakdown of the seal material is most often the result of incorrect material selection in the first place, or a change of hydraulic system fluid. Misapplication or use of noncompatible materials can lead to chemical attack by fluid additives, hydrolysis, and oxidation–reduction of seal elements. Chemical breakdown can result in loss of seal lip interface, softening of seal durometer, excessive swelling, or shrinkage. Discoloration of hydraulic seals can also be an indicator of chemical attack. (d) Heat degradation is to be suspected when the failed seal exhibits a hard, brittle appearance and/or shows a breaking away of parts of the seal lip or body. Heat degradation results in loss of sealing lip effectiveness through excessive compression set and/or loss of seal material. Causes of this condition may be use of incorrect seal material, high dynamic friction, excessive lip loading, no heel clearance, and proximity to outside heat source. Correction of heat degradation problems may involve reducing seal lip interference, increasing lubrication, or a change of the seal material. In borderline situations, consider all upper temperature limits to be increased by 50°F in hydraulic cylinder seals at the seal interface due to running friction caused by the sliding action of the lips. In response to this problem, a protective cylinder rod cover called Seal Saver has been developed and patented. Seal Saver is a continuous piece of durable material, which wraps around the cylinder and is closed with Velcro. It is then clamped onto the cylinder body and rod end. This makes installation simple with no disassembly of hydraulic cylinder components required. Seal Saver forms a protective shroud over the cylinder rod as it strokes and prevents build-up of contaminants around the wiper seal that is a common cause of rod scoring, seal damage, and contaminant ingress. Research has shown that the cost to remove contaminants is 10 times the cost of exclusion. This, combined with the benefits of extended hydraulic cylinder rod and seal life, makes Seal Saver a cost-effective, proactive maintenance solution. Zhang_Ch01.indd 120 5/13/2008 5:45:39 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 121 (2) Hydraulic cylinder rods maintenance. As a product group, hydraulic cylinders are almost as common as pumps and motors combined. They are less complicated than other types of hydraulic components and are therefore relatively easy to repair. As a result, many hydraulic equipment owners or their maintenance personnel repair hydraulic cylinders in-house. An important step in the repair process that is often skipped is the checking of rod straightness. Bent rods load the rod seals causing distortion, and ultimately premature failure of the hydraulic cylinder seals. Rod straightness should always be checked when hydraulic cylinders are being resealed or repaired. This is done by placing the rod on rollers and measuring the run-out with a dial gauge. The rod should be as straight as possible, but a run-out of 0.5 mm per linear meter of rod is generally considered acceptable. In most cases, bent rods can be straightened in a press. It is sometimes possible to straighten hydraulic cylinder rods without damaging the hard-chrome plating; however, if the chrome is damaged, the rod must be either rechromed or replaced. Black nitride is a relatively recent alternative to the hard chrome-plated hydraulic cylinder rod. With reports of achieved service life three times that of conventional chrome, longer seal life, and comparable cost, black nitride rods for hydraulic cylinders are an option that all hydraulic equipment users should be aware of. Black nitride is an atmospheric furnace treatment developed and patented in the early 1980s. It combines the high surface hardness and corrosion resistance of nitride with additional corrosion resistance gained by oxidation. The process begins with the cleaning and superpolishing of the material to a surface roughness of 6–10 Ra. The steel bars or tubes are then fixed vertically and lowered into an electrically heated pit furnace. (3) Other maintenances for hydraulic cylinders. Hydraulic cylinders are compact and relatively simple. The key points to watch are the seals and pivots. The following lists service tips in maintaining cylinders: (a) External leakage. If the end caps of a cylinder are leaking, tighten them. If the leaks still do not stop, replace the gasket. If a cylinder leaks around a piston rod, replace the packing. Make sure that a seal lip faces toward the pressure oil. (b) Internal leakage. Leakage past the piston seals inside a cylinder can cause sluggish movement or settling under load. Piston leakage can be caused by worn piston seals or rings or scored cylinder walls. The latter may be caused by dirt and Zhang_Ch01.indd 121 5/13/2008 5:45:39 PM 122 INDUSTRIAL CONTROL TECHNOLOGY grit in the oil. When repairing a cylinder, replace all the seals and packing before reassembly. (c) Creeping cylinder. If a cylinder creeps when stopped in middle stroke, check for internal leakage. Another cause could be a worn control valve. (d) Sluggish operation. Air in a cylinder is the most common cause of sluggish action. Internal leakage in a cylinder is another cause. If an action is sluggish when starting up a system, but speeds up when the system is warm, check for oil of too high a viscosity (see the machine’s operating manual). If a cylinder is still sluggish after these checks, test the whole circuit for worn components. (e) Loose mounting. Pivot points and mounts may be loose. The bolts or pins may need to be tightened, or they may be worn out. Too much slop or float in a cylinder’s mountings damages the piston-rod seals. Periodically check all the cylinders for loose mountings. (f) Misalignment. Piston rods must work in-line at all times. If they are side-loaded, the piston rods will be galled and the packing will be damaged, causing leaks. Eventually, the piston rods may be bent or the welds broken. (g) Lack of lubrication. If a piston rod has no lubrication, a rod packing could seize, which would result in an erratic stroke, especially on single-acting cylinders. (h) Abrasives on a piston rod. When a piston rod extends, it can pick up dirt and other material. When it retracts, it carries the grit into a cylinder, damaging a rod seal. For this reason, rod wipers are often used at the rod end of a cylinder to clean the rod as it retracts. Rubber boots are also used over the end of a cylinder in some cases. Piston-rod rusting is another problem. When storing cylinders, the piston rods are always retracted to protect them. (i) Burrs on a piston rod. Exposed piston rods can be damaged by impact with hard objects. If a smooth surface of a rod is marred, a rod seal may be damaged. Clean the burrs on a rod immediately, using crocus cloth. Some rods are chromeplated to resist wear. Replace the seals after restoring a rod surface. (j) Air vents. Single-acting cylinders (except ram types) must have an air vent in the dry side of a cylinder. To prevent dirt from getting in, use different filter devices. Most are selfcleaning, but inspect them periodically to ensure that they operate properly. Zhang_Ch01.indd 122 5/13/2008 5:45:39 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 1.2.3.4 123 Calibration Many applications in modern industrial control require numerous hydraulic actuators that direct the flow of hydraulic fluid between the system components when necessary. For example, a typical antilock brake system in cars can include several hydraulic actuators to control the fluid pressure in the individual components such as a master cylinder and a plurality of wheel cylinders. The memory of an actuator control system includes numerous look-up tables which allow the control system to know what electric signals, such as current values, to apply to the actuators in order to yield specific actuation pressures. Typically, these look-up tables are generic tables that are not tailored to the individual actuators in the fluid system. These generic tables are created to account for worst-case part-to-part variances, manufacturing variances, and system variances. Thus, the tolerances of the values contained in the tables are relatively large and result in less than optimal performance of the actuators. Although very expensive actuators can be used to decrease part-to-part variances, the overall system tolerances remain larger. However, less tolerance can be obtained by individually calibrating less expensive actuators to create customized look-up tables for each actuator. The following introduces two calibration examples for hydraulic actuators: (1) Stroke calibration for actuator valve. The first example is stroke calibration for a hydraulic actuator for valves. Figure 1.34 illustrates the working block for this kind of hydraulic actuator that consists of a piston and spring. The spring, which can be preloaded, trends to keep the piston at the initial position. As pressure applied to the piston develops enough force to overcome the spring preload, the piston moves to the opposition until it reaches its maximum stroke. A p s Valve Figure 1.34 The working block of a hydraulic actuator for valve (courtesy of Siemens). Zhang_Ch01.indd 123 5/13/2008 5:45:39 PM 124 INDUSTRIAL CONTROL TECHNOLOGY To determine the stroke positions 0 and 1 in the valve, calibration is required when the valve and actuator are commissioned for the first time. For this purpose, the actuator must be mechanically connected to the valve and supplied with a standard voltage of electric power. The calibration procedure can be repeated as often as necessary. Normally, there is a slot on the printed circuit boards of many actuators. In most cases, to initiate the calibration procedure, the contacts inside this slot must be shortcircuited by, say, a screwdriver. The calibration thus can proceed automatically: (a) actuator runs to the zero stroke position: valve closes, green LED flashes; (b) actuator then runs to the 100 stroke position; (c) measured values are stored; (d) the calibration procedure is finished, and green LED flashes; (e) the actuator now moves to the position defined by control signal of its controller. (2) Resistance calibration for hydraulic pump. Figure 1.35 is the schematic diagram of a hydraulic actuator for pumping oil. S 2 1 C1 Pump C2 3 3 R 4 4 5 Figure 1.35 Schematic diagram of a hydraulic actuator. The pump (1) supplies a steady flow of oil to the supply point of a hydraulic Wheatstone bridge labeled as S. The oil continuously flows through the bridge to the return point labeled as R and is finally returned to the pump station. The four variable flow restrictors in this bridge are contained in a valve unit. In this diagram, 2 indicates a pneumatic valve; 4 gives two bellows; 5 is the actuator plate. Zhang_Ch01.indd 124 5/13/2008 5:45:40 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 125 The goal of the calibration is for all four nozzles to have a nominal flow resistance measured by pascals per second per cubic meter. The test should be done at the nominal pressure and flow rate and with the fluid running from the supply to the return (Fig. 1.35). Before starting calibration, ensure that (1) the resistance of each nozzle is equal; (2) the pressure at the two control ports is the same when the electric drive is 0 A; (3) at 0 A drive, the pressure of the control port is half the pressure drop between the supply and the return; (4) the flow through the two sides of the bridge is the same; (5) the valves must be all the same; (6) for each side of the valve, calibration proceeds independently. 1.2.4 Piezoelectric Actuators Piezoelectric actuators represent an important new group of actuators for active control of mechanical systems. Although the magnitudes of piezoelectric voltages, movements, or forces are small, and often require amplification (e.g., a typical disc of piezoelectric ceramic will increase or decrease in thickness by only a small fraction of a millimeter), piezoelectric materials have been adapted to an impressive range of applications requiring small amounts of displacement (typically less than a few thousandths of an inch of displacement). Today, modern polycrystalline piezoelectric ceramic is mass produced for applications including underwater transducers, point level sensors, medical products, ultrasonic cleaners, actuators, fish finders, and motors. The piezoelectric effect of the piezoelectric ceramic is used in sensing applications, such as accelerometers, sensors, flow meters, level detectors, and hydrophones as well as in force or displacement sensors. Its inverse piezoelectric effect is used in actuation applications, such as in motors and devices that precisely control positioning, and in generating sonic and ultrasonic signals. Piezoelectric actuators can be used for the conversion of electrical energy to mechanical movement, for accurate positioning down to nanometer levels, for producing ultrasonic energy and sonar signals, and for the conversion of pressure and vibration into electrical energy. Piezoelectric actuators can also be manufactured in a variety of configurations and fabrication techniques. The industry recognizes these devices as monomorphs, bimorphs, stacks, cofired actuators, and flexure elements. Piezoelectric actuators are found in telephones, stereo music systems, and musical instruments such as guitars and drums. The use of piezoelectric actuators is beginning to appear in endoscope lenses used in medical treatment. Piezoelectric actuators are also being used for valves in drilling equipment Zhang_Ch01.indd 125 5/13/2008 5:45:40 PM 126 INDUSTRIAL CONTROL TECHNOLOGY at offshore oil fields. Piezoelectric actuators are also used to control hydraulic valves, act as small-volume pumps or special-purpose motors, and in other applications. The use of piezoelectric actuators is thus steadily growing in advanced fields where conventional actuators are no longer effective. At present, however, this is no more than just a beginning. Piezoelectric actuators that combine a number of superior characteristics will continue to evolve into powerful devices that support our society in the future. 1.2.4.1 Operating Principle (1) Piezoelectricity. In 1880, Jacques and Pierre Curie discovered an unusual characteristic of certain crystalline minerals: when subjected to a mechanical force, the crystals became electrically polarized. Tension and compression generated voltages of opposite polarity, and in proportion to the applied force. Subsequently, the converse of this relationship was confirmed: if one of these voltage-generating crystals was exposed to an electric field it lengthened or shortened according to the polarity of the field, and in proportion to the strength of the field. These behaviors were called the piezoelectric effect and the inverse piezoelectric effect, respectively. The findings by Jacques and Pierre Curie have been more and more confirmed since then. Many polymers, ceramics, and molecules such as water are permanently polarized; some parts of the molecule are positively charged, whereas other parts of the molecule are negatively charged. This behavior of piezoelectric materials is depicted in Fig. 1.36(a). When the material changes dimensions as a result of an imposed mechanical force, a permanently polarized material such as quartz (SiO2) or barium titanate (BaTiO3) will produce an electric field. This behavior of piezoelectric materials when subject to an imposed force is depicted in Fig. 1.36(b). Furthermore, when an electric field is applied to these materials, the polarized molecules within them will align themselves with the electric field, resulting in induced dipoles within the molecular or crystal structure of the material as illustrated in Fig. 1.36(c). Piezoelectricity involves the interaction between the electrical and mechanical behaviors of the material. Static linear relations between two electrical and mechanical variables have approximated this interaction: S = SET + dE, D = dT + eTE, Zhang_Ch01.indd 126 5/13/2008 5:45:40 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL Domain Dipole 127 Stress – Voltage + Electric field Strains Electric strains Stress (a) (b) (c) Figure 1.36 Behaviors of piezoelectric materials: (a) nonpolarized state when no force and no electricity are applied, (b) polarized state when compression stresses are imposed, and (c) polarized state when electric field is applied after poling. where S is the strain tensor, T is the stress tensor, E is an electric field vector, D is the electric displacement vector, SE is the elastic compliance matrix when subjected to a constant electric field (the superscript E denotes that the electric field is constant), d is the matrix of piezoelectric constants, and eT is the permittivity measured at constant stress. The piezoelectric effect is, however, very nonlinear in nature. Piezoelectric materials exhibit, for example, a strong hysteresis and drift that is not included in the above model. It should be noted, too, that the dynamics of the material are not described by the two equations above. (2) Piezoelectric actuator. The three basic types of piezoelectric actuators are stacks, linear motors, and benders. (a) Piezoelectric stack actuators. The linear motion produced by the piezoelectric effect has been used for making a stack actuator, which is a multilayer construction: each stack is composed of several piezoelectric layers, as depicted in Fig. 1.37. The required dimensions of the stack can be easily determined from the requirements of the application in question. The height is determined with respect to the desired movement and the cross-sectional area with respect to the desired force. The main problem of stack actuators is the relatively small strain (0, 1–0, 2%) obtained. Using, for example, levers or hydraulic amplifiers can increase the movement. It is noticeable that, in addition to the desired longitudinal movement, Zhang_Ch01.indd 127 5/13/2008 5:45:40 PM 128 INDUSTRIAL CONTROL TECHNOLOGY – + Figure 1.37 Structure of a piezoelectric stack. some lateral movement typically also occurs, which causes the bias of the piezoelectric stack to be away from its straight line. Therefore, a guide has to be used if only longitudinal motion is desired. Figure 1.38 illustrates deviations from straight line accuracy. (b) Linear motors. Since the strain of piezoelectric ceramics is relatively small, displacement amplifiers or hybrid structures are needed. There are many amplification techniques such as levers and hydraulic systems, and piezoelectric motors. In the lever system, amplification is achieved with lever arms that magnify the displacement. The output force of the lever system is significantly smaller than the actuator force. Hydraulic systems generally use a piston for amplification. The principle of the piezohydraulic actuator is illustrated in Fig. 1.39, which develops a hydraulic amplifier based on the use of bellows. This kind of piezohydraulic motor uses a linear piezoelectric actuator to control the liquid input to the fluid chamber which drives the bellows. Piezoelectric motors increase displacement by providing many small steps. There are many different types of linear piezoelectric motors: the main categories are linear stepper motors and ultrasonic motors. The linear steppers include an inchworm motor, a stick and slip actuator, and an impact V Straightness H Flatness Figure 1.38 Straight line accuracy of piezoelectric stack. Zhang_Ch01.indd 128 5/13/2008 5:45:41 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 129 Fluid chamber Piezoelectric actuator Bellows Figure 1.39 Schematic of piezohydraulic actuator. drive motor. The ultrasonic motors can be divided into standing wave and traveling wave ultrasonic motors. The operating principles of the inchworm motor, the stick and slip actuator, and the traveling wave ultrasonic motor are described below. (i) Inchworm motors. Inchworm motors are a kind of linear motor in which the linear movement is achieved by using three piezoelectric elements. The operation principle is illustrated in Fig. 1.40. The outer piezoelectric elements work as clamps. The contractions and expansions of the middle element generate the movement of the motor rod. (ii) Stick and slip actuators. The stick and slip actuator is a type of an inertia device that uses inertia of the moving mass. The actuator consists of particular legs and a slider. Each step consists of a slow deformation of the legs and fast jump backward. In slow deformation of the legs, the moving mass follows the legs due to friction (the frictional force is higher than the force caused by the slider inertia). In the sudden jump backward, the slider cannot follow the legs due to its inertia. Figure 1.41 shows the operating principle of stick and slip actuator. (iii) Traveling wave ultrasonic motors. A voltage having two phases drives the traveling wave ultrasonic motor. The voltage is applied to the piezoelectric element at the resonance frequency. The resonance frequency produces a traveling wave. The particles on the surface move along the elliptical trajectories. The motion of the Zhang_Ch01.indd 129 5/13/2008 5:45:41 PM 130 INDUSTRIAL CONTROL TECHNOLOGY 2 1 3 OFF Clamp element 1 Extend element 2 Camp element 3 Uncamp element 1 Contract element 2 Camp element 1 Uncamp element 3 Figure 1.40 Operation processes of inchworm motor. Zhang_Ch01.indd 130 5/13/2008 5:45:42 PM 131 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL Slider Voltage 2 Leg Stick::1 Time 1 Slip::2 Figure 1.41 Operation principle of the stick and slip actuator. particles is on the opposite direction of the wave. When a moving body (rotor) is placed in contact with the surface, it moves in the same direction as the particles due to the frictional force produced between the moving body and the elastic body. The ultrasonic piezoelectric motor’s faster response times, higher precision, hard brake with no backlash, high power-to-weight ratio, and smaller packaging envelope more than compensate for the lack of brute horsepower and speed associated with its electromagnetic motor counterparts. (c) Piezoelectric benders. Piezoelectric bending actuators (or piezoelectric cantilevers or piezoelectric bimorphs) bear a close resemblance to bimetallic benders. The application of an electric field across the two layers of the bender results in the expansion of one layer while the other contracts. The net result is a curvature much greater than the length or thickness deformation of the individual layers. With a piezoelectric bender, relatively high displacements can be achieved, but at the cost of force and speed. There are some benders that have only one piezoelectric layer on top of a metal layer, but generally there are two piezoelectric layers and no metal. Two piezoelectric layers make the displacement double in comparison to a single layer version. If the number of piezoelectric layers exceeds two, the bender is referred to as a multilayer. With thinner piezoelectric layers, a smaller voltage is required to produce the same electric field strength, and the benefit of the multilayer benders is, therefore, lower operating voltage. Multilayer benders can be built into one of these two types: a serial or parallel bender. In a serial Zhang_Ch01.indd 131 5/13/2008 5:45:42 PM 132 INDUSTRIAL CONTROL TECHNOLOGY bender, there are two piezoelectric layers with an antiparallel polarization connected to each other, and two surface electrodes. In this arrangement, one of the electrodes is connected to the ground and the other to the output of a bipolar amplifier. Figure 1.42 gives the schematic of a parallel bender in operation. Parallel benders can be distinguished from serial benders by their three electrodes. In between the two parallel-polarized piezoelectric layers is a middle electrode to which the actual control signal is supplied. The two surface electrodes are connected to the ground and to a fixed voltage. The control voltage is applied to the middle electrode, and it varies between zero and a fixed voltage (Fig. 1.42). The parallel bender can also be connected in such a way that the two surface electrodes are connected to the ground and a bipolar signal is applied to the middle electrode. 1.2.4.2 Basic Types Piezoelectric devices make use of direct and inverse piezoelectric effects to perform a function. Both these piezoelectric effects are found in the crystal structures of some materials. For example, ceramics acquire a charge when being compressed, twisted or distorted and produced physical displacements when electric voltages are imposed. Several types of devices are available. Some of the most important are listed here: (1) Piezoelectric actuators. Piezoelectric actuators are devices that produce a small displacement with a high force capability when voltage is applied. There are many applications where a piezoelectric actuator may be used, such as ultra-precise positioning and in the generation and handling of high forces or pressures in static or dynamic situations. +Ur Displacement Electrodes Pr PZT layers 0 Figure 1.42 Schematic of a parallel bender in operation. Zhang_Ch01.indd 132 5/13/2008 5:45:42 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 133 Actuator configuration can vary greatly depending on application. Piezoelectric stack or multilayer actuators are manufactured by stacking up piezoelectric disks or plates, the axis of the stack being the axis of linear motion when a voltage is applied. Tube actuators are monolithic devices that contract laterally and longitudinally when a voltage is applied between the inner and outer electrodes. A disk actuator is a device in the shape of a planar disk. Ring actuators are disk actuators with a center bore, making the actuator axis accessible for optical, mechanical, or electrical purposes. Other less common configurations include block, disk, bender, and bimorph styles. These devices can also be ultrasonic. Ultrasonic actuators are specifically designed to produce strokes of several micrometers at ultrasonic (>20 kHz) frequencies. They are especially useful for controlling vibration, positioning applications, and quick switching. In addition, piezoelectric actuators can be either direct or amplified. The effect of amplification is not only larger displacement, but it can also result in slower response times. The critical specifications for piezoelectric actuators are displacement, force, and operating voltage of the actuator. Other factors to consider are stiffness, resonant frequency, and capacitance. Stiffness is a term used to describe the force needed to achieve a certain deformation of a structure. For piezoelectric actuators, it is the force needed to elongate the device by a certain amount. It is normally specified in terms of newtons per micrometer. Resonance is the frequency at which the actuators respond with maximum output amplitude. The capacitance is a function of the excitation voltage frequency. (2) Piezoelectric motors. Piezoelectric motors use a piezoelectric ceramic element to produce ultrasonic vibrations of an appropriate type in a stator structure. The elliptical movements of the stator are converted into the movement of a slider pressed into frictional contact with the stator. The consequent movement may either be rotational or linear depending on the design of the structure. Linear piezoelectric motors typically offer one degree of freedom, such as in linear stages. However, these devices can be combined to provide more complex positioning factors. Rotating piezoelectric motors are commonly used in submicrometric positioning devices. Large mechanical torque can be achieved by combining several of these rotational units. Piezoelectric motors have a number of potential advantages over conventional electromagnetic motors. They are generally small and compact when compared with their power output, and provide greater force and torque than their dimensions would Zhang_Ch01.indd 133 5/13/2008 5:45:43 PM 134 INDUSTRIAL CONTROL TECHNOLOGY seem to indicate. In addition to a very positive size to power ratio, piezoelectric motors have high holding torque maintained at zero input power, and they offer low inertia from their rotors, providing rapid start and stop characteristics. Additionally, they are unaffected by electromagnetic fields, which can hamper other motor types. Piezoelectric motors usually do not produce magnetic fields and they are not affected by external magnetic fields either. Because they operate at ultrasonic frequencies, these motors do not produce sound during operation. However, piezoelectric motors do have some disadvantages. These disadvantages include the need for high voltage, highfrequency power sources, and the possibility of wear at the rotor/ stator interface, which tends to shorten their service life. Piezoelectric motors have been in industrial use for years, but have not been popular due to what was perceived as an exorbitant cost of production and use. However, recent advances have significantly reduced the channel cost of this technology for closedloop systems that require high positioning accuracy. With the use of a wide range of controllers and/or position sensors, the list of piezoelectric motor product applications is constantly growing. Some of the common applications for piezoelectric motors include camera focus systems, computer disk drives, material handling, robotics, and semiconductor testing and production systems. (3) Multilayer piezoelectric benders. High efficiency, low-voltage multilayer benders have been developed to meet the growing demand for precise, controllable, and repeatable deflection devices in the millimeter and micrometer range. Multilayer piezoelectric ceramic benders are devices capable of rapid (<10 ms) millimeter movements with micrometer precision. They utilize the inverse piezoelectric effect, in which an electric field creates a cantilever bending effect. By making the ceramic layers very thin, between 20 and 40 µm, deflections can be generated with low power consumption at operating voltages from –10 to +60 V. With an electrical field of <3 kV/mm large deflections per unit volume can be achieved with high reliability. Note: A single bender cannot combine maximum deflection and maximum blocking force! Typical applications: proportional valves, low-energy consuming switches, or pumps. (4) Piezoelectric drivers and piezoelectric amplifiers. Piezoelectric drivers and piezoelectric amplifiers are developed to match the requirements for driving and controlling piezoelectric actuators and stages in some applications. Standard linear amplifier products are simple voltage followers that amplify a low-voltage Zhang_Ch01.indd 134 5/13/2008 5:45:43 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 135 input signal, and others are recommended for use as integrated or stand-alone systems in applications that require advanced capabilities for closed-loop servo control requirements. A voltage amplifier is typically needed to control piezoelectric actuators due to the high operating voltage needed for the former. In other words, before the computer, through a DA converter, provides the control signal, it must be amplified. This section describes the most important piezoelectric amplifier characteristics such as voltage range, peak and average currents, a slew rate, power efficiency, and noise. For bench top products, menu-driven user interfaces through front panel LCD and input dial enable amplifier setup, monitoring, and configuration. A built-in sinusoidal function generator capability is available for these models. Standard amplifier bandwidth is <1.2 kHz (–3 dB). Their features include RS-232 serial communication, digital I/O, analog or digital feedback for closed-loop input signals, a 24-bit analog input, and userconfigurable PID gain parameter settings. The serial communication capability allows the user to configure and monitor system parameters, to command the desired target position, and to query actual position. The output voltage range is perhaps the most important property of the amplifier because it either limits the range of displacement when being too small or decreases the displacement resolution when being too large. In addition to the supply voltage range, an important property is the current-driving capability of the amplifier. This together with the capacitance of the piezoelectric actuator determines the maximum operating frequency. For most amplifiers, both the peak and the average current limits are given. With capacitive loads, such as piezoelectric actuators, the peak current is more important but average current cannot be forgotten. The required peak and average currents ratio show a fixed ratio of approximately 3:1 for a sine oscillation, for example. One aspect to consider is the power efficiency of the supplied power. This is important especially in portable devices, in devices that have wireless power supply, and in devices operating on high frequencies. Piezoelectric actuators have theoretically an unlimited resolution. Therefore, every infinitely small voltage step caused by the noise of the amplifier, for example, is transformed into an infinitely small mechanical shift. Therefore, an important property of the amplifier when designing a precision positioning system is the noise characteristics of the amplifier. Zhang_Ch01.indd 135 5/13/2008 5:45:43 PM 136 INDUSTRIAL CONTROL TECHNOLOGY 1.2.4.3 Technical Specifications (1) Piezoelectric actuator configuration. Your choices are (a) Stack. Piezoelectric stack actuators are manufactured by stacking up piezoelectric disks or plates. These disks are electrically connected. The stack axis is the axis of the linear motion. When a voltage is applied, the thickness of the layers increases and thereby the total stack lengthens. (b) Tube. Piezoelectric tube actuators are monolithic devices that contract laterally and longitudinally when a voltage is applied between the inner and outer electrodes. With quadrature electrodes the tubes can be operated as XY scanners. (c) Disk. A disk actuator is a device in the shape of a planar disk. (d) Ring. Ring actuators are disk actuators with a center bore. This makes the actuator axis accessible for optical, mechanical, or electrical purposes. (e) Other. Other unlisted configurations are specialized or proprietary configurations, such as block, disk, bender, bimorph, etc. (2) Performance specifications (a) Maximum displacement. The maximum elongation (normally specified in meters) that the actuator will produce when the maximum operating voltage is applied. (b) Blocked force. The maximum force (normally specified in newtons, N) that the actuator will produce when the maximum operating voltage is applied. (c) Maximum operating voltage. The maximum voltage that can be applied to the actuator without impairing its functionality. (d) Stiffness. Stiffness is a term used to describe the force needed to achieve a certain deformation or deflection of a structure. For piezoelectric actuators, it is the force needed to elongate the device by a certain amount. It is normally specified in terms of newtons per meter, or N/m. (e) Resonance frequency. Resonance is the frequency at which the actuator responds with maximum output amplitude. (f) Capacitance. The capacitance is that which the actuator exhibits. The capacitance is a function of the excitation voltage frequency. (3) Ultrasonic operation. Ultrasonic actuators are specifically designed to produce strokes of several micrometers at ultrasonic (>20 kHz) frequencies. (4) Electrical connectors. Your choices are (a) DB-9. Similar in appearance to a CAPITOL D, D-subminiature connectors are generally referred to by the number of pins or sockets they have, for example, DB-9, DB-25, etc. The design Zhang_Ch01.indd 136 5/13/2008 5:45:43 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 137 of these connectors varies little among manufacturers, except for the color of the shell. (b) BNC. The BNC is essentially a miniature version of the C connector that is a bayonet version of the N connector. BNC connectors are available in both 50 and 75 Ω versions; both versions will mate together. The 50 Ω designs operate up to a frequency of 4 GHz. BNC connectors are used in many applications, some of which are flexible networks, instrumentation, and computer peripheral interconnections. (c) Two wires AWG26. Two 15.9-mils diameter (AWG26) wires. (d) Two wires AWG30. Two 10.0-mils diameter (AWG30) wires. (e) LEMO connector. LEMO is a precision push–pull locking connector for demanding applications. LEMO is a registered trademark of LEMO. (f) Other. Other includes those unlisted, specialized, or proprietary connector types. 1.2.4.4 Calibration Under normal environments, piezoelectricity is often stable in physics. Those devices working with piezoelectricity, including actuators, sensors, and motors, are therefore stable, and their calibrated performance characteristics do not change over time under normal environmental conditions. However, often these devices are exposed to harsh environmental conditions, like mechanical shock, temperature changes, humidity, etc., which basically generate three groups of errors in piezoelectric devices: (1) Sensitivity. Errors that include calibration errors, linearity errors, frequency and phase response errors, aging errors, temperature coefficients. (2) Coupling. Errors that include influence of transducer weight, quality of the coupling surfaces, transverse sensitivity. (3) Noise and environmental influences that include noise, base strain, magnetic fields, temperature transients, sound pressure, cable motion, electromagnetic interference in cables. In order to correct these errors it is necessary to establish a recalibration cycle. For applications where high accuracy is required, we recommend recalibrating the piezoelectric devices every time after use under severe conditions or at least every 2 years. Nevertheless, in some less critical applications, for example, in machine monitoring, recalibration may be unnecessary. Zhang_Ch01.indd 137 5/13/2008 5:45:43 PM 138 INDUSTRIAL CONTROL TECHNOLOGY To recalibrate these piezoelectric devices, many companies choose to purchase their own calibration equipment to perform recalibration themselves. This may save calibration cost, particularly if a large number of piezoelectric devices is used. When no calibrator is at hand, a measuring chain can be calibrated by one of the following techniques: (1) adjusting the amplifier gain to the required sensitivity of the piezoelectric devices; (2) typing in the stated sensitivity when using a computer-based data acquisition system; (3) replacing the piezoelectric device by a generator signal and measuring the equivalent magnitude. However, due to the limitations of calibration, the uncertainty of calibration may not be better than ±2% by means of these three techniques. These errors also cause systematic errors in industrial control. For the evaluation of systematic errors it is very important to assess their contribution from all relevant error sources. This is of particular importance for unknown and undetectable systematic errors. Most errors, however, will occur accidentally in an unpredictable manner. They cannot be compensated for by a simple mathematical model since their amount and their process of formation are unknown. For practical measurements, systematic errors and accidental errors are combined in one quantity called measuring uncertainty. The following example illustrates the contribution of several error components and their typical amounts: (1) Accelerometer: (a) calibration error 2% (b) frequency error (band limits at 5% deviation) 5% (c) linearity error 2% (d) external influences 5%. (2) Instrument with mathematical model calculation: (a) basic error 1% (b) frequency error (band limits at 5% deviation) 5% (c) linearity error 1% (d) waveform error 1%. Piezoelectric actuators have exceptional linearity when properly mounted, with typical 0.5% value of full scale output (FSO). New users may sometimes become confused about how to mount and calibrate the piezoelectric actuators. Piezoelectric actuators may be used at multiple incremental ranges Zhang_Ch01.indd 138 5/13/2008 5:45:43 PM 139 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL up to their maximum measuring range. Therefore, selecting the proper actuator really depends on the size and mechanical constraints of the apparatus under test. In general, there are two types of piezoelectric actuator: (1) internally preloaded actuators (2) ring-style actuators that require external preloading. Internally preloaded actuators do not require any preloading, whereas ring-style actuators require preloading during installation. Ring-style actuators must be preloaded to approximately 20% or more of their measuring range in order to obtain the best possible linearity. This linearity is achieved by tightly clamping the internal components (piezoelectric material and housing) together (see Fig. 1.43). The preload also acts to limit slippage of the actuator caused by side loads experienced during use. Tension measurements are also possible if the actuator has been mounted with proper preload. This allows the ability to measure tensile and compressive loads with one actuator. This is how actuators are constructed. Preloading is also required for shear force measurements using threeaxis actuators. The preload generates the required friction between the actuator and mating surfaces in order to transmit the shear forces. The required preload force is calculated as: Force of preload = Force of shear/the coefficient of friction. A typical value for the coefficient of friction is 0.13. Thus, the required preload is at least 7.7 times the desired shear force. Some manufacturers of Sensor output Linear portion of output Applied load 20% of FSO FSO Figure 1.43 Internally preloaded actuators (sensor) do not require any preloading (courtesy of PCB PIEZOTRONICS, Inc.). Zhang_Ch01.indd 139 5/13/2008 5:45:43 PM 140 INDUSTRIAL CONTROL TECHNOLOGY piezoelectric actuators recommend 10 times the desired shear force. Force rings that require preload are calibrated and shipped with a standard mounting stud. This stud is specially designed to stretch, yet still maintain a very high tensile strength beyond the force ring measurement range. The stretching action of the stud has been designed to allow the force ring to maintain the best possible sensitivity. The stiffer the stud, the more force it takes away from the actuator, thus effectively reducing the force ring output. The standard stud is normally made of beryllium copper and shunts approximately 5% of the force. Steel bolts can take away approximately 20–50% of the applied force. Different bolt materials may be used, but the actuator requires recalibration with the new bolt. A properly mounted and preloaded force ring is depicted in Fig. 1.44. Proper alignment and orientation of the actuator is also critical to long-term performance and calibration values. The general guidelines are to mount the actuator between flat, parallel, and rigid supports that are at least twice the thickness of the piezoelectric actuator. This aligns the actuator and contact surfaces to prevent edge loading or bending moments, resulting in better dynamic measurements. Loading the entire force-sensing surface is also important for good measurements. This can be difficult if the surface being brought into contact with the actuator is not parallel to the actuator surface. F Preload stud Antifriction washer Force ring sensor Pilot bushing (for centering) Figure 1.44 A properly mounted force ring (courtesy of PCB PIEZOTRONICS, Inc.). Zhang_Ch01.indd 140 5/13/2008 5:45:43 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 141 The unique quasistatic nature of piezoelectric actuators allows static calibrations to be performed. As long as the calibration engineer applies the following three rules, the results will closely match the factory calibration: (1) The actuator must have a discharge time constant of at least 50 s, or be a charge mode actuator. (2) The signal conditioning must be DC coupled. (3) For force rings, the factory-supplied beryllium copper preload stud must be used. The calibration engineer simply needs to place a known weight on the actuator and wait for the signal to decay to zero (or reset the charge amplifier). The next step is to remove the weight from the actuator and record the voltage output. This produces a negative voltage output. This value, divided by the applied weight, equals the actuator sensitivity in volts per pound. 1.2.5 Manual Actuators A manual actuator employs levers, gears, or wheels to facilitate movement. There are some manual gear actuators that are recommended for use on ball and butterfly valves. For the sake of convenience, and where lever handles present space problems, gear actuators are the ideal choice. Fully enclosed weatherproof, all cast iron and carbon steel construction manual gear actuators are factory lubricated for their lifetime, requiring no future lubrication. Each unit is supplied with a pointer to indicate valve position. A manual actuator, by definition, is an actuator that requires no outside power source. Handwheels, chainwheels, and levers are examples of manual actuators. A handwheel or lever is utilized to drive a series of gears (typically worm gears) whose ratio results in a higher output torque compared to input (manual) torque. The manually operated actuators are of screw mechanism, and are of large diameter wheels or long levers for use in high-pressure applications equipped with a reduction gear to ease the operation. Manual actuators can also be fitted with a chain wheel and extended stem that are used for tank outlet valves or process valves where lack of space demands extended handles. An automatic actuator has an external power source to provide the force and motion to operate a valve remotely or automatically. Power actuators are a necessity on valves in pipelines located in remote areas: they are also used on valves that are frequently operated or throttled. Valves that are particularly large may be impossible or impractical to operate manually Zhang_Ch01.indd 141 5/13/2008 5:45:44 PM 142 INDUSTRIAL CONTROL TECHNOLOGY simply by the sheer horsepower requirements. Some valves may be located in extremely hostile or toxic environments, which preclude manual operation. Additionally, as a safety feature, certain types of power actuators may be required to operate quickly, shutting down a valve in case of emergency. 1.3 Valves The valve is one of the most basic and indispensable component of our modern industries. It is essential to industrial control technology that is included in virtually all manufacturing processes and every energy production and supply system. The valve is one of the oldest products known to man, with a history of thousands of years. The modern history of the valve industry parallels the Industrial Revolution, which began in 1705 when Thomas Newcomen invented the first industrial steam engine. Because steam built up pressures that had to be contained and regulated, valves acquired a new importance. As Newcomen’s steam engine was improved upon by James Watt and other inventors, designers and manufacturers also improved the valves for these steam engines. Their interest, however, was in the whole project, and the manufacture of valves as a separate product was not undertaken on a large scale for a number of years. A valve is a device that controls not only the flow of a fluid, but also the rate, the volume, the pressure or the direction of liquids, gases, slurries, or dry materials through a pipeline, chute, or similar passageway. With valves, the flow of a fluid in various passageways can be turned ON and OFF, regulated, modulated, or isolated for the range in size from a fraction of an inch to as large as 30 ft in diameter, which can vary in complexity from a simple brass valve available at the local hardware store to a precisiondesigned, highly sophisticated coolant system control valve, made of an exotic metal alloy in a nuclear reactor. Valves can control flow of all types of fluid, from the thinnest gas to highly corrosive chemicals, superheated steam, abrasive slurries, toxic gases, and radioactive materials. They can handle temperatures from cryogenic region to molten metal and pressures from high vacuum to thousands of pounds per square inch. 1.3.1 Control Valves Final control element stands for the device that implements the control strategy determined by the output of the controller. While the final control element can be a damper or a variable speed drive pump or an ON–OFF Zhang_Ch01.indd 142 5/13/2008 5:45:44 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 143 switching device, the most common final control element in the process control industries is the control valve. The control valve is this kind of final element that manipulates a flowing fluid, such as gas, steam, water, or chemical compounds, to compensate for the load disturbance and keep the regulated process variable as close as possible to the desired set point. Control valves or valves really refer to a control valve assembly. The control valve assembly typically consists of the valve body, the internal trim parts, an actuator to provide the motive power to operate the valve, and a variety of additional valve accessories that can include positioners, transducers, supply pressure regulators, manual operators, snubbers, or limit switches. The control valve regulates the rate of fluid flow as the position of the valve plug or disk is changed by force from the actuator. To do this, the valve must contain the fluid without external leakage; have adequate capacity for the intended service; be capable of withstanding the erosive, corrosive, and temperature influences of the process; and incorporate appropriate end connections to mate with adjacent pipelines and actuator attachment means to permit transmission of actuator thrust to the valve plug stem or rotary shaft. 1.3.1.1 Basic Types Many styles of control valve bodies have been developed through the years. Some have found wide application; others meet specific service conditions and are used less frequently. The following summary describes some popular control valve body styles in use today, some special application valves, stem conditioning valves, and the ancillary devices to the control valve including valve actuators, positioners, and accessories. (1) Linear globe valves. Linear globe valves are those valves with a linear motion closure member, one or more ports, and a body distinguished by a globular-shaped cavity around the port region. Globe valves can be further classified as single-ported valve bodies, balance-plug cage-guided bodies, high capacity cage-guided valve bodies, port-guided single-port valve bodies, double-ported valve bodies, and three-way valve bodies. (2) Rotary shaft valves. Rotary shaft valves are those valves of the style in which the flow closure member (full ball, partial ball, disk, or plug) is rotated in the flow stream to control the capacity of the valve. Rotary shaft valves can be further classified as butterfly valve bodies, V-notch ball control valve bodies, eccentric-disk control valve bodies, and eccentric-plug control valve bodies. Zhang_Ch01.indd 143 5/13/2008 5:45:44 PM 144 INDUSTRIAL CONTROL TECHNOLOGY (3) Special valves. Standard control valves can handle a wide range of control applications. Certainly, corrosiveness and viscosity of the fluid, leakage rates, and many other factors demand consideration even for standard applications. The following discusses some special control valve modifications useful in severe controlling applications. (a) High capacity control valves. The following covers the special valve category of globe style valves larger than 12-in., ball valves over 24-in., and high-performance butterfly valves larger than 48-in. As valve sizes increase arithmetically, static pressure loads at shutoff increase geometrically. Consequently, shaft strength, bearing loads, unbalance forces, and available actuator thrust all become more significant with increasing valve size. Normally, maximum allowable pressure drop is reduced on large valves to keep design and actuator requirements within reasonable limits. Even with lowered working pressure ratings, the flow capacity of some large-flow valves remains tremendous. (b) Low flow control valves. Many applications exist in laboratories and pilot plants in addition to the general processing industries where control of extremely low flow rates is required. These applications are commonly handled in one of two ways. First, special trims are often available in standard control valve bodies. The special trim is typically made up of a seat ring and valve plug that have been designed and machined to very close tolerances to allow accurate control of very small flows. These types of control valves are specially designed for the accurate control of very low-flowing liquid or gaseous fluid applications. (c) High temperature control valves. These designed control valves are special for service at temperatures above 450oF (232oC). They are frequently at elevated temperatures, such as may be encountered in boiler feed water systems and superheater bypass systems. (d) Cryogenic service valves. Cryogenic service valves are for dealing with materials and processes at temperatures below –150oF (–101oC). For control valve applications in cryogenic services, many of the same issues need consideration as with high temperature control valves. Packing is a concern in cryogenic applications. Plastic and electrometric components often cease to function appropriately at temperatures below 0oF (–18oC). In these temperature ranges, components such as packing and plug seals require special consideration. For plug seals, a standard soft seal will become Zhang_Ch01.indd 144 5/13/2008 5:45:44 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 145 very hard and less pliable, thus not providing the shut-off required from a soft seat. Special electrometrics have been applied in these temperatures but require special loading to achieve a tight seal. (4) Stem conditioning valves. A stem conditioning valve is used for the simultaneous reduction of steam pressure and temperature to the level required for a given application. Frequently, these applications deal with high inlet pressures and temperatures and require significant reductions of both properties. They are, therefore, best manufactured in a forged and fabricated body that can better withstand steam loads at elevated pressures and temperatures. Forged materials permit higher design stresses, improved grain structure, and an inherent material integrity over cast valve bodies. The forged construction also allows the manufacturer to provide up to Class 4500, as well as intermediate and special class ratings, with greater ease vs cast valve bodies. Due to frequent extreme changes in steam properties as a result of the temperature and pressure reduction, the forged and fabricated valve body design allows for the addition of an expanded outlet to control outlet steam velocity at lower pressure. Similarly, with reduced outlet pressure, the forged and fabricated design allows the manufacturer to provide different pressure class ratings for the inlet and outlet connections to more closely match the adjacent piping. The latest versions of the stem conditioning valves have these designs: feed-forward design, manifold design, pressure reduction– only design, and turbine bypass design, etc. The turbine bypass system has evolved over the past few decades as the mode of power plant operations has changed. It is employed routinely in utility power plants where operations require quick response to wide swings in energy demands. A typical power plant operation might start at minimum load, increase to full capacity for most of the day, rapidly reduce back to minimum output, and then up again to full load—all within a 24-h period. Boilers, turbines, condensers, and other associated equipment cannot respond properly to such rapid changes without some form of turbine bypass system. The turbine bypass system allows operation of the boiler independent of the turbine. In the start-up mode, or rapid reduction of generation requirement, the turbine bypass not only supplies an alternate flow path for steam, but conditions the steam to the same pressure and temperature normally produced by the turbine expansion process. By providing an alternate flow path for the steam, the turbine bypass system protects the turbine, boiler, and condenser from Zhang_Ch01.indd 145 5/13/2008 5:45:44 PM 146 INDUSTRIAL CONTROL TECHNOLOGY damage that may occur from thermal and pressure excursions. For this reason, many turbine bypass systems require extremely rapid open/close response times for maximum equipment protection. This is accomplished with an electrohydraulic actuation system that provides both the forces and controls for such operation. Additionally, when commissioning a new plant, the turbine bypass system allows start-up and check out of the boiler separately from the turbine. This means quicker plant start-ups, which results in attractive economic gains. It also means that this closed loop system can prevent atmospheric loss of treated feed water and reduction of ambient noise emissions. (5) Valve actuators. Pneumatically operated control valve actuators are the most popular type in use, but electric, hydraulic, and manual actuators are also widely used. All these actuators are introduced in Section 1.2 of this chapter. The spring-and-diaphragm pneumatic actuator is most commonly specified due to its dependability and simplicity of design. Pneumatically operated piston actuators provide high stem force output for demanding service conditions. Adaptations of both spring-and-diaphragm and pneumatic piston actuators are available for direct installation on rotary shaft control valves. Electric and electrohydraulic actuators are more complex and more expensive than pneumatic actuators, which offer advantages where no air supply source is available, where low ambient temperatures could freeze condensed water in pneumatic supply lines, or where unusually large stem forces are needed. Pneumatically operated diaphragm actuators use air supply from controller, positioner, or other sources. Various styles include direct action of increasing air pressure pushes down the diaphragm and extends actuator stem; reverse action of increasing air pressure pushes up the diaphragm and retracts actuator stem; reversible actuators that can be assembled for either direct or reverse action; direct acting unit for rotary valves of increasing air pressure pushes down on the diaphragm, which may either open or close the valve, depending on orientation of the actuator lever on the valve shaft. Piston actuators are pneumatically operated using high-pressure plant air to 150 psig, often eliminating the need for a supply pressure regulator. Piston actuators furnish maximum thrust output and fast stroking speeds. Piston actuators are double acting to give maximum force in either direction, or spring return to provide fail-open or fail-closed operation. Electrohydraulic actuators require only electrical power to the motor and an electrical input signal from the controller. Zhang_Ch01.indd 146 5/13/2008 5:45:44 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 147 Electrohydraulic actuators are ideal for isolated locations where pneumatic supply pressure is not available but where precise control of valve plug position is needed. Units are normally reversible by making minor adjustments and might be self-contained, including motor, pump, and double-acting hydraulically operated piston within a weatherproof or explosion-proof casing. Rack and pinion designs provide a compact and economical solution for rotary shaft valves. Because of backlash, they are typically used for ON–OFF applications or where process variability is not a concern. Traditional electric actuator designs use an electric motor and some form of gear reduction to move the valve. Through adaptation, these mechanisms have been used for continuous control with varying degrees of success. To date, electric actuators have been much more expensive than pneumatic for the same performance levels. This is an area of rapid technological change, and future designs may cause a shift toward greater use of electric actuators. Manual actuators are useful where automatic control is not required, but where ease of operation and good manual control is still necessary. They are often used to actuate the bypass valve in a three-valve bypass loop around control valves for manual control of the process during maintenance or shutdown of the automatic system. Manual actuators are available in various sizes for both globe style valves and rotary shaft valves. Manual actuators are much less expensive than automatic actuators. (6) Positioners. Positioners are used for pneumatically operated valves that depend on a positioner to take an input signal from a process controller and convert it to a valve travel. Positioners are mostly available in three configurations: (a) Pneumatic. A pneumatic signal (usually 3–15 psig) is supplied to the positioner. The positioner translates this to a required valve position and supplies the valve actuator with the required air pressure to move the valve to the correct position. (b) Analog I/P. This positioner performs the same function as the one above, but uses electrical current (usually 4–20 mA) instead of air as the input signal. (c) Digital. Although this positioner functions very much like the analog I/P described above, it differs in that the electronic signal conversion is digital rather than analog. The digital products cover three categories: (i) Digital noncommunicating. A current signal (4–20 mA) is supplied to the positioner, which both powers the electronics and controls the output. Zhang_Ch01.indd 147 5/13/2008 5:45:44 PM 148 INDUSTRIAL CONTROL TECHNOLOGY (ii) HART. This is the same as the digital noncommunicating but is also capable of two-way digital communication over the same wires used for the analog signal. (iii) Fieldbus. This type receives digitally based signals and positions the valve using digital electronic circuitry coupled to mechanical components. (7) Valve accessories. Valve accessories include (a) Limit switches. Limit switches operate discrete inputs to a distributed control system, signal lights, small solenoid valves, electric relays, or alarms. An assembly that mounts on the side of the actuator houses the switches. Each switch adjusts individually and can be supplied for either alternating current or direct current systems. Other styles of valve-mounted limit switches are also available. (b) Solenoid valve manifold. The actuator type and the desired fail-safe operation determine the selection of the proper solenoid valve. The solenoids can be used on double-acting pistons or single-acting diaphragm actuators. (c) Supply pressure regulator. Supply pressure regulators, commonly called airsets, reduce plant air supply to valve positioners and other control equipment. Common reduced air supply pressures are 20, 35, and 60 psig. The regulator mounts integrally to the positioner or nipple-mounts or bolts to the actuator. (d) Pneumatic lock-up systems. Pneumatic lock-up systems are used with control valves to lock in existing actuator loading pressure in the event of supply pressure failure. These devices can be used with volume tanks to move the valve to the fully open or closed position on loss of pneumatic air supply. Normal operation resumes automatically with restored supply pressure. Functionally similar arrangements are available for control valves using diaphragm actuators. (e) Fail-safe systems for piston actuators. In these fail-safe systems, the actuator piston moves to the top or bottom of the cylinder when supply pressure falls below a predetermined value. The volume tank, charged with supply pressure, provides loading pressure for the actuator piston when supply pressure fails, thus moving the piston to the desired position. Automatic operation resumes, and the volume tank is recharged when supply pressure is restored to normal. (f) PC diagnostic software. PC diagnostic software provides a consistent, easy to use interface to every field instrument within a plant. For the first time, a single resource can be used to communicate and analyze field electronic “smart” Zhang_Ch01.indd 148 5/13/2008 5:45:44 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 149 devices such as pressure xmtrs, flow xmtrs, etc., not pneumatic positioners, boosters. Users can benefit from reduced training requirements and reduced software expense. A single purchase provides the configuration environment for all products. Products and services are available that were not possible with stand-alone applications. The integrated product suite makes higher level applications and services possible. (g) Electropneumatic transducers. The transducer receives a direct current input signal and uses a torque motor, nozzle flapper, and pneumatic relay to convert the electric signal to a proportional pneumatic output signal. Nozzle pressure operates the relay and is piped to the torque motor feedback bellows to provide a comparison between input signal and nozzle pressure. 1.3.1.2 Technical Specifications Control valves handle all kinds of fluids at temperatures from the cryogenic range to well over 1000°F (538oC). Selection of a control valve body assembly requires particular consideration to provide the best available combination of valve body style, material, and trim construction design for the intended service. Capacity requirements and system operating pressure ranges must also be considered in selecting a control valve to ensure satisfactory operation without undue initial expense. Reputable control valve manufacturers and their representatives are dedicated to helping in selecting the control valve most appropriate for the existing service conditions. Because there are often several possible correct choices for an application, it is important that all the following information be provided: (1) type of fluid to be controlled; (2) temperature of fluid; (3) viscosity of fluid; (4) specific gravity of fluid; (5) flow capacity required (maximum and minimum); (6) inlet pressure at valve (maximum and minimum); (7) outlet pressure (maximum and minimum); (8) pressure drop during normal flowing conditions; (9) pressure drop at shutoff; (10) maximum permissible noise level, if pertinent and the measurement reference point; Zhang_Ch01.indd 149 5/13/2008 5:45:44 PM 150 INDUSTRIAL CONTROL TECHNOLOGY (11) degrees of superheat or existence of flashing, if known; (12) inlet and outlet pipeline size and schedule; (13) special tagging information required; (14) body material; (15) end connections and valve rating; (16) action desired on air failure; (17) instrument air supply available; (18) instrument signal. The following information will require the agreement of the user and the manufacturer depending on the purchasing and engineering practices being followed: (1) valve type number; (2) valve size; (3) valve body construction (angle, double port, butterfly, etc.); (4) valve plug guiding (cage style, port guided, etc.); (5) valve plug action (push down to close or push down to open); (6) port size (full or restricted); (7) valve trim materials required; (8) flow action (flow tends to open valve or flow tends to close valve); (9) actuator size required; (10) bonnet style (plain, extension, etc.); (11) packing material (laminated graphite, environmental sealing systems, etc.); (12) accessories required (positioner, handwheel, etc.). The following steps need to be undertaken for the selection of a valve: (1) determine service condition; (2) calculate preliminary cv required; (3) select trim type; (4) select valve body and trim size; (5) select trim materials; (6) other consideration such as shutoff, stem packing, etc. 1.3.1.3 Application Guide The performance of the control valves can be affected by the following factors: (1) Dead band. Dead band is a range or band of controller output values that fails to produce a change in the measured process Zhang_Ch01.indd 150 5/13/2008 5:45:44 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 151 variable when the input signal reverses direction. When a load disturbance occurs, the process variable deviates from the set point; the deviation initiates a corrective action through the controller and back through the process. However, an initial change in controller output can produce no corresponding corrective change in the process variable. Only when the controller output has been changed enough to progress through the dead band does a corresponding change in the process variable occur. Any time the controller output reverses direction, the controller signal must pass through the dead band before any corrective change in the process variable will occur. Therefore, dead band is a major contributor to excess process variability, and control valve assemblies can be a primary source of dead band in an instrumentation loop due to a variety of causes such as friction, backlash, shaft windup, relay or spool valve dead zone, etc. Its presence in the process ensures that the process variable deviation from the set point will have to increase until it is big enough to get through the dead band. Only then can a corrective action occur. Some of most common causes affecting dead band are friction and backlash in the control valve, along with shaft wind-up in rotary valves, and relay dead zone. Because most control actions for regulatory control consist of small changes (1% or less), a control valve with excessive dead band might not even respond to many of these small changes. A well-engineered valve should respond to signals of 1% or less to provide effective reduction in process variability. However, it is not uncommon for some valves to exhibit dead band as great as 5% or more. In a recent plant audit, 30% of the valves had dead bands in excess of 4%. Over 65% of the loops audited had dead bands greater than 2%. Friction is a major cause of dead band in control valves. Rotary valves are often very susceptible to friction caused by the high seat loads required to obtain shut-off with some seal designs. Because of the high seal friction and poor drive train stiffness, the valve shaft winds up and does not translate motion to the control element. As a result, an improperly designed rotary valve can exhibit significant dead band that clearly has a detrimental effect on process variability. Manufacturers usually lubricate rotary valve seals during manufacture, but after only a few hundred cycles this lubrication wears off. In addition, pressureinduced loads also cause seal wear. As a result, the valve friction can increase by 400% or more for some valve designs. This illustrates the misleading performance conclusions that can result from evaluating products using bench-type data before the torque has stabilized. Packing friction is the primary source of friction Zhang_Ch01.indd 151 5/13/2008 5:45:45 PM 152 INDUSTRIAL CONTROL TECHNOLOGY in sliding stem valves. In these types of valves, the measured friction can vary significantly between valve styles and packing arrangements. Actuator style also has a profound impact on control valve assembly friction. Generally, spring-and-diaphragm actuators contribute less friction to the control valve assembly than piston actuators. Piston actuator friction probably will increase significantly with use as guide surfaces and the O-rings wear, lubrication fails, and the elastomer degrades. Backlash is the name given to slack or looseness of a mechanical connection. This slack results in a discontinuity of motion when the device changes direction. Backlash commonly occurs in gear drives of various configurations. Rack-and-pinion actuators are particularly prone to dead band due to backlash. Some valve shaft connections also exhibit dead band effects. Spline connections generally have much less dead band than keyed shafts or double-D designs. While friction can be reduced significantly through good valve design, it is a difficult phenomenon to eliminate entirely. A wellengineered control valve should be able to virtually eliminate dead band due to backlash and shaft wind-up. For best performance in reducing process variability, the total dead band for the entire valve assembly should be 1% or less. Ideally, it should be as low as 0.25%. (2) Actuator/positioner design. Both the actuator and positioner designs greatly affect static performance (dead band), as well as the dynamic response of the control valve assembly and the overall air consumption of the valve instrumentation. Static gain is related to the sensitivity of the device to the detection of small (0.125% or less) changes of the input signal. Unless the device is sensitive to these small signal changes, it cannot respond to minor upsets in the process variable. This high static gain of the positioner is obtained through a preamplifier, similar in function to the preamplifier contained in high fidelity sound systems. In many pneumatic positioners, a nozzle flapper or a similar device serves as this high static gain preamplifier. Once the high static gain positioner preamplifier has detected a change in the process variable, the positioner must then be capable of making the valve closure member move rapidly to provide a timely corrective action to the process variable. This requires much power to make the actuator and valve assembly move quickly to a new position, which means that the positioner must rapidly supply a large volume of air to the actuator to make it respond promptly. The ability to do this comes from the high dynamic gain of the positioner. Although the positioner Zhang_Ch01.indd 152 5/13/2008 5:45:45 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 153 preamplifier can have high static gain, it typically has little ability to supply the power needed. Thus, the preamplifier function must be supplemented by a high dynamic gain power amplifier that supplies the required air flow as rapidly as needed. A relay or a spool valve typically provides this power amplifier function. In summary, high-performance positioners with both high static and dynamic gain provide the best overall process variability performance for any given valve assembly. (3) Valve response time. It is important that the valve reach a specific position quickly in control. A quick response to small signal changes (1% or less) is one of the most important factors in providing optimum process control. Valve response time is measured by a parameter called T63 (Tee-63). T63 is the time measured from initiation of the input signal change to when the output reaches 63% of the corresponding change. It includes both the valve assembly dead time, which is a static time, and the dynamic time of the valve assembly. The dynamic time is a measure of how long the actuator takes to get to the 63% point once it starts moving. Dead band, whether it comes from friction in the valve body and actuator or from the positioner, can significantly affect the dead time of the valve assembly. It is important to keep the dead time as small as possible. Generally dead time should be no more than one-third of the overall valve response time. However, the relative relationship between the dead time and the process time constant is critical. If the valve assembly is in a fast loop where the process time constant approaches the dead time, the dead time can dramatically affect loop performance. On these fast loops, it is critical to select control equipment with dead time as small as possible because some valve assembly designs can have dead times that are 3–5 times longer in one stroking direction than the other. Once the dead time has passed and the valve begins to respond, the remainder of the valve response time comes from the dynamic time of the valve assembly. This dynamic time will be determined primarily by the dynamic characteristics of the positioner and actuator combination. These two components must be carefully matched to minimize the total valve response time. This dynamic gain comes mainly from the power amplifier stage in the positioner. However, this high dynamic gain power amplifier will have little effect on the dead time unless it has some intentional dead band designed into it to reduce static air consumption. The design of the actuator significantly affects the dynamic time. For example, the greater the volume of the actuator air chamber to be filled, the slower the valve response time. Zhang_Ch01.indd 153 5/13/2008 5:45:45 PM 154 INDUSTRIAL CONTROL TECHNOLOGY To minimize the valve assembly dead time, minimize the dead band of the valve assembly, whether it comes from friction in the valve seal design, packing friction, shaft wind-up, actuator, or positioner design. As indicated, friction is a major cause of dead band in control valves. On rotary valve styles, shaft wind-up can also contribute significantly to dead band. Actuator style also has a profound impact on control valve assembly friction. On the impact from the actuators, generally say, spring-and-diaphragm actuators contribute less friction to the control valve assembly than piston actuators over an extended time. As mentioned, this is caused by increasing friction from the piston O-ring, misalignment problems, and failed lubrication. Having a positioner design with a high static gain preamplifier can make a significant difference in reducing dead band. This can also make a significant improvement in the valve assembly resolution. Valve assemblies with dead band and resolution of 1% or less are no longer adequate for many process variability reduction needs. Many processes require the valve assembly to have dead band and resolution as low as 0.25%, especially where the valve assembly is installed in a fast process loop. Selecting the proper valve, actuator, and positioner combination is not easy. It is not simply a matter of finding a combination that is physically compatible. Good engineering judgment must go into the practice of valve assembly sizing and selection to achieve the best dynamic performance from the loop. (4) Valve types and sizing. The style of valve used and the sizing of the valve can have a large impact on the performance of the control valve assembly in the system. Although a valve must be of sufficient size to pass the required flow under all possible contingencies, a valve that is too large for the application is a detriment to process optimization. Flow capacity of the valve is also related to the style of valve through the inherent characteristic of the valve. The inherent characteristic is the relationship between the valve flow capacity and the valve travel when the differential pressure drop across the valve is held constant. The best process performance occurs when the required flow characteristic is obtained through changes in the valve trim rather than through use of cams or other methods. Proper selection of a control valve designed to produce a reasonably linear installed flow characteristic over the operating range of the system is a critical step in ensuring optimum process performance. Oversizing of valves sometimes occurs when trying to optimize process performance through a reduction of process variability. Zhang_Ch01.indd 154 5/13/2008 5:45:45 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 155 This results from using line-size valves, especially with highcapacity rotary valves, as well as the conservative addition of multiple safety factors at different stages in the process design. Oversizing the valve hurts process variability in two ways. First, the oversized valve puts too much gain in the valve, leaving less flexibility in adjusting the controller. Best performance results when most loop gain comes from the controller. The second way oversized valves hurt process variability is that an oversized valve is likely to operate more frequently at lower valve openings where seal friction can be greater, particularly in rotary valves. Because an oversized valve produces a disproportionately large flow change for a given increment of valve travel, this phenomenon can greatly exaggerate the process variability associated with dead band due to friction. When the valve is oversized, the valve tends to reach system capacity at relatively low travel, making the flow curve flatten out at higher valve travels. When selecting a valve, it is important to consider the valve style, inherent characteristic, and valve size that will provide the broadest possible control range for the application. 1.3.2 Self-Actuated Valves Self-actuated valve stands for those valves that use fluid or gas existing in a system to position the valve. Check valves and relief valves are two important examples of self-actuated valves. In additional to check valves and relief valves, safety valves and steam traps are also defined as selfactuated valves. All of these valves are being actuated with the system fluid or gas; no source of power outside the system fluid or gas energy is necessary for operation of these valves. 1.3.2.1 Check Valves Check valves are self-activating safety valves that permit gases and liquids to flow in only one direction, preventing process flow from reversing. When open and under flow pressure, the checking mechanism will move freely in the medium, offering very little resistance and minimal pressure drop. Check valves are classified as one-way directional valves: fluid flow in the desired direction opens the valve, while backflow forces the valve to close. (1) Operating principle. A check valve is a one-way valve for fluid flow. There are many ways to achieve one-way flow. Most check valves contain a ball that sits freely above the seat, which has Zhang_Ch01.indd 155 5/13/2008 5:45:45 PM 156 INDUSTRIAL CONTROL TECHNOLOGY only one through-hole. The ball has a slightly larger diameter than that of the through-hole. When the pressure behind the seat exceeds that above the ball, liquid is allowed to flow through the valve; however, once the pressure above the ball exceeds the pressure below the seat, the ball returns to rest in the seat, forming a seal that prevents backflow. Figure 1.45 is used here to describe briefly the principles of check valves. Device A consists of a ball bearing retained by a spring. Fluid flowing to the right will push the ball bearing against the spring, and open the valve to permit flow. This device requires some pressure to compress the spring and open the valve. If an attempt is made to flow fluid to the left, the ball bearing seals against the opening and no flow is allowed. This is a modern design that requires round balls. Device B is simply a flapper that is anchored on one side. The flapper can be a hinged metallic door, a thin piece of metal, or a piece of rubber or polymer. This is the simplest design and was used in early pumps. Two methods of incorporating check valves into pumps are also shown in Fig. 1.46. In schematic A, the check valves permit expulsion of the fluid to the right on the downward stroke while denying flow to the left. On the upward stroke, the pump fills from the left, while denying reverse flow from the right. The design in schematic B is somewhat different. The piston has one or more holes drilled though with a check valve on each hole. (One hole is illustrated.) On the downward stroke, the fluid moves from below the piston to the chamber above the piston and is denied exit to the left. On the upward stroke, fluid is pushed Flow (a) Flow (b) Figure 1.45 Device A consists of a ball bearing retained by a spring; device B is simply a flapper anchored on one side (courtesy of Michigan State University). Zhang_Ch01.indd 156 5/13/2008 5:45:45 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 157 Flow (a)—Downward stroke forces fluid out in this device Flow Hole drilled in piston (b)—Upward stroke forces fluid out in this device Figure 1.46 Two methods of incorporating check valves into pumps (courtesy of Michigan State University). out the exit on the right and simultaneously more fluid is drawn from the entrance on the left. Case B is the design illustrated by Watt in his patent and described as the air pump since it pumps air as well as water. (2) Basic types. Check valves use a variety of technologies to allow and stop the flow of liquids and gases. Single-disk swing valves are designed with the closure element attached to the top of the cap. Double-disk or wafer check valves consist of two half-circle disks hinged together that fold together upon positive flow and retract to a full circle to close against reverse flow. Lift-check valves feature a guided disk. Spring-loaded devices can be mounted vertically or horizontally. Silent or center guide valves are similar to lift check valves, with a center guide extending from inlet to outlet ports. The valve stopper is spring and bushing actuated to keep the movement “quiet.” Ball check valves use a free-floating or spring-loaded ball resting in a seat ring as the closure element. Cone check valves use a free-floating or springloaded cone resting in the seat ring as the closure element. Although there are many types of check valves, two basic types are most popular in industrial control: swing check valves and ball check valves. Both types of valves may be installed vertically or horizontally. (a) Swing check valves. Swing check valves are used to prevent flow reversal in horizontal or vertical upward pipelines (vertical pipes or pipes in any angle from horizontal to vertical Zhang_Ch01.indd 157 5/13/2008 5:45:45 PM 158 INDUSTRIAL CONTROL TECHNOLOGY with upward flow only). Swing check valves have disks that swing open and closed. The disks are typically designed to close on their own weight and may be in a state of constant movement if velocity pressure is not sufficient to hold the valve in a wide open position. Premature wear or noisy operation of the swing check valves can be avoided by selecting the correct size on the basis of flow conditions. The minimum velocity required to hold a swing check valve in the open position is expressed by the empirical formula given by Fig. 1.47, where V is the liquid flow measured in m/s or ft/s; v is the special volume of the liquid measured in m3/N or ft3/lb; j equals 133.7 (35) for Y-pattern, or = 229.1 (60) for bolted cap, or 381.9 (100) for U/L listed. Tilting disk check valves are pivoted circular disks mounted in a cylindrical housing. These check valves have the ability to close rapidly, thereby minimizing slamming and vibrations. Tilting disk checks are used to prevent reversal in horizontal or vertical-up lines similar to swing check valves. The minimum velocity required for holding a tilting check valve wide open can be determined by the empirical formula given in Fig. 1.47, where V is the liquid flow measured in m/s or ft/s; v is the special volume of the liquid measured in m3/N or ft3/lb; j equals 305.5 (80) for 5 times by disk angle (typically for steel), or = 114.6 (30) for 15 times by disk angle (typical for iron). Lift check valves also operate automatically by line pressure. They are installed with pressure under the disk. A lift check valve typically has a disk that is free floating and is lifted by the flow. Liquid has an indirect line of flow, so the lift check restricts the flow. Because of this, lift check valves are similar to globe valves and are generally used as a companion to globe valves. (b) Ball check valves. A ball check valve is a type of check valve in which the movable part is a spherical ball as illustrated in Fig. 1.48. Ball check valves are used in spray devices, dispenser spigots, manual and other pumps, and refillable dispensing syringes. Ball check valves may sometimes use a free-floating or spring-loaded ball. Ball check valves are generally simple, inexpensive metallic parts, although specialized ball check valves are also Vi j v Figure 1.47 The minimum velocity formula of swing check valves. Zhang_Ch01.indd 158 5/13/2008 5:45:45 PM 159 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 7 3 5 2 6 4 1 8 4 E EG Figure 1.48 The working block of a ball check valve. In this figure, 1 is the seat body, 2 is the cap, 3 is the ball, 4 is the angle body, 5 is the body clamp, 6 is the body gasket, and 8 is the cap gasket (courtesy of VNE Corporation). available. For example, ball check valves in high-pressure pumps used in analytical chemistry have a ball of synthetic ruby, a hard and chemically resistant substance. A ball check valve is not to be confused with a ball valve, a quarter-turn valve similar to a butterfly valve in which the ball acts as a controllable rotor. (3) Specifications. The following contents are the basic specifications of check valves: (a) Technical types of check valves include (i) Ball and cone check valves. Ball and cone check valves use a free-floating or spring-loaded ball resting in a seat ring as the closure element. Upon reverse flow, the ball is forced back into its seat preventing backflow. (ii) Double check valves. Double check valves are assemblies that contain two distinct check valves. (iii) Duckbill check valves. Duckbill valves are flowsensitive, variable-area, check valves. They get their name from their shape, which consists of two flaps shaped like a duck’s bill. In zero flow conditions, the valve remains closed. As the flow increases, the pressure on the flaps increases and the valve opens. (iv) Foot check valves. Foot valves are a type of check valve with a built-in strainer. They are used at the point of liquid intake to retain liquid in the system. Zhang_Ch01.indd 159 5/13/2008 5:45:46 PM 160 INDUSTRIAL CONTROL TECHNOLOGY (v) Lift check valves. Lift check valves use a free-floating closure element, consisting of a piston or poppet and a seat ring. The piston or poppet actuates either horizontal or vertical to the flow, depending on the valve construction. (vi) Swing check valves. Swing check valves are designed with the closure element attached to the top of the cap. The closure element can be pushed aside by the flow, but swings back into the close position upon flow reversal. (vii) Umbrella check valves. Umbrella check valves are elastomer self-activating devices. These valves simply press into a hole and can be designed to function within a specified pressure range. The valve gets its name from the umbrella-like shape of the device. (viii) Wafer/split disc check valves. Wafer or split disk check valves have two half-circle disks hinged together that fold together upon positive flow and retract to a full circle to close against reverse flow. (b) Technical parameters of check valves include (i) Valve size. It is the designated size of the valve as specified by the manufacturer, which typically represents the size of the passage opening. (ii) Pressure rating. It is the maximum safe pressure value for which the valve is rated. (iii) Media temperature. It is the maximum temperature of media the valve is designed to accommodate. (iv) Flow. The valve flow coefficient is the number of U.S. gallons per minute of 60° F water that will flow through a valve at a specified opening with a pressure drop of 1 psi across the valve. It is used to predict flow rates. (c) Connection methods for the check valves can be (i) Threaded. The valve has internal or external threads for inlet or outlet connection(s). (ii) Compression fitting. It is a sealed pipe connection without soldering or threading. As the nut on one fitting is tightened, it compresses a washer around the second pipe, forming a watertight closure. (iii) Bolt flange. The valve has a bolt flange(s) for inlet or outlet connection. (iv) Clamp flange. The valve has a clamp flange(s) for inlet or outlet connection. (v) Union. The valve has a union connection for inlet or outlet connection(s). Zhang_Ch01.indd 160 5/13/2008 5:45:46 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 161 (vi) Tube fitting. The valve has a connection for directly joining tubing at the inlet and or outlet connections. (vii) Butt weld. The valve has a butt weld–sized connection for inlet or outlet connection. (viii) Socket weld/solder. The valve has a socket weld connection for inlet or outlet connection. 1.3.2.2 Relief Valves The relief valve is a valve mechanism that ensures system fluid flow when a preselected differential pressure across the filter element is exceeded; the valve allows all or part of the flow to bypass the filter element. Relief valves are used on oil and gas production systems, compressor stations, gas transmission (pipeline) facilities, storage systems, in all gas processing plants, and whenever there is a need to exhaust the overpressure volume of gas, vapor, and/or liquid. (1) Operating principle. Figure 1.49 illustrates the working blocks of a relief valve. Relief valves operate on the principle of unequal areas exposed to the same pressure. When the relief valve is closed, the system pressure pushes upward against the piston seat seal on an area equal to the inside diameter of the seat. Simultaneously, the same system pressure, passing through the Normal pressure Figure 1.49 The working blocks of a relief valve (courtesy of P.C. McKenzie Company). Zhang_Ch01.indd 161 5/13/2008 5:45:46 PM 162 INDUSTRIAL CONTROL TECHNOLOGY pilot, exerts a downward force on the piston acting on an area approximately 50% greater than the inside diameter of the seat. The resulting differential force holds the valve tightly closed. As the system reaches the discharge set pressure of the valve, the piston seal becomes tighter until the system pressure reaches the relief valve discharge set pressure. At that moment, and not before, the pilot cuts off the supply of system pressure to the top of the piston and vents that system pressure which is located in the chamber above the piston of the relief valve. At the same instant, the relief valve pops open. When the predetermined blow down pressure is reached (either fixed or adjustable), the pilot shuts off the exhaust and reopens flow of system pressure to the top of the piston, effectively closing the relief valve. Figure 1.50 is a drawing of a direct operating pressure relief valve. This pressure relief valve is mounted at the pressure side of the hydraulic pump that is located on its bottom. The task of this pressure relief valve is to limit the pressure in the system on an acceptable value. In fact a pressure relief valve has the same construction as a spring-operated check valve. When the system gets overloaded the pressure relief valve will open and the pump flow will be led directly into the hydraulic reservoir. The pressure in the system remains on the value determined by the spring T P Figure 1.50 A drawing of a direct operating pressure relief valve. Zhang_Ch01.indd 162 5/13/2008 5:45:47 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 163 on the pressure relief valve. In the pressure relief valve, the pressure that is equal to the system energy will be converted into heat. For this reason pressure relief valves should not be operated for long durations. (2) Basic types and specifications. Table 1.5 lists several important types of relief valve, categorized in terms of their applications. In industrial control, typical features for relief valves include the following: (1) Pressure settings of relief valves are externally adjustable while the valve is in operation. Most vendors of relief valves offer eight different spring ranges to provide greater system sensitivity and enhanced performance. (2) Manual override option with positive stem retraction is available for pressures. This option permits the user to relieve upstream pressure while maintaining the predetermined cracking pressure. (3) Colorcoded springs and labels indicate spring cracking range. (4) Lock wire feature secures a given pressure setting. Typical specifications of a relief valve include (a) Working pressure. It can be up to 6000 psig (414 bars) or up to 8000 psig (552 bars) during relief with no internal seal damage. Table 1.5 Important Types of Relief Valves Temperature and pressure relief valves Reseating temperature and pressure relief valves Pressure relief valves Poppet style relief valves Zhang_Ch01.indd 163 Temperature and pressure relief valves are used in water heater and hot water storage tank applications to provide automatic temperature and pressure protection to hot water supply tanks and hot water heaters Automatic reseating temperature and pressure relief valves are used in commercial water heater applications to provide automatic temperature and pressure protection to domestic hot water supply tanks and hot water heaters Pressure relief valves are used in hot water heating and domestic supply boiler applications to protect against excessive pressures on all types of hot water heating supply boiler equipment. Calibrated pressure relief valves are used in commercial, residential, and industrial applications to protect against excessive pressure in systems containing water, oil, or air. 5/13/2008 5:45:47 PM 164 INDUSTRIAL CONTROL TECHNOLOGY (b) Cracking pressure. For eight springs, it is normally from 50 to 6000 psig in the following ranges: 50–350, 350–750, 750– 1500, 1500–2250, 2250–3000, 3000–4000, 4000–5000, and 5000–6000 psig. (c) Temperature rating. For Buna-N Rubber it can be –30°F to +225°F (–34°C to +107°C); for highly fluorinated fluorocarbon rubber, it can be –20°F to +200°F (–29°C to +93°C); for ethylene propylene rubber, it can be –70°F to +275°F (–57°C to +135°C); for fluorocarbon rubber, it can be –10°F to +400°F (–23°C to +204°C); for neoprene rubber, it can be –45°F to +250°F (–43°C to +121°C). The American Society of Mechanical Engineers (ASME) has already issued the code for valves (please refer to ASME Code Section I or Section VIII for the proper code). (a) Pressure setting points. ASME Code stipulates that the pressure setting of a safety relief valve does not exceed 10 psig or 20% of the operating pressure of the system or vessel. (b) Capacity guidelines (i) ASME Code—Section I. The total relieving capacity of the valve shall not be less than the maximum operating pressure of the vessel of line, as designed by the manufacturer. (ii) ASME Code—Section VIII. The minimum relieving capability of the valve shall discharge the total amount of the maximum operating pressure of the system or vessel, without a rise in the pressure vessel in the event of overpowering the system. (c) About sizing. It is important not to oversize a relief valve. Typically, this will result in valve chatter or rapid opening and closing of the valve seating and disk. If chattering is present, it would be more economical to use two valves. (3) Installation and maintenance for pressure relief valves. It should be noted that only a qualified engineer who is familiar with pressure relief valves be allowed to perform all installations and maintenances. These steps below are routinely followed in all the installations and maintenances for pressure relief valves: (a) First, you should turn off the operations system and enable all pressure to bleed through prior to installation. (b) Then, you can remove all thread protectors and plugs from the valve. (c) Note that valves should only be installed in an upright position, allowing for correct reseating of the valve disc upon opening or popping. (d) You must clean the connecting area of all dirt and grime; then apply a small amount or piping compound to the valve inlet side. Zhang_Ch01.indd 164 5/13/2008 5:45:47 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 165 (e) Keeping away from the first few threads, the valve can be tightened by hand to ensure proper thread alignments. (f) By using the proper sized wrench on the hex shaped valve body, you can tighten the system to a firm or snug setting by a padded wrench as recommended. (g) Please note that discharge piping must be equal to or larger than the outlet size of the valve, ensuring that flow-rated characteristics are not compromised. (h) Note that discharge piping must be designed to anchor and must be secured in a manner to prevent swaying, rattling, or vibration. (i) If the valve is venting to atmosphere, you should take all the necessary steps to ensure that the outlet (discharge) is pointed in a direction away from personnel or critical equipment. (j) When testing a valve, the lift lever is designed to be opened only when the system pressure is at 80% of the set pressure (popping or cracking) point. The valve is kept in an open position for a period of time, long enough to ensure the cleansing of the seating area. 1.3.3 Solenoid Valves A solenoid control valve is a kind of isolation valve that is an electromechanical device allowing for an electrical device to control the flow of gas or liquid. The electrical device causes a current to flow through a coil located on the solenoid valve, which in turn results in a magnetic field that causes the displacement of a metal actuator. The actuator is mechanically linked to a mechanical valve inside the solenoid valve. This mechanical valve then opens or closes to allow a liquid or gas either to flow through or be blocked by the solenoid valve. In this control system, a spring is used to return the actuator and valve back to their resting states when the current flow is removed. Figure 1.51 gives an application of the typical control system with a solenoid valve. A coil inside the solenoid valve generates a magnetic field once an electric current is flowing through. The generated magnetic field actuates the ball valve that can change states to open or close the device in the fluid direction indicated by the arrow. Solenoid valves are used wherever fluid flow has to be controlled automatically. Factory automation makes a typical example of frequent use of solenoid valves. A computer device running a factory automation program to fill a container with some liquid can send a signal to the solenoid valve to open, allowing the container to fill, and then remove the signal to close the solenoid valve and stop the flow of liquid until the next container is in place. A gripper for grasping items on a robot is frequently an Zhang_Ch01.indd 165 5/13/2008 5:45:47 PM 166 INDUSTRIAL CONTROL TECHNOLOGY Solenoid valve S Ball valve Figure 1.51 A typical flow control system with solenoid valve (courtesy of Z-Tide Valves). air-controlled device. A solenoid valve can be used to allow air pressure to close the gripper, and a second solenoid valve can be used to open the gripper. If a two-way solenoid valve is used, two separate valves are not needed in this application. Solenoid valve connectors are used to connect solenoid valves and pressure switches. 1.3.3.1 Operating Principles (1) Solenoid. Solenoid valves are control units which, when electrically energized or deenergized, either shut off or allow fluid flow. The actuator inside a solenoid valve takes the form of an electromagnet. When energized, a magnetic field builds up which pulls a plunger or pivoted armature against the action of a spring. When deenergized, the plunger or pivoted armature is returned to its original position by the spring action. According to the mode of actuation, a distinction is made between direct-acting valves, internally piloted valves, and externally piloted valves. A further distinguishing feature is the number of port connections or the number of flow paths or “ways.” With a direct-acting solenoid valve, the seat seal is attached to the solenoid core. In the deenergized condition, a seat orifice is closed, which opens when the valve is energized. With direct-acting Zhang_Ch01.indd 166 5/13/2008 5:45:47 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 167 valves, the static pressure forces increase with increasing orifice diameter, which means that the magnetic forces required for overcoming the pressure force become correspondingly larger. Internally piloted solenoid valves are, therefore, employed for switching higher pressures in conjunction with larger orifice sizes; in this case, the differential fluid pressure performs the main work in opening and closing the valve. The two-way solenoid valves are shut-off valves with one inlet port and one outlet port as shown in Fig. 1.52(a). In the deenergized condition, the core spring, assisted by the fluid pressure, holds the valve seal on the valve seat to shut off the flow. When energized, the core and seal are pulled into the solenoid coil and the valve opens. The electromagnetic force is greater than the combined spring force and the static and dynamic pressure forces of the medium. The three-way solenoid valves have three port connections and two valve seats. One valve seal always remains open and the other closed in the deenergized mode. When the coil is energized, the mode reverses. The three-way solenoid valve shown in Fig. 1.52(b) is designed with a plunger-type core. Various valve operations are available according to how the fluid medium is connected to the working ports in Fig. 1.52(b). The fluid pressure builds up under the valve seat. With the coil deenergized, a conical spring holds the lower core seal tightly against the valve seat and shuts off the fluid flow. Port A is exhausted through R. When the coil is energized the core is pulled in, and the valve seat at Port R is sealed off by the spring-loaded upper core seal. The fluid medium now flows from P to A. Unlike the versions with plunger-type cores, pivoted-armature solenoid valves have all port connections in the valve body. An isolating diaphragm ensures that the fluid medium does not come into contact with the coil chamber. Pivoted-armature valves can be used to obtain any three-way solenoid valve operation. The basic design principle is shown in Fig. 1.52(c). Pivoted-armature valves are provided with manual override as a standard feature. Internally piloted solenoid valves are fitted with either a twoway or a three-way pilot solenoid valve. A diaphragm or a piston provides the seal for the main valve seat. The operation of such a valve is indicated in Fig. 1.52(d). When the pilot valve is closed, the fluid pressure builds up on both sides of the diaphragm via a bleed orifice. As long as there is a pressure differential between the inlet and outlet ports, a shut-off force is available by virtue of the larger effective area on the top of the diaphragm. When the pilot valve is opened, the pressure is relieved from the upper side Zhang_Ch01.indd 167 5/13/2008 5:45:48 PM 168 INDUSTRIAL CONTROL TECHNOLOGY R A P P A (a) (b) P P A (c) A R (d) P A (e) (f) Figure 1.52 The operating principle of solenoid valve (courtesy of OMEGA). Zhang_Ch01.indd 168 5/13/2008 5:45:48 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 169 of the diaphragm. The greater effective net pressure force from below now raises the diaphragm and opens the valve. In general, internally piloted valves require a minimum pressure differential to ensure satisfactory opening and closing. Internally piloted four-way solenoid valves are used mainly in hydraulic and pneumatic applications to actuate double-acting cylinders. These valves have four port connections: a pressure inlet P, two cylinder port connections A and B, and one exhaust port connection R. An internally piloted four/two-way poppet solenoid valve is shown in Fig. 1.52(e). When deenergized, the pilot valve opens at the connection from the pressure inlet to the pilot channel. Both poppets in the main valve are now pressurized and switch over. Now port connection P is connected to A, and B can exhaust via a second restrictor through R. With these types an independent pilot medium is used to actuate the valve. Figure 1.52(f) shows a piston-operated angle-seat valve with closure spring. In the unpressurized condition, the valve seat is closed. A three-way solenoid valve, which can be mounted on the actuator, controls the independent pilot medium. When the solenoid valve is energized, the piston is raised against the action of the spring and the valve opens. A normally open valve version can be obtained if the spring is placed on the opposite side of the actuator piston. In these cases, the independent pilot medium is connected to the top of the actuator. Doubleacting versions controlled by four/two-way valves do not contain any spring. (2) Manifold. The manifold of the solenoid valves consists of a matrix of solenoid valves mounted in modules on a skid with adjustable legs along one direction (Fig. 1.53). The quantity of the mounted solenoid valves depends on the elements to be connected as tanks or lines, and on the functions of each of these elements. A plurality of solenoid valves is arranged and placed on a solenoid valve installing face of the manifold, and a board formed with an electric circuit for feeding these solenoid valves (Fig. 1.53). Each solenoid valve includes a valve portion containing a valve member and a solenoid operating portion for driving the valve member. The board is mounted on the first side face of the manifold under the solenoid operating portion. The board can be attached and detached while leaving the solenoid valves mounted on the manifold, feeding connectors and indicating lights being respectively provided in positions on the board corresponding to the respective solenoid valves. Each the feeding connector is disposed in such a position that is connected to a receiving terminal of the solenoid valve in a plug-in manner simultaneously with Zhang_Ch01.indd 169 5/13/2008 5:45:50 PM 170 INDUSTRIAL CONTROL TECHNOLOGY Figure 1.53 Several types of manifold of solenoid valves (courtesy of KIP Inc.). mounting of the solenoid valve to the manifold. Each the indicating light is disposed in such a position that can be visually recognized from above the solenoid valve while leaving the solenoid valve mounted on the manifold. This manifold allows centralizing the functions of one or various tanks in a modular way, enhancing the efficiency of the system and control over the process. Manifold of the solenoid valves is an automated alternative to the flexible hoses and the flow divert panels with changeover bends. As many valves as the number of functions the element has to perform are connected to the tank or working line. No manual operation is required. The operation is automated, preventing any risk of accidents. 1.3.3.2 Basic Types Solenoid valves are opened and closed via a solenoid activated by an electrical signal including all types of flow paths and proportional solenoid valves. In most industrial applications, solenoid valves are arranged as the following five types: (1) Two-way solenoid valves. This type of solenoid valve normally has one inlet and one outlet and is used to permit and shut off fluid flow. The two types of operations for this type are “normally closed” and “normally open.” Zhang_Ch01.indd 170 5/13/2008 5:45:50 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 171 (2) Three-way solenoid valves. These valves normally have three pipe connections and two orifices. When one orifice is open, the other is closed and vice versa. They are commonly used to alternately apply pressure to an exhaust pressure from a valve actuator or a single-acting cylinder. These valves can be normally closed, normally open, or universal. (3) Four-way solenoid valves. These valves have four or five pipe connections, commonly called ports. One is a pressure inlet port, and two others are cylinder ports providing pressure to the double-acting cylinder or actuator, and one or two outlets exhaust pressure from the cylinders. They have three types of construction: single solenoid, dual solenoid, or single air operator. (4) Direct mount solenoid valves. These series are two-way, threeway, and four-way solenoid valves that are designed for gang mounting into different quantities of valves. Any combination of normally closed, normally open, or universal valves may be grouped together. These series are standard solenoid valves whose pipe connections and mounting configurations have been replaced by mounting configuration that allows each valve to be mounted directly to an actuator without the use of hard piping or tubing. (5) Manifolds. Manifolds are fluid distribution devices. They range from simple supply chambers with several outlets to multichambered flow control units including integral valves and interfaces to electronic networks. Manifolds are generally configured for several outlets sharing one inlet or supply chamber; exhaust manifolds can have several inlets sharing one exhaust port. They may have one or more shared supply chambers and any number of outlets. The manifold circuit style can be series or parallel. In a series manifold the pressure supply is ported through one valve to get to the next. In a parallel manifold the inlet ports all share common pressure supply. Valve specifications to consider for manifolds include integral manifold valves, integral valve types, and solenoid valve power input. Integral valves are integrally assembled with manifold, as opposed to a base or subplate to which separate valves are attached. Integral valve choice types include manual, solenoid, and air pilot. Manual valves are manually adjusted or actuated via knob, lever, or other manual device. 1.3.3.3 Technical Specifications Solenoid valves are composed of several parts such as the solenoid coil, electrical connector, bonnet nut, seal cartridge, O-rings, end connector, body, and union nut. All these components are critical to the overall Zhang_Ch01.indd 171 5/13/2008 5:45:50 PM 172 INDUSTRIAL CONTROL TECHNOLOGY performance of solenoid valves. If there is any malfunction, it will affect the entire operation of the automotive starter system, as well as the industrial air hammer and the electric bell assembly. That is why solenoid valves should always be maintained and regularly checked in order to keep them functioning at their best. Performance specifications for solenoid valve connectors include connection voltage, nominal power, jacket material, conductor size, insulation group, clamping voltage, bend radius. Captive screw solenoid valve connectors prevent the attachment screw from being lost. Low-profile solenoid valve connectors and right angle solenoid valve connectors allow for installation in tight spaces. Options for solenoid valve connectors include indicator lights and surge suppression. Solenoid valve connectors can also be part of a molded assembly, which saves installation time. Solenoid valve connectors vary in terms of applications and approvals. Some products are suitable for applications such as steam, air, gas, water, pure water, light oil, heavy oil, or hightemperature fluids. Others are designed for cryogenics or corrosive fluids. Complex pneumatic and hydraulic circuits can utilize manifolds with interfaces to sophisticated electronic networks. Applications, port specifications, flow and pressure specifications, manifold circuit style, and valve specifications are all important parameters to consider when searching for manifolds. Additional specifications to consider for manifolds include communication network, body materials, features, and operating temperature. Common applications for manifolds include general purpose, gas, pneumatic or compressed air, pneumatic or vacuum, water, steam, marine, coolant, refrigerant, cryogenic, high temperature, hydraulic fluid, oil or fuel, slurry, high viscosity, general chemical, corrosive or solvent chemical, sanitary, food processing, and medical or pharmaceutical. Important port specifications to consider when searching for manifolds include supply ports, outlet ports, and port types. Supply ports are the number of independent fluid supplies that can be interfaced with the manifold. Outlet ports specify the number of outlets. This is frequently specified as number of ports or valves that are or can be attached to the manifold. Port type choices include quickly connect and metric thread. Flow and pressure specifications are important to consider; when selecting manifolds include maximum flow for gas or air, maximum flow for liquid, and maximum pressure. 1.3.4 Float Valves Float control systems monitoring the liquid or powder levels of containers such as tanks and reservoirs are installed with two kinds of sensors: Zhang_Ch01.indd 172 5/13/2008 5:45:50 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 173 float switches and float valves. In a float control system, float switches are used to detect liquid or powder levels, or interfaces between liquids; float valves control the liquid or powder level in elevated tanks, standpipes, or storage reservoirs and modulate the reservoir flow to maintain a constant level. Figure 1.54 is an assumed float control system monitoring the liquid level of a high-temperature or high-pressure tank with both float switches and float valves. Three switches are located along the right side of this tank to detect three different levels of liquid by turning on either alarms or signals once the liquid reaches them, respectively. The two valves set at the top and bottom of this tank are used to input or output the liquid according to the control requirements to maintain the appropriate levels in this tank. 1.3.4.1 Operating Principle Float control systems require both float switches and float valves to accomplish their functions. Figure 1.55(a) is the diagram of a sample float switch, and Fig. 1.55(b) is the diagram of a sample float valve. (1) Float switch. (Fig. 1.55(a)) Float switches can be used either as alarm devices or as control switches, turning something ON or OFF, such as a pump, or sending a signal to a valve actuator. What makes level switches special is that they have a switched Emergency cut out High temperature or high pressure tank High level Low level Figure 1.54 An assumed float control system for a tank installed with three float switches along the right side and two float valves at the top and the bottom. Zhang_Ch01.indd 173 5/13/2008 5:45:50 PM 174 INDUSTRIAL CONTROL TECHNOLOGY Inner chamber Outer chamber Magnet Reed switch and wiring Rod Approx. level Float pilot Float Fingertrip controller (a) (b) Figure 1.55 (a) A float switch and (b) a float valve. output and can be either electromechanical or solid state, either normally open or normally closed. Float switches provide industrial control for motors that pump liquids from a sump or into a tank. For the tank operation, a float operator assembly is attached to the float switch by a rod, chain, or cable. The float switch is actuated based on the location of the float in the liquid. The float switch contacts are open when the float forces the operating lever to the Up position. As the liquid level falls, the float and operating lever move downward. The contacts can directly activate a motor or provide input for a logic system to fill the tank. As the liquid level rises, the float and operating lever move upward. When the float reaches a preset high level, the float switch contacts open, deactivating the circuit and stopping the motor. However, sump operation is exactly the opposite of tank operation. (2) Float valve. (Fig. 1.55(b)) A float valve is mounted on the tank or reservoir inlet, below or above the requested water level. The float pilot can either be assembled on the main valve (for abovelevel installation) or be connected to the main valve by a command tube. The valve closes when the water level rises by filter discharge pressure acting with the tension spring on the top of the diaphragm in the valve cover chamber, thus raising the float to its closed position. It opens when the float descends due to a Zhang_Ch01.indd 174 5/13/2008 5:45:50 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 175 drop in water level by filter discharge pressure acting under the valve disk. The difference between maximum and minimum levels is very small and is affected by the length of the float pilot arm. In practice, the water level is maintained continuously at the maximum point as long as the upstream flow exceeds the downstream flow. 1.3.4.2 Specifications and Application Guide The typical options for poles and throws are available. Most float switches and valves have either one or two poles or one or two throws, but some manufacturers will produce custom level switches for specifications. The measuring range is probably the most important specification to examine when choosing switches and valves. Also of critical concern are the ratings for current and voltage the switches require. Depending on the needs of the application, float switches and valves can be mounted different ways. These switches and valves can be mounted on the top, bottom, or side of the container holding the substance to be measured. Among the technologies for measuring level is air bubbler technology, capacitive or RF admittance, differential pressure, electrical conductivity or receptivity, mechanical or magnetic floats, optical units, pressure membrane, radar or microwave, radio frequency, rotation paddle, ultrasonic or sonic, and vibration or tuning fork technology. Analog outputs from level switches can be current or voltage signals. Also possible is a pulse or frequency. Computer signal outputs that are possible are usually serial or parallel. Float switches and valves can have displays that are analog, digital, or video displays. Control for the devices can be analog with switches, dials, and potentiometers; digital with menus, keypads, and buttons; or controlled by a computer. Some features that can make float switches and valves more desirable are being programmable, having controller, recorder, or totalizer functions and a built-in alarm indicator, whether audible or visible. Also important for some applications are sanitary ratings and the ability to handle slurries with suspended solids, such as wastewater or sewage. 1.3.4.3 Calibration Many calibration laboratories are finding themselves facing more stringent accuracy requirements. Local gravity, the effects of air buoyancy on the piston gauge, and masses and temperature all affect the accuracy of the Zhang_Ch01.indd 175 5/13/2008 5:45:51 PM 176 INDUSTRIAL CONTROL TECHNOLOGY results as well as the uncertainty of the pressure being generated and should be calibrated or measured. The error may in fact be greater—in some cases much greater—than anticipated. The quality of the calibration output is dependent on the skill and knowledge of the operator. A digital transfer standard can improve accuracy in these cases, because it does not generate pressure and is not affected by local gravity, the effects of air buoyancy, or the age and condition of masses. If a high-accuracy digital transfer standard is used, these error sources are not present. The pressure generated for the calibration is more likely closer to the true pressure, resulting in better calibration. Automated digital transfer standards deliver equal or higher precision than that provided by many industrial dead-weight gauges. The precision of digital transfer standards usually ranges from 0.01% F.S. (Frequency Series or Fourier series) to 0.003% F.S., with total accuracies depending on the calibration standard used. The total accuracy of the digital transfer standard includes the accuracy of the primary standard used to calibrate it. Interfaces to PCs can be either through calibration software and gauge monitoring devices, or through the PC interfaces found in digital transfer standards. The interfaces to PCs dramatically improve the timeliness of reports and simplify the reporting process. Templates created in offthe-shelf word-processing or spreadsheet programs and accessed by calibration systems can include organization logos, addresses and contact information, and calibration standard information (e.g., the pressure range and the serial number and other identifying information for the the device under test). Data from calibrations can be automatically incorporated into the template files. This process allows managers to report as-found/as-left data and a host of other parameters and then save the files for retrieval later. A calibration sequence (a set of pressure points) is sent to the Model 2492 either via the IEEE 488 interface using a remote computer interface or locally via the system keyboard. The system’s microprocessor calculates the masses required generating a requested pressure, automatically correcting for environmental factors (e.g., local gravity, air density, head pressure, and temperature). The automated mass loading system selects and loads the amount of mass needed to generate the desired pressure. Once the masses are loaded, a self-recharging pump pressurizes the system to float the masses. When the masses reach the proper float position, the pump is turned off to ensure that a static pressure condition is met. Float position indicator and resistance temperature devices evaluate float position, sink rate, and temperature in determining a valid float condition. When conditions are met, the system signals the user (or host PC in remote operations), and the balance is maintained until a new command is entered. Zhang_Ch01.indd 176 5/13/2008 5:45:51 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 177 If desired, the remote host computer can automatically acquire data from the device under test without an operator present. 1.3.5 Flow Valves Measuring the flow of liquids and gases is a critical need in many industrial productions such as chemical packaging, wastewater treatments, and aircraft manufacturing. In some industrial operations, the ability to conduct accurate flow measurements is so important that it can make the difference between making a profit and taking a loss. In other cases, failure in flow control can cause serious (or even disastrous) results. Flow control systems are designed specifically for operation with a wide range of liquids and gases in both safe and hazardous areas, in hygienic, high-temperature, and high-pressure environments, and for use with aggressive media. Some applications for this purpose are pump protection, cooling circuit protection, high and low flow rate alarm, general flow monitoring, etc. 1.3.5.1 Operating Principle The technologies for gas flow meters and liquid flow meters vary widely. The most common types of operation principles are inferential flow measurement, positive displacement measurement, velocity measurement, true mass flow measurement, and thermodynamic loss measurement. The main types of operating principles for gas flow meters and liquid flow meters are given below: (1) Gas flow switches and liquid flow switches, velocity. Gas flow switches and liquid flow switches, velocity, are used to measure the flow or quantity of a moving fluid in terms of velocity, such as feet per minute. The most common types are inferential flow measurement, positive displacement, velocity meters, and true mass flow meters. Inferential measurement refers to the indirect measurement of flow by directly measuring another value and inferring the flow based on well-known relationships between the directly measured value and flow. The use of differential pressure as an inferred measurement of a liquid’s rate of flow is the most common type of unit in use today. Positive displacement meters take direct measurements of liquid flows. These devices divide the fluid into specific increments and move it on. The total flow is an accumulation of the measured increments, which can be counted by mechanical or electronic techniques. They are often used for high-viscosity fluids. Zhang_Ch01.indd 177 5/13/2008 5:45:51 PM 178 INDUSTRIAL CONTROL TECHNOLOGY Velocity-type gas flow switches and liquid flow switches are devices that operate linearly with respect to volume flow rate. Because there is no square-root relationship, as with differential pressure devices, their range ability is greater. (2) Liquid flow switches and gas flow switches, mass. Liquid flow switches and gas flow switches, mass, are devices used for measuring the flow or quantity of a moving liquid or gas, respectively, in terms of unit of mass per unit time, such as pounds per minute. These may be sensors with electrical output or may be standalone instruments with local displays and controls. The most common types of liquid flow switches and gas flow switches, mass, are true mass flow meters. True mass flow meters are devices that measure mass rate of flow directly, such as thermal meters or Carioles meters. The most important specifications for mass gas flow meters and liquid flow meters and sensors are the flow range to be measured and whether liquids or gases will be the measured fluids. Also important are operating pressure, the fluid temperature, and accuracy. Typical electrical outputs for mass gas flow meters and liquid flow meters are analog current, voltage, frequency, or switched output. Computer output options can include serial and parallel interfaces. These sensors can be mounted either as inline or insertion devices. Inline sensors can be held in place by using flanges, threaded connections, or clamps. Insertion style sensors are typically threaded through a pipe wall and stick directly in the process flow. (3) Gas flow switches and liquid flow switches, volumetric. Gas flow switches, volumetric, provide output based on the measured flow of a moving gas in terms of volume per unit time, such as cubic feet per minute. Liquid flow switches, volumetric, are devices with a switch output used for measuring the flow or quantity of a moving fluid in terms of a unit of volume per unit time, such as liters per minute. The basis of volumetric gas flow switch and liquid flow switch selection is a clear understanding of the requirements of the particular application. With most liquid flow measurement instruments, the flow rate is determined inferentially by measuring the liquid’s velocity or the change in kinetic energy. Velocity depends on the pressure differential that is forcing the liquid through a pipe or conduit. Because the pipe’s cross-sectional area is known and remains constant, the average velocity is an indication of the flow rate. The basic relationship for determining the liquid’s flow rate in such cases is Q = V × A, where Q is the liquid flow through Zhang_Ch01.indd 178 5/13/2008 5:45:51 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 179 a pipe, V is the average velocity of the flow, and A is the crosssectional area of the pipe. Other factors that affect liquid flow rate include the liquid’s viscosity and density. Specific applications should be discussed with a volumetric gas flow switch manufacturer before purchasing to ensure proper fit, form, and function. Both volumetric gas flow switches and volumetric liquid flow switches are available with four different meter types: inferential flow meters, positive displacement meters, velocity meters, and true mass flow meters. The basic operating principle of differential pressure flow meters is that the pressure drop across the meter is proportional to the square of the flow rate. The flow rate is obtained by measuring the pressure differential and extracting the square root. Direct measurements of liquid flows can be made with positive-displacement flow meters. These devices divide the liquid into specific increments and move it on. The total flow is an accumulation of the measured increments, which can be counted by mechanical or electronic techniques. They are often used for high-viscosity fluids. (4) Pneumatic relays. Pneumatic relays control output air flow and pressure in response to a pneumatic input signal. They can perform simple functions such as boosting or scaling the output, or complex reversal, biasing, and math function operators. 1.3.5.2 Specifications and Application Guide The most common specifications for flow control systems can be pressure drop, system efficiency, and process modifications. (1) Pressure drop. Pressure drop is defined by the following items: (a) Reduce piping system pressure loss by increasing the line size and rerouting the pipes. (b) Optimize process equipment pressure loss in the flow lines. (c) Reduce or eliminate control valve pressure loss. (2) System efficiency. System efficiency includes the following operations: (a) Operate rotating equipment at or close to its best efficiency point. (b) Split a single system into more than one to achieve higher aggregate O and M efficiency. (c) Downsize the pump (or trim impeller or modify compressor wheels) and motors. This is only an end result of system improvement or optimization. Zhang_Ch01.indd 179 5/13/2008 5:45:51 PM 180 INDUSTRIAL CONTROL TECHNOLOGY (d) Modify a process control scheme, including loading and unloading and spillback controls on positive displacement compressors, and location of throttling control. (e) Install variable frequency drives (VFD)—investigate needs and implications carefully. The variable frequency drive is not always the best solution! (f) Improve operating efficiency by implementing an energy recovery strategy. For example, the recovery heat of compression from heating a building or from replacing low pressure steam heating. (g) Replace standard efficiency motors with premium efficiency motors. (3) Process modifications. Process modifications include the following items: (a) Lower the delivery pressure (without impacting process requirement) at user(s). (b) Lower the pressure profile of the system. (c) Incorporate an advanced process control scheme and algorithm to eliminate operator intervention. (d) Reroute or resequence the process streams. (e) Reduce the compressor inlet temperature. (f) Regenerate or replace catalyst (same for inline filters) to eliminate an excessive pressure drop due to carbon build-up. (g) Reduce or eliminate the minimum flow bypass recirculation flow. 1.3.5.3 Calibration The calibration of a flow control system is facilitated with the following equipments: (1) Gas flow calibrator. The gas flow calibrator (GFC) is an automated, sonic nozzle, scalable, state-of-the-art test system providing exceptional metrology for all gas metering technologies. The customizable, turnkey system includes hardware, software, and accessories, and supports testing on different meter types at pressures ranging from atmospheric to over 100 psig with closed loop control. (2) Flow controller. The flow controller (FC) was the first commercially available flow computer that accommodates combinations of sonic nozzles configured in a multiple sonic nozzle array. This unique functionality allows the flow controller to act as a standalone flow controller. The flow controller can interface with a single sonic nozzle and/or subsonic Venturi, or up to several sonic nozzles, thus offering a ratio range in flow. Zhang_Ch01.indd 180 5/13/2008 5:45:51 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 181 (3) Sonic nozzles. The sonic nozzle, also known as a “critical flow Venturi” or “critical flow nozzle” has rapidly gained acceptance as a flow measurement standard and flow meter. Sonic nozzles are now utilized in many diverse applications by the aerospace, automotive, energy, and metrology industries. Sonic nozzles can be used as a calibration standard for gas flow meters or any flow measurement device. By design, sonic nozzles are a constant volumetric flow meter. However, with the use of a regulated pressure supply, the sonic nozzle becomes a state-of-the-art mass flow meter. (4) Flow computer. Flow computers work with a single sonic nozzle and/or subsonic Venturi and can also accommodate combinations of sonic nozzles configured in a multiple sonic nozzle array. With the increasing popularity of using multiple, binary throat areas, sonic nozzles installed in a common inlet plenum. Flow Systems introduces the flow computer to meet the challenges of this application. Flow computers are able to interface with single, interchangeable, sonic nozzles and/or subsonic Venturis, or up to some sonic nozzles in a multiple sonic nozzle array. This unique solution (hardware and software) combines instrumentation, data acquisition and control, computation, monitoring, and data logging to meet the needs of the high-end flow measurement user. Bibliography AccesIO (http://www.accesio.com). 2000. http://www.accesio.com/manuals/lvdt-8 .pdf. Accessed date: April 2005. Alibaba (http://www.alibaba.com). 2005. http://www.alibaba.com/productsearch/ Ultrasonic_Distance_Meter.html. Accessed date: April. AQUATIC (http://www.aquaticeco.com). 2005. http://www.aquaticeco.com/index .cfm/fuseaction/listings.categories/ssid/353. Accessed date: May. Asahi-America (http://asahi-america.com). 2005a. http://asahi-america.com/ documents/documents/Pneumatic%20Actuator%20Intro.pdf. Accessed date: May. Automation Direct (http://web5.automationdirect.com). 2005. http://web5 .automationdirect.com/adc/Overview/Catalog/Sensors_-z-_Encoders/ Ultrasonic_Sensors. Accessed date: April. BEAMEX (http://www.beamex.com). 2005. http://www.beamex.com/services/ services.html. Accessed date: May. Calibrator Depot (http://www.calibratordepot.com). 2005. Calibrators and Calibration Services. http://www.calibratordepot.com/index.asp. Accessed date: June. Carl T. Lira (lira@egr.msu.edu). 2001. Check Valve and Pump Description. http:// www.egr.msu.edu/~lira/supp/Check Valves and Pumps.mht. Accessed date: September 2007. Zhang_Ch01.indd 181 5/13/2008 5:45:51 PM 182 INDUSTRIAL CONTROL TECHNOLOGY Chris Warnett (Rotork Controls Inc.). 2004. A descriptive definition of valve actuators. http://www.valve-world.net/actuation/ShowPage.aspx?pageID=557. Accessed date: September 2007. COMPACT (http://www.compact4.com). 2005a. http://www.compact4.com/ technical.html. Accessed date: May. Crane Valve (http://www.cranevalve.com/index.htm). 2007. Electric Actuators. http://www.cranevalve.com/Act_Elec.htm. Accessed date: September. DALSA (http://www.dalsa.com). 2005a. http://www.dalsa.com/markets/ccd_vs_ cmos.asp. Accessed date: April. Direct Industry (http://www.directindustry.com). 2005a. http://www.directindustry .com/industrial-manufacturer/magnetic-sensor-70932.html. Accessed date: April. Direct Industry (http://www.directindustry.com). 2005b. http://www.directindustry .com/industrial-manufacturer/magnetic-switch-72332.html. Accessed date: April. Direct Industry (http://www.directindustry.com). 2005c. http://www.directindustry .com/industrial-manufacturer/hall-effect-sensor-71708.html. Accessed date: April. Direct Industry (http://www.directindustry.com). 2005d. http://www.directindustry .com/industrial-manufacturer/reed-switch-74782.html. Accessed date: April. DMN Digital (http://www.digitalmedianet.com). 2005. http://cad.digitalmedianet .com/articles/viewarticle.jsp?id=25291. Accessed date: April. EFLOTS-INFO (http://efloatswitch.info/). 2005. Accessed date: May. EMERSON (http://www.emersonprocess.com). 2005a. http://www.documentation .emersonprocess.com/groups/public/documents/book/cvh99.pdf. Accessed date: May. EMERSON (http://www.emersonprocess.com). 2005b. http://www.emersonprocess .com/valveautomation/bettis/Downloads/Hydraulic_Manuals.htm. Accessed date: May. FineMech (http://www.finemech.com). 2005. http://www.finemech.com/ Sensors%20category%202.shtml?gclid=COuHoPvhsosCFQPilAodU1qWvw. Accessed date: April. Forbes Marshall Inc. (http://www.forbesmarshall-inc.com). 2007. Pneumatic Actuator Manual. http://www.forbesmarshall-inc.com/ProductPage .asp?ProdGrpId=29&ProdId=79. Accessed date: September. Fraunhofer-ILT (http://www.ilt.fraunhofer.de). 2005. http://www.ilt.fraunhofer.de/ eng/ilt/pdf/eng/products/HZ_LTS-2D.pdf. Accessed date: December. Free Study (http://www.freestudy.co.uk). 2005a. http://www.freestudy.co.uk/ control/t2.pdf. Accessed date: May. GlobalSpec (http://www.globalspec.com). 2005a. http://sensors-transducers .globalspec.com/SpecSearch/Suppliers?QID = 8900153 & Comp = 106 . Accessed date: April. GlobalSpec (http://www.globalspec.com). 2005b. http://search.globalspec.com/ productfinder/findproducts?query=color%20sensor. Accessed date: April. GlobalSpec (http://www.globalspec.com). 2005c. http://search.globalspec.com/ productfinder/findproducts?query = Ultrasonic%20distance%20sensors . Accessed date: April. GlobalSpec (http://www.globalspec.com). 2005d. http://sensors-transducers .globalspec.com/LearnMore/Sensors_Transducers_Detectors/Linear_ Position_Sensing/LVDT_Position_Sensors. Accessed date: April. Zhang_Ch01.indd 182 5/13/2008 5:45:51 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 183 GlobalSpec (http://www.globalspec.com). 2005e. http://sensors-transducers .globalspec.com/LearnMore/Sensors_Transducers_Detectors/Rotary_ Position_Sensing/Rotary_Position_Sensors. Accessed date: April. GlobalSpec (http://www.globalspec.com). 2005f. http://search.globalspec.com/ Search?query=hydraulic&show=total. Accessed date: May. GlobalSpec (http://www.globalspec.com). 2005g. http://flow-control.globalspec .com/Specifications/Flow_Transfer_Control/Valve_Actuators_Positioners/ Electric_Electronic_Motor_Actuators. Accessed date: June. GlobalSpec (http://www.globalspec.com). 2005h. http://flow-control.globalspec .com/LearnMore/Flow_Control_Flow_Transfer/Valves/Check_Valves . Accessed date: June. Grainger (http://www.grainger.com). 2005. http://www.grainger.com/production/ info/limit-switch.htm. Accessed date: April. Hamamatsu (http://www.sales.hamamatsu.com). 2005. http://www.sales.hamamatsu .com/en/products/solid-state-division/color_sensors.php. Accessed date: April. HASCO (http://www.hascorelays.com). 2003. http://www.hascorelays.com/reed_ switches.asp. Accessed date: April 2005. Honey Well (http://hpsweb.honeywell.com). 2005a. http://hpsweb.honeywell.com/ Cultures/en-US/IndustrySolutions/PulpPaperPrinting/PaperMeasurement/ ColourMeasurement/default.htm. Accessed date: April. Honey Well (http://hpsweb.honeywell.com). 2005b. http://content.honeywell.com/ sensing/prodinfo/solidstate/technical/chapter2.pdf. Accessed date: April. Honey Well (http://hpsweb.honeywell.com). 2005c. http://www.ssec.honeywell .com/magnetic/datasheets/sae.pdf. Accessed date: April. Honey Well (http://hpsweb.honeywell.com). 2005d. http://sensing.honeywell.com/. Accessed date: April. Honey Well (http://hpsweb.honeywell.com). 2005e. http://www.honeywell.com .pl/pdf/automatyka_domow/palniki_do_kotlow/golden/Silowniki/V4062.pdf. Accessed date: April. Hydraulic-Tutorial (http://www.hydraulicsupermarket.com). 2005a. http://www .hydraulicsupermarket.com/technical.html. Accessed date: May. IQS Directory (http://www.iqsdirectory.com). 2007. Actuators. http://www .iqsdirectory.com/actuators/. Accessed date: September. Johnson Controls, Inc. 1997. Product/Technical Bulletin for VA-7200 Electric Valve Actuator. KEYENCE-America (http://www.keyance.com). 2005. http://www.keyence.com/ products/sensors/rgb/rgb.php. Accessed date: April. KIP Inc. (http://www.kipinc.com). 2005. Solenoid Valves. http://www.norgren .com/kip/. Accessed date: June. LESLIECONTROLS (http://www.lesliecontrols.com). 2005. http://www .lesliecontrols.com/Handbooks/Handbooks.html. Accessed date: May. Leuze Electronics (http://www.leuze.de). 2003. http://www.leuze.de/downloads/ los/03/brusds_e.pdf. Accessed date: April of 2005. Liteon-Semi (http://www.liteon-semi.com). 2005. http://www.liteon-semi.com/_ en/02_cis/00_overview.php. Accessed date: May. Lvdt.co.uk (http://www.lvdt.co.uk). 2005a. http://www.lvdt.co.uk/howtheywork .html. Accessed date: April. Lvdt.co.uk (http://www.lvdt.co.uk). 2005b. http://www.lvdt.co.uk/selection.html. Accessed date: April. Zhang_Ch01.indd 183 5/13/2008 5:45:51 PM 184 INDUSTRIAL CONTROL TECHNOLOGY Machine Design (http://www.machinedesign.com). 2003. http://www.machinedesign .com/Switch Tips Bimetallic switches.mht. Accessed date: February 2005. Machine Design (http://www.machinedesign.com). 2005a. http://productsearch .machinedesign.com/browse/Motion_Controls/Limit_Switches. Accessed date: April. Machine Design (http://www.machinedesign.com). 2005b. http://productsearch .machinedesign.com/browse/Motion_Controls/Linear_Rotary_Motion_ Components. Accessed date: May. Macro Sensors (http://www.macrosensors.com). 2005a. http://www.macrosensors .com/lvdt_macro_sensors/lvdt_tutorial/why_use_lvdt.html. Accessed date: April. Macro Sensors (http://www.macrosensors.com). 2005b. http://www.macrosensors .com/ms-lvdt_faq-tutorial.html. Accessed date: April. Maintenance-World (http://www.maintenanceworld.com). 2005. http://www .maintenanceworld.com/Articles/wmaorg/Valve.pdf. Accessed date: May. Making Things (http://www.makingthings.com). 2005. http://www.makingthings .com/teleo/products/acc_datasheets/acc_usd_001.htm. Accessed date: April. Metra Mess- und Frequenztechnik (http://www.mmf.de). 2005. Piezoelectric Accuracy and Calibration. http://www.mmf.de/introduction.htm. Accessed date: June. Microchip (http://www.microchip.com). 2005. http://ww1.microchip.com/ downloads/en/DeviceDoc/39757a.pdf. Accessed date: May. Migatron (http://www.migatron.com). 2005. http://www.migatron.com/ understanding_ultrasonics.htm. Accessed date: April. MORGAN (http://www.morganelectroceramics.com). 2005. http://www.morgan electroceramics.com/tutorials/piezoguide1.html. Accessed date: May. NewArk (http://www.newark.com). 2005. http://www.newark.com/pdfs/techarticles/ pepperl.pdf. Accesses date: April. NEWPORT (http://www.newport.com). 2005. http://www.newport.com/ Manual-Actuator-Selection-Guide/168530/1033/catalog.aspx. Accessed date: May. NI (http://zone.ni.com). 2005. http://zone.ni.com/devzone/cda/tut/p/id/3602. Accessed date: May. Nook Industries (http;//www.nookindustries.com). 2004. http://www.nookindustries .com/pdf/CylinderLimitSwitch.pdf. Accessed date: April 2005. NPL (http://www.npl.co.uk). 2005. http://www.npl.co.uk/pressure/guidance/ nonprescals.html. Accessed date: May. OMEGA (http://www.omega.com). 2005a. http://www.omega.com/techref/pdf/ STRAIN_GAGE_TECHNICAL_DATA.pdf. Accessed date: May. OMEGA (http://www.omega.com). 2005b. http://www.omega.com/techref/ flowmetertutorial.html. Accessed date: May. OMEGA (http://www.omega.com). 2005c. http://www.omega.com/techref/ techprinc.html. Accessed date: May. OMRON (http://www.omoron.com). 2005a. http://www.simcotech.com/sensors/ omronrgb.pdf. Accessed date: April. OMRON (http://www.omron.com). 2005b. http://www.mikrokontrol.co.yu/katalog/ datasheets/senzori/foto/e3mc.pdf. Accessed date: April. OMRON (http://www.omron.com). 2005c. http://www.sti.com/switches/swdatash .htm. Accessed date: April. Zhang_Ch01.indd 184 5/13/2008 5:45:51 PM 1: SENSORS AND ACTUATORS FOR INDUSTRIAL CONTROL 185 PAControl (http://electricalequipment.pacontrol.com). 2005a. http://electricalequip ment.pacontrol.com/proximitysensors.html. Accessed date: April. PAControl (http://electricalequipment.pacontrol.com). 2005b. http://electricalequip ment.pacontrol.com/capacitiveproximitysensors.html. Accessed date: April. PAControl (http://electricalequipment.pacontrol.com). 2005c. http://electricalequip ment.pacontrol.com/inductiveproximitysensors.html. Accessed date: April. PAControl (http://electricalequipment.pacontrol.com). 2005d. http://electricalequip ment.pacontrol.com/magneticproximitysensors.html. Accessed date: April. PCB PIEZOTRONICS (http://www.pcb.com). 2005. Mounting_force_sensors.pdf. Accessed date: June. PEPPERL+FUCHS (http://www.am.pepperl-fuchs.com). 2005a. http://www.am .pepperl-fuchs.com/products/productfamily.jsp?division=FA&productfamily_ id=1455. Accessed date: April. PEPPERL+FUCHS (http://www.am.pepperl-fuchs.com). 2005b. http://www.am .pepperl-fuchs.com/products/productfamily.jsp?division=FA&productfamily_ id=1575. Accessed date: April. PHILIPS. 2000. http://www.nxp.com/acrobat_download/various/SC17_GENERAL_ MAG_2-1.pdf. Accessed date: April 2005. Physics-psu.edu. 2004. http://class.phys.psu.edu/p457/experiments/html/hall_ effect_2004.htm. Accessed date: April 2005. PI (http://www.physikinstrumente.com). 2005. http://www.physikinstrumente .com/en/products/piezo_tutorial.php. Accessed date: May. PIEZO (http://www.piezo.com). 2005. http://www.piezo.com/tech2intropiezotrans .html. Accessed date: May. Plant-Maintenance (http://www.plant-maintenance.com). 2005. http://www .plant-maintenance.com/maintenance_articles_valves.shtml. Accessed date: May. Red Soft (http://www.redsofts.com). 2005a. http://www.redsofts.com/articles/ read/386/70578/Electric_Linear_Actuators_The_Rotary_Motion_Producer .html. Accessed date: May. Red Valve (http://www.redvalve.com). 2005. http://www.redvalve.com/control.html. Accessed date: May. Rheodyne Corporation (http://www.rheodyne.com). 2007. Operating Instruction for Pneumatic Actuators. http://www.rheodyne.com/support/product/instructions/. Accessed date: September. Robotica (http://www.robotica.co.uk). 2005. http://www.robotica.co.uk/robotica/ ramc/products/sensors/ultra_sensor.htm. Accessed date: April. SENSORS (http://www.sensorsmag.com). 2005a. http://www.sensorsmag.com/ articles/1298/mag1298/main.shtml. Accessed date: April. SENSORS (http://www.sensorsmag.com). 2005b. http://www.sensorsmag.com/ sensors/article/articleDetail.jsp?id=179165. Accessed date: May. Short Courses (http://www.shortcourses.com). 2005. http://www.shortcourses .com/choosing/sensors/05.htm. Accessed date: April. SICK (http://www.sick.com). 2005a. http://www.sick.com/home/factory/catalogues/ industrial/coloursensors/en.html. Accessed date: April. SICK (http://www.sick.com). 2005b. http://englisch.meyle.de/contract_partner/ sick_magnetic_proximity_sensors.php. Accessed date: April. SIEMENS (http://www.sbt.siemens.com). 2005. Actuators and Valves. http://www .sbt.siemens.com/hvp/components/products/damperactuators/default.asp. Accessed date: June. Zhang_Ch01.indd 185 5/13/2008 5:45:52 PM 186 INDUSTRIAL CONTROL TECHNOLOGY SONY (http://www.sony.com). 2005. http://www.docs.sony.com/release/ GDMC520Kguide.pdf. Accessed date: April. SukHamburg (http://www.SukHamburg.de). 2005. http://www.silicon-software .de/download/archive/Laser_Light_Section_e.pdf. Accessed date: December. VNE (http://www.vnestainless.com/default.aspx). 2005. Valves. http://www .vnestainless.com/default.aspx. Accessed date: September 2007. WATTS (http://www.watts.com). 2005. http://www.watts.com/pro/_products_sub .asp?catId=69&parCat=125. Accessed date: May. Young (http://www.youngcalibration.co.uk). 2005. http://www.youngcalibration .co.uk/calibration.htm?gclid=CMSGqLDX9IsCFQ7dlAodBHewVQ. Accessed date: May. Z-Tide Valves (http://www.z-tide.com.tw). 2005. Valves. http://www.z-tide.com.tw/ multi/index-e.htm. Accessed date: June. Zhang_Ch01.indd 186 5/13/2008 5:45:52 PM 2 Computer Hardware for Industrial Control 2.1 Microprocessor Unit Chipset The microprocessor within personal computers and industrial controllers has evolved continuously, with each newer version being compatible with the previous ones. The major producer of microprocessors has been Intel Corporation (Intel is a contraction of Integrated Electronics) since the early 1970s. Intel marketed the first microprocessor in 1971, named the 4004, which caused a revolution in the electronics industry. With this processor, the functionality started to be programmed by software. However, it could only handle 4 bits of data at a time (a nibble), contained 2000 transistors, had 46 instructions, and allowed 4 kB of program code and 1 kB of data. However, from this, personal computers and industrial controllers have evolved with the use of Intel microprocessors. (1) First generation. The next generation of Intel microprocessors arrived in 1974, which could handle 8 bits (a byte) of data at a time and were named the 8008, 8080, and 8085. The 8008 had a 14-bit address bus and can thus address up to 16 kB of memory; the 8080 had a 16-bit address bus giving it a 64 kB limit. (2) Second generation. The next generation came with the launch of the 16-bit processors. Intel released the 8086 microprocessor, which was mainly an extension to the original 8080 processor, and thus retained a degree of software compatibility. It had a 16-bit data bus and a 20-bit address bus, and thus had a maximum addressable capacity of 1 MB. The 8086 could handle either 8 or 16 bits of data at a time, although in a messy way. A strippeddown, 8-bit external data bus version called as the 8088 was also available. This stripped-down processor allowed designers to produce less complicated systems. An improved architecture version, the 80286, was launched in 1982 and was used in the IBM Advanced Technology. (3) Third generation. In 1985, Intel introduced its first 32-bit microprocessor, the 80386DX. This device was compatible with the previous 8088/8086/80286 (80x86) processors and gave excellent performance, handling 8, 16, or 32 bits at a time. It had full 32-bit data and address buses and could thus address up to 4 GB of physical memory. A stripped-down 16-bit external data bus 187 Zhang_Ch02.indd 187 5/13/2008 5:53:42 PM 188 INDUSTRIAL CONTROL TECHNOLOGY and 24-bit address bus version called 80386SX was released in 1988, which could only access up to 16 MB of physical memory. (4) Fourth generation. In 1989, Intel introduced the 80486DX, which was basically an improved 80386DX with a memory cache and math coprocessor integrated onto the chip. It had an improved internal structure making it around 50% faster than a compatible 80386. The 80486SX was also introduced, which was merely an 80486DX with the link to the math coprocessor broken. As processor speeds increased, there was a limiting factor for the system clock speed, thus the system clock was doubled or tripled to produce the processor clock. Typically, a system with clock double processors is around 75% faster than the compatible nondoubled processors. Intel has also produced a range of 80486 microprocessors, which run at three or four times the system clock speed and are referred to as DX4 processors. These include the Intel DX4-100 and Intel DX4-75, both with a 25 MHz clock. (5) Fifth generation. The Pentium (or P-5) is a 64-bit superscalar processor. It can execute more than one instruction at a time and has a full 64-bit (8-byte) data bus and a 32-bit address bus. In terms of performance, it operates almost twice as fast as the equivalent 80486. It also has improved floating-point operations (roughly three times faster) and is fully compatible with previous 80 × 86 processors. (6) Sixth generation. The Pentium II/III and Pentium Pro (or P-6) are enhancements of the P-5 and have a bus that supports up to four processors without extra supporting logic, with clock multiplying speeds of over 1 GHz. They also have major savings of electrical power and the minimization of electromagnetic interference. There is a great enhancement of the P-6 bus in that it detects and corrects all single-bit data bus errors and also detects multiple bit errors on the data bus. (7) Seventh generation. New features added with the AMD K7 Athlon include (1) ultrahigh clock speeds of over 1 GHz, (2) 128 kB level 1 cache and up to 8 MB for level 2 cache, (3) capability to use and rearrange up to 72 instructions simultaneously, (4) ability to execute up to nine instructions simultaneously. Processors come and go, but most manufacturers know the important differences are often processor clock speeds and cache sizes. The future is likely to involve an increase in real-time audio and video over the Internet. Although the performance of today’s processors continues to improve, existing architectures based on an out-of-order execution model require increasingly complex hardware mechanisms and are impeded increasingly by performance limiters such as branches and memory latency. Some new Zhang_Ch02.indd 188 5/13/2008 5:53:42 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 189 architectures, like IA-64 architecture and x84-64 architecture, are a unique combination of innovative features, including explicit parallelism, prediction, and speculation, which are described below: (1) Parallelism. In today’s processor architectures, the compiler creates sequential machine codes that attempt to imply parallelism to hardware. The processor’s hardware must then reinterpret this machine code and try to identify opportunities for parallel execution, which is the key to higher performance. This process is inefficient not only because the hardware does not always interpret the compiler’s intentions correctly, but also because it uses a valuable die area that could be better used to do real work like executing instructions. Even today’s fastest and most efficient processors devote a significant percentage of hardware resources to this task of extracting more parallelism from software code. The use of explicit parallelism enables far more effective parallel execution of software instructions. In the new architecture models, the compiler analyzes and explicitly identifies parallelism in the software at compile time. This allows the most optimal structuring of the machine code to deliver the maximum performance before the processor executes it, rather than potentially wasting valuable processor cycles at run time. The result is significantly improved processor utilization. Also, there is no wasting of precious die area for the hardware reorder engine used in out-of-order reduced instruction set computer (RISC) processors. (2) Prediction. Simple decision structures, or code branches, are a hard performance challenge to out-of-order RISC architectures. In the simple if-then-else decision code sequence, traditional architectures view the code in four basic blocks. In order to continuously feed instructions into the processor’s instruction pipeline, a technique called branch prediction is commonly used to predict the correct path. With this technique, mispredicts commonly occur 5–10% of the time, causing the entire pipeline to be purged and the correct path to be reloaded. A misprediction rate of just 5–10% can slow processing speed as much as 30–40%. To address this problem and to improve performance, the new architectures use a technique known as prediction. Prediction begins by assigning special flags called predicate registers to both branch paths—p1 to “then” path and p2 to the “else” path. At run time, the compare statement stores either a true or a false value in the 1-bit predicate registers. The processor then executes both paths but only the results from the path with a true predicate flag Zhang_Ch02.indd 189 5/13/2008 5:53:42 PM 190 INDUSTRIAL CONTROL TECHNOLOGY are used. Branches, and the possibility of associated mispredicts, are removed, the pipeline remains full, and performance is increased accordingly. (3) Speculation. Memory latency is another big problem for current processors’ architectures. Because memory speed is significantly slower than processor speed, the processor must attempt to load data from memory as early as possible to ensure that data is available when needed. Traditional architectures allow compilers and processor to schedule loads before data is needed, but branches act as barriers to this load hoisting. These new architectures employ a technique known as “speculation” to initiate loads from memory earlier in the instruction stream, even before a branch. Because a load can generate exceptions, a mechanism to ensure that exceptions are properly handled is needed to support speculation that hoists loads before branches. The memory load is scheduled speculatively above the branch in the instruction stream so as to start the memory access as early as possible. If an exception occurs, this event is stored and the “checks” instruction causes the exception to be processed. The elevation of the load allows more time to account for memory latency, without stalling the processor pipeline. Branches occur with great frequency in common software code sequences. The unique ability of these architectures to schedule loads before branches increases significantly the number of loads that can be speculated relative to traditional architectures. 2.1.1 Microprocessor Unit Organization The microprocessor plays a significant role in the functioning of industries everywhere. Nowadays, the microprocessor is being used in a wide range of devices or systems as a digital data processing unit or a computing unit of an intelligent controller or a computer to control processes or turn ON or OFF devices. The microprocessor is a multipurpose, programmable, clock-driven, register-based electronic device that reads binary instructions from a storage device called memory, accepts binary data as input and process data according to those instructions, and provides results as output. At a very elementary level, an analogy can be drawn between microprocessor operations and the functions of the human brain that process information according to understandings (instructions) stored in its memory. The brain gets input from the eyes and ears and sends processed information to output “devices,” such as the face with its capacity to register expression, the hands, or the feet. Zhang_Ch02.indd 190 5/13/2008 5:53:42 PM 191 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL A typical programmable machine can be represented with five components: microprocessor, memory, input, output, and bus. These five components work together and interact with each other to perform a given task; thus they comprise a system. The physical components are called hardware. A set of instructions written for the microprocessor to perform a task is called a program, and a group of programs is called a software. Assume that a program and data are already entered in the memory; the microprocessor executes a program by reading all the data including instructions from the memory via the bus, and then processing these data in terms of instructions, then writing the result into memory via the bus. 2.1.1.1 Function Block Diagram of a Microprocessor Unit Figure 2.1 depicts the function block diagram of the Intel486 GX processor, which gives the microarchitecture of this Intel processor. Figure 2.2 is the block diagram for the microarchitecture of the Intel Pentium-4 processor. 64-bit interunit transfer bus 32-bit data bus 32-bit data bus 32 Linear address 32 Core clocks 32 PCD,PWT Barrel shifter Base/ index bus Register file 32 Segmentation unit Descriptor registers Decoded Control ROM instruction path Prefetcher Request sequencer 32 byte code queue Burst Bus control 2 × 16 bytes Cache control 32 Instruction decode 24 Data bus transceivers Bus control Displacement bus Control and protection test unit 32 32 Code stream A2-A31 BEO#-BE3# Write buffers 4 × 32 8 kbyte cache 128 Microinstruction CLK Address drivers 32 20 Physical address Translation look aside buffer Limit and attibute PLA ALU Bus interface Cache unit 2 Paging unit Clock control Boundary scan control DO-D31 ADS# W/R# D/C# M/IO# PCD PWT RDY# LOCK# PLOCK# BOFF# A20M# BREQ HOLD HLD ARESET SRE SET INTR NMI SMI# SMIACT# STP CLK# BRDY# BLAST# KEN# FLUSH# AHOLD EADS# TCK TMS TDI TDO Figure 2.1 The function block diagram of the Intel486 GX Processor (courtesy of Intel Corporation). Zhang_Ch02.indd 191 5/13/2008 5:53:42 PM 192 INDUSTRIAL CONTROL TECHNOLOGY Figure 2.2 The function block diagram of the Intel Pentium-4 processor (courtesy of Intel Corporation). 2.1.1.2 Microprocessor The Pentium series of microprocessors made in Intel, up to now, includes the Pentium Pro, the Pentium II, the Pentium III, and the Pentium 4, etc. As given in Fig. 2.3(a), the Pentium Pro consists of the following basic hardware elements: (1) Intel Architecture registers. The Intel Architecture register set implemented in the earlier 80x86 is extremely small. The small number of registers permits the processor (and the programmer) to keep only a small number of data operands close to the execution units where they can access them quickly. Rather, the programmer is frequently forced to write back the contents of one or more of the processor’s registers to memory when he or she needs to read additional data operands from memory to be operated on. Later, when the programmer requires access to the original set of data operands, they must again be read from memory. This juggling of data between the register set and memory takes time and exacts a penalty on the performance of the program. Figure 2.3(b) illustrates the Intel Architecture general register set. (2) External bus unit. This unit performs bus transactions when requested to do so by the L2 cache or the processor core. (3) Backside bus unit. This unit interfaces the processor core to the unified L2 cache. Zhang_Ch02.indd 192 5/13/2008 5:53:42 PM 193 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL Unified L2 cache (SRAM) External bus Backside External bus unit bus Backside bus unit L1 Code cache (SRAM) Branch prediction L1 Data cache (SRAM) Prefetcher APIC bus Local APIC Address bus Data bus Instruction decoder Retire unit Execution unit Instruction pool (a) 31 23 15 8 7 0 EAX AH AX AL EBX BH BX BL ECX CH CX CL EDX DH DX DL EBP BP ESI SI EDI DI ESP SP (b) Figure 2.3 Intel Pentium II processor: (a) simplified processor block diagram, (b) Intel Architecture general register set (courtesy of Intel Corporation). (4) Unified L2 cache. It services misses on the L1 data and code caches. When necessary, it issues requests to the external bus unit. (5) L1 data cache. It services data load and stores requests issued by the load and store execution units. When a miss occurs, it forwards a request to the L2 cache. Zhang_Ch02.indd 193 5/13/2008 5:53:43 PM 194 INDUSTRIAL CONTROL TECHNOLOGY (6) L1 code cache. It services instruction fetch requests issued by the instruction prefetcher. (7) Processor core. The processor logic is responsible for the following: (1) instruction fetch, (2) branch prediction, (3) parsing of Intel Architecture instruction stream, (4) decoding of Intel Architecture instructions into RISC instructions that are referred to as microops or uops, (5) mapping accesses for Intel Architecture register set to a large physical register set, (6) dispatch, execution, and retirement of micro-ops. (8) Local Advanced Programmable Interrupt Controller (APIC) unit. The APIC is responsible for receiving interrupt requests from other processors, the processor local interrupt pins, the APIC timer, APIC error conditions, performance monitor logic, and the IO APIC module. These requests are then prioritized and forwarded to the processor core for execution. (a) Processor startup. Refer to Fig. 2.4. At startup, upon the desertion of reset and the completion of a processor’s BIST bit of the configuration register, the processors within the cluster must negotiate amongst themselves to select the processor that will wake up and start fetching, decoding, and executing the Power-On Self Test (POST) code from the ROM. This processor is referred to as the BootStrap processor, or BSP. After the BSP is identified, the other processors, referred to as the Application processors, or APs, remain dormant until they receive a startup message from the BSP via the APIC bus. Processor cluster APIC bus CPU3 (BSP) CPU2 (AP) Pentium Pro Host/PCI bridge (compatibility PB) CPU1 (AP) CPU0 (AP) Bus Main DRAM memory Host/PCI bridge (auxiliary PB) PCI bus IO APIC module E/ISA bridge E/ISA bus Figure 2.4 Pentium multiprocessor system block diagram (courtesy of Intel Corporation). Zhang_Ch02.indd 194 5/13/2008 5:53:43 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 195 The Intel multiprocessing specification (available for download at the Intel developers’ web site) dictates that the startup code executed by the BSP is responsible for detecting the presence of processors other than the BSP. When the available APs have been detected, the startup code stores this information as a table in nonvolatile memory. According to the Intel multiprocessor specification (available for download at the Intel developers’ web site), both the BIOS code and the POST code are responsible for detecting the presence of and initializing the APs. Intel recommends that this be accomplished in the following manner: (i) Both the POST code and the BIOS code executing on the BSP initialize a predefined RAM location to 1hex (to represent the fact that one processor, the BSP, is known to be present and functioning). This location is referred to as the Central Processing Unit (CPU) counter. (ii) Both the POST code and the BIOS code executing on the BSP clear a memory semaphore location to 00hex to permit one of the APs to execute the body of the FindAndInitAllCPU routine. (iii) Both the POST code and the BIOS code executing on the BSP broadcast a startup message to all APs (assuming any are present). The vector field in this message selects a slot in the interrupt table that points to the FindAndInitAllCPU routine. (iv) Upon receipt of this message, all of the APs simultaneously request ownership of the Pentium Pro bus to begin fetching and executing the FindAndInitAllCPU routine. (v) Both the POST code and the BIOS code executing on the BSP then wait for all the APs that may be present to complete execution of the FindAndInitAllCPU routine. The wait loop can be implemented using a long, software enforced delay, the chipset’s Timer 0 (refer to the Intel relevant specification available for download on the Intel web site), or using the timer built into the BSP’s local APIC. Alternatively, the following wait procedure can be used: (1) Using a locked read, both the POST code and the BIOS code executing on the BSP examine the CPU counter RAM location every 2 s and compare the counter value read 2 s ago. If the value has not changed (i.e., been incremented), all APs have completed their execution of the FindAndInitAllCPU routine. This assumes that an AP takes less than 2 s to Zhang_Ch02.indd 195 5/13/2008 5:53:43 PM 196 INDUSTRIAL CONTROL TECHNOLOGY complete execution of routine. (2) The counter value at the end of wait indicates the total number of processors in the system including the BSP. (vi) Once all of the APs have completed execution of the FindAndInitAllCPU routine, they have all made entries in the Multiprocessor Table in the CMOS memory. (vii) Both the POST code and the BIOS code executing on the BSP read the user-selected setup parameters from CMOS to determine how many of the available processors to utilize during this Operating System (OS) session. Both the POST and the BIOS codes then complete building the multiprocessor table in CMOS, removing or disabling the entries associated with the processors not to be used in this session. A new checksum value is computed for the adjusted multiprocessor table and its length and number of entry fields are completed. (viii) As each of the APs complete execution of the FindAndInitAllCPU routine, they either halt or enter a program loop. Both the POST and the BIOS codes instruct the BSP’s local APIC to broadcast an INIT message to the APs. This causes them to enter (or remain) in the halted state and await receipt of a startup message that will be issued by the multiprocessor OS once it has been loaded and control passed to it. (b) The fetch, decode, execute engine. At the heart of the processor are the execution units that execute instructions. As given in Fig. 2.3(a), the processor includes a fetch engine that attempts to properly predict the path of program execution and generates an ongoing series of memory-read operations to fetch the desired instructions. The high-speed (e.g., 150 or 200 MHz) processor execution engine would then be bound by the speed of external memory accesses. It should be obvious that it is extremely advantageous to include a very high-speed cache memory on board so that the processor keeps copies of recently used information of both code and data. Memory-read requests generated by the processor core are first submitted to the cache for a lookup before being propagated to the external bus in an event of cache miss. The Pentium processors include both a code and a data cache in the level 1 cache. In addition, they include a level 2 cache tightly coupled to the processor core via a private bus. The processors’ caches are disabled at power-up time, however. Zhang_Ch02.indd 196 5/13/2008 5:53:44 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 197 In order to realize the processors’ full potential, the caches must be enabled. The steps for the Pentium processors to execute instructions are briefly described below: (i) fetch Intel Architecture instructions from memory in strict program order; (ii) decode, or translate, them in strict program order into one or more fixed-length RISC instructions known as micro-ops or u-ops; (iii) place the micro-ops into an instruction pool in strict program order; (iv) until this point, the instructions have been kept in original program order. This part of the pipeline is known as the in-order front end. The processor then executes the micro-ops in any order possible as the data and execution units required for each micro-op become available. This is known as the out-of-order portion of pipeline; (v) finally, the processor commits the results of each micro-op execution to the processor’s register set in the order of the original program flow. This is the in-order rear end. The new Pentium processors implement a dynamic execution microarchitecture, a combination of multiple branch prediction, speculation execution, and data flow analysis. These Pentium processors execute MMX (will be detailed in a subsequent paragraph) technology instructions for enhanced media and communication performance. Multiple branch predicts the flow of the program through several branches: using a branch prediction algorithm, the processor can anticipate jumps in instruction flow. It predicts where the next instruction can be found in memory with a 90% or greater accuracy. This is made possible because, while the processor is fetching instructions, it is also looking at instructions further ahead in the program. Data flow analysis analyzes and schedules instructions to be executed in an optimal sequence, independent of the original program order; the processor looks at decoded software instructions and determines whether f they are available for processing or whether they are dependent on other instructions. Speculative execution increases the rate of execution by looking ahead of the program counter and executing instructions that are likely to be needed later. When the processor executes several instructions at a time, it does so using speculative execution. The instructions being processed are Zhang_Ch02.indd 197 5/13/2008 5:53:44 PM 198 INDUSTRIAL CONTROL TECHNOLOGY based on predicted branches and the results are stored as speculative results. Once their final state can be determined, the instructions are returned to their proper order and committed to permanent machine state. (c) Processor cache. Figure 2.3(a) also provides an overview of the processor’s cache, which shows that the processor cache mainly contains these two types: data cache and code cache. The L1 code cache services the requests for instructions generated by the instruction prefetcher (the prefetcher is the only unit that accesses the code cache and it only reads from it, so the code cache is read only), whereas the L1 data cache services memory data read and write requests generated by the processor’s execution units when they are executing any instruction that requires a memory data access. The unified L2 cache resides on a dedicated bus referred to as the backside bus. It services misses on the L1 caches, and, in the event of an L2 miss, it issues a transaction request to the external memory. The information is placed in the L2 cache and is also forwarded to the appropriate L1 cache for storage. The L1 data cache in processor services memory data read and writes requests initiated by the processor execution units. The size and structure of the L1 data cache is processor implementation–specific. As processor core speeds increase, the cache sizes may also be increased because the faster core can process code and data faster. Each of the data cache’s cache banks, or ways, is further divided into two banks. When performing a lookup, the data cache views memory as divided into pages equal to the size of one of its cache banks (or ways). Furthermore, it views each memory page as having the same structure as one of its cache ways. The target number is used to index into the data cache directory and select a set of two entries to compare against. If the target page number matches the tag field in one of the entries in the E, S, or M state given below, it is a cache hit. The data cache has a copy of the target line from the target page. The action taken by the data cache depends on whether or not the data access is a read or a write, the current state of the line, and the rules of conduct defined for this area of memory. Each line storage location within the data cache can currently be in one of four possible states: (i) invalid state (I); there is no valid line in the entry. (ii) exclusive state (E); the line in the entry is valid, is still the same as memory, and no other processor has a copy of the line in its caches. Zhang_Ch02.indd 198 5/13/2008 5:53:44 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 199 (iii) shared state (S); the line in the entry is valid, still the same as memory, and one or more processors may also have copies of the line or may not because the processor cannot discriminate between reads by processors and reads performed by other, noncaching entries such as a host/PCI bridge. (iv) modified state (M); the line in the entry is valid, has been updated by this processor since it was read into the cache, and no other processor has a copy of the line in its caches. The line in memory is stable. The L1 code cache exists for only one reason: to supply requested code to the instruction prefetcher. The prefetcher issues only read requests to the code cache, so it is a read-only cache. A line stored in the code cache can only be one of two possible states, valid or invalid, implemented as the S and I states. When a line of code is fetched from memory and is stored in the code cache, it consists of raw code. The designers could have chosen to prescan the code stream as it is fetched from memory and store boundary markers in the code cache to demark the boundaries between instructions within the cache line. This would preclude the need to scan the code line as it enters the instruction pipeline for decode so each of the variable-length Intel Architecture instructions can be aligned with the appropriate decoder. However, this would bloat the size of the code cache. Note the Pentium’s code cache stores boundary markers. When performing a lookup, the code cache views memory as divided into pages equal to the size of one of its cache banks (or ways). Furthermore, it views each memory page as having the same structure as one of its cache ways. (d) MMX technology. Intel’s Matrix Math Extensions (MMX) technology is designed to accelerate multimedia and communication applications. The MMX technology retains its full compatibility with the original Pentium processor. It contains five architectural design enhancements: (i) New instructions (ii) Single Instruction Multiple Data (SIMD). The new instructions use a SIMD model, operating on several values at a time. Using the 64-bit MMX registers, these instructions can operate on eight bytes, four words, or two double words at once, greatly increasing throughout. (iii) More cache. Intel has doubled on-chip cache size to 32k. That way, more instructions and data can be stored on Zhang_Ch02.indd 199 5/13/2008 5:53:44 PM 200 INDUSTRIAL CONTROL TECHNOLOGY the chip, reducing the number of times the processor has to access slower, off-chip memory area for information. (iv) Improved branch prediction. The MMX processor contains four prefetch buffers that can hold up to four successive code streams. (v) Enhanced pipeline and deeper write buffers. An additional pipeline stage has been added and four write buffers are shared between the dual pipelines to improve memory write performance. MMX technology uses general-purpose basic instructions that are fast and easily assigned to the parallel pipelines in Intel processors. By using this general-purpose approach, MMX technology provides performance that will scale well across current and future generations of Intel processors. The MMX instructions cover several functional areas including: (i) basic arithmetic operations such as add, subtract, multiply arithmetic shift, and multiply add; (ii) comparison operations; (iii) conversation instructions to convert between the new data types—pack data together and unpack from small to larger data types; (iv) logical operations such as AND, NOT, OR, and XOR; (v) shift operations; (vi) data transfer (MOV) instructions for MMX register-toregister transfers, or 64-bit and 32-bit load and store to memory. The principal data type of the MMX instruction set is the packed, fixed-point integer, where multiple integer words are grouped into single 64-bit quantities. These 64-bit quantities are moved to the 64-bit MMX registers. The decimal point of the fixed-point values is implicit and is left for the programmer to control for maximum flexibility. Arithmetic and logical instructions are designed to support the different packed integer data types. These instructions have a different op code for each data type supported. As a result, the new MMX technology instructions are implemented with 57 op codes. The supported data types are signed and unsigned fixed-point integers, bytes, words, double words, and quad words. The four MMX technology data types are (i) packed bytes: 8 bytes packed into one 64-bit quantity; (ii) packed word: four 16-bit words packed into one 64-bit quantity; Zhang_Ch02.indd 200 5/13/2008 5:53:44 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 201 (iii) packed double word: two 32-bit double words packed into one 64-bit quantity; (iv) quad word: one 64-bit quantity. From the programmer’s view, there are eight new MMX registers (MM0–MM7) along with new instructions that operate on these registers. But to avoid adding new states, these registers are mapped onto the existing floating-point registers (FP0–FP7). When a multitasking operating system (or application) executes an FSAVE instruction, as it does today to save state, the contents of MM0–MM7 are saved in place of FP0–FP7 if MMX instructions are in use. Detecting the existence of MMX technology on an Intel microprocessor is done by executing the CPUID instruction and checking a set bit. Therefore, when installing or running, the software can query the microprocessor to determine whether MMX technology is supported and install or execute the code that includes, or does not include, MMX instructions based on the result. 2.1.1.3 Internal Bus System Figures 2.1, 2.3(a), and 2.4 show us that the internal bus systems of an Intel microprocessor, based on their functions, comprises these types below, each of them monitored by a corresponding bus controller or bus unit: (1) Backside bus. (2) Displacement bus. (3) APIC bus. (4) Cache buses that are divided into data bus and address bus. (5) CPUs’ cluster bus. 2.1.1.4 Memories Memory can be classified into two groups: prime (system or main) memory and storage memory. The R/WM and ROM are examples of prime memory; this is the memory the microprocessor uses in executing and storing programs. This memory should be able to respond fast enough to keep up with the execution speed of the microprocessor. Therefore, it should be random access memory, meaning that the microprocessor should be able to access information from any register with the same speed Zhang_Ch02.indd 201 5/13/2008 5:53:44 PM 202 INDUSTRIAL CONTROL TECHNOLOGY (independent of its place in the chip). The size of a memory chip is specified in terms of bits. For example, a 1k memory chip means it can store 1k (1024) bits (not bytes). On the other hand, memory in a system such as a PC computer is specified in bytes. For example, 4M memory means it has 4 megabytes of volume. The other group is the storage memory, such as magnetic disks and tapes (see Fig. 2.5). This memory is used to store programs and results after the completion of program execution. Information stored in these memories is nonvolatile, meaning information remains intact even if the system is turned off. The microprocessor cannot directly execute or process programs stored in these devices; programs need to be copied into the R/W prime memory first. Therefore, the size of the prime memory, such as 512k or 8M (megabytes), determines how large a program the system can process. The size of the storage memory is unlimited; when one disk is full, the next one can be used. Figure 2.5 also shows two groups in storage memory: secondary storage and backup storage. The secondary storage and backup storage include devices such as disks, magnetic tapes, etc. Figure 2.5 shows that the prime (system) memory is divided into two main groups: read/write memory (R/WM) and read-only memory (ROM); each group includes several different types of memory, as discussed below. (1) Read/write memory (R/WM). As the name suggests, the microprocessor can write into or read from this memory; it is popularly Memory Prime memory Storage memory Readonly memory ROM Read/write memory R/WM Static R/WM Zero power RAM Nonvolatile RAM Dynamic R/WM Integrated RAM Secondary storage Semi-random access Erasable memory Permanent memory EPROM PROM EE-PROM Masked ROM Flash memory Disk Backup storage Serial access Magnetic tape CCD Floppy CD-ROM; Zip disk Figure 2.5 The classification of microprocessors’ memories. Zhang_Ch02.indd 202 5/13/2008 5:53:44 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 203 known as Random Access Memory (RAM). It is used primarily for information that is likely to be altered, such as writing programs or receiving data. This memory is volatile, meaning that when the power is turned off, all the contents are destroyed. Two types of R/W memories, static and dynamic, are available; they are described in the following paragraphs. (a) Static memory (SRAM). This memory is made up of flipflops, and it stores the bit as a voltage. Each memory cell requires six transistors; therefore, the memory chip has low density but high speed. SRAM, known as cache memory, is included on the processor chip. In addition, high-speed cache memory is also included external to the processor to improve the performance of a system. (b) Dynamic memory (DRAM). This memory is made up of MOS transistor gates, and it stores the bit as a charge. For the DRAM, stored information needs to be read and then written again every few milliseconds. It is generally economical to use dynamic memory when system memory is at least 8k; for small systems, the static memory is appropriate. To increase the speed of DRAM, various techniques are being used. These techniques have resulted in the production of high-speed memory chips, such as Extended Data Out (EDO), Synchronous DRAM (SDRAM), and Rambus DRAM (RDRAM). (2) Read-only memory (ROM). The ROM is a nonvolatile memory; it retains stored information even if the power is turned off. This memory is used for programs and data that need not be altered. As the name suggests, the information can be read only, which means once a bit pattern is stored, it is permanent or at least semi-permanent. The permanent group also includes two types of memory: masked ROM and PROM. The semi-permanent group also includes two types of memory: EPROM and EE-PROM, as shown in Fig. 2.5. Five types of ROM—masked ROM, PROM, EPROM, EE-PROM, and flash memory—are described in the following paragraphs. (a) Masked ROM. In this ROM, a bit pattern is permanently recorded by the masking and metallization process. Memory manufacturers are generally equipped to do this process. It is an expensive and specialized process, but economical for large production quantities. (b) Programmable read-only memory (PROM). This memory has nichrome or polysilicon wires arranged in a matrix; these wires can be functionally viewed as diodes or fuses. This memory can be programmed by the user with a special PROM Zhang_Ch02.indd 203 5/13/2008 5:53:44 PM 204 INDUSTRIAL CONTROL TECHNOLOGY programmer that selectively burns the fuses according to the bit pattern to be stored. The process is known as “burning the PROM,” and the information stored is permanent. (c) Erasable programmable read-only memory (EPROM). This memory stores a bit by charging the floating gate of an FET. Information is stored by using an EPROM programmer, which applies high voltages to charge the gate. All the information can be erased by exposing the chip to ultraviolet light through its quartz window, and the chip can be reprogrammed. Because the chip can be reused many times, this memory is ideally suited for product development and experimental projects. The disadvantages of EPROM are (1) it must be taken out of the circuit to erase it, (2) the entire chip must be erased, and (3) the erasing process could take 15 or 20 min. (d) Electrically erasable PROM (EE-PROM). This memory is functionally similar to EPROM, except that information can be altered by using electrical signals at the register level rather than erasing all the information. This has an advantage in field and remote control applications. In microprocessor systems, software update is a common occurrence. If EE-PROMs are used in the systems, they can be updated from a central computer by using a remote linkage via serial cable bus. This memory also includes Chip Erase mode, whereby the entire chip can be erased in 10 ms rather than the 20 min taken to erase an EPROM. (e) Flash memory. This is a variation of EE-PROM that is becoming popular. The major difference between the flash memory and EE-PROM is in the erasure procedure: The EE-PROM can be erased at a register level, but the flash memory chip must be erased either in its entirety or at the sector (block) level. These memory chips can be erased and programmed at least a million times. In a microprocessor-based device, programs are generally written in ROM, and data that are likely to vary are stored in R/WM. Memory technology has advanced considerably in recent years. In addition to static and dynamic R/W memory, other options are also available in memory devices. Examples include zero power RAM, nonvolatile RAM, and integrated RAM. The zero power RAM is a CMOS read/write memory with battery backup built internally. It includes lithium cells and voltage-sensing circuitry. Zhang_Ch02.indd 204 5/13/2008 5:53:44 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 205 When the external power supply voltage falls below 3 V, the power-switching circuitry connects the lithium battery; thus, this memory provides the advantages of R/W and read-only memory. The nonvolatile RAM is a high-speed static R/W memory array backed up, bit for bit, by EE-PROM array for nonvolatile storage. When the power is about to go off, the contents of R/W memory are quickly stored in the EE-PROM by activating the store signal or the memory chip, and stored data can be read into the R/W memory segment when the power is again turned on. This memory chip combines the flexibility of static R/W memory with the nonvolatility of EE-PROM. The integrated RAM (iRAM) is a dynamic memory with the refreshed circuitry built on a chip. For the user, it is similar to the static R/W memory. The user can derive the advantages of dynamic memory without having to build the external refresh circuitry. 2.1.1.5 Input/Output Pins To allow for easy upgrades and to save space, the 80486 and Pentium processors are available in a pin-grid array (PGA) form. For all the Intel microprocessors, their PGA pin-out lists are provided in the corresponding Intel specifications. A 168-pin 80486 GX block is illustrated in Fig. 2.1; it can be seen that the 80486 processor has a 32-bit address bus (A0-A31) and a 32-bit data bus (D0-D31). Table 2.1 defines how the 80486 control signals are interpreted. Table 2.1 Intel 80486 Processor Control Signal M/IO D/C W/R Description 0 0 0 0 1 1 1 1 0 0 1 1 0 0 1 1 0 1 0 1 0 1 0 1 Interrupt acknowledge sequence STOP/special bus cycle Reading from an I/O port Writing to an I/O port Reading an instruction from memory Reserved Reading data from memory Writing data to memory Zhang_Ch02.indd 205 5/13/2008 5:53:44 PM 206 INDUSTRIAL CONTROL TECHNOLOGY The main 80486 pin connections are as follows: (1) A2-A31 (I/O) (2) A20M (I) (3) ADS (O) (4) AHOLD (I) (5) BE0–BE3 (O) (6) BLAST (O) (7) BOFF (I) (8) BRDY (I) (9) BREQ (O) (10) BS16, BS8 (I) (11) DP0–DP3 (I/O) (12) EADS (I) (13) FERR (O) (14) FLUSH (I) (15) HOLD, HOLDA (I/O) (16) IGNNE (I) (17) INTR (I) (18) KEN (I) Zhang_Ch02.indd 206 The 30 most significant bits of the address bus When active low, the processor internally masks the address bit A20 before every memory access Indicates that the processor has valid control signals and valid address signals When active, a different bus controller can have access to the address bus. This is typically used in a multiprocessor system The byte enable lines indicate which of the bytes of the 32-bit data bus is active It indicates that the current burst cycle will end after the next BRDY signal The backoff signal informs the processor to deactivate the bus on the next clock cycle The burst ready signal is used by an addressed system that has sent data on the data bus or read data from the bus It indicates that the processor has internally requested the bus The BS16 signal indicates that a 16-bit data bus is used; the BS8 signal indicates that an 8-bit data bus is used. If both are high, then a 32-bit data bus is used The data parity bits give a parity check for each byte of the 32-bit data bus. The parity bits are always even parity Indicates that an external bus controller has put a valid address on the address bus Indicates that the processor has detected an error in the internal floating-point unit When it is active the processor writes the complete contents of the cache to memory The bus hold (HOLD) and acknowledge (HOLDA) are used for bus arbitration and allow other bus controllers to take control of the buses When active the processor ignores any numeric errors External devices to interrupt the processor use the interrupt request line This signal stops caching of a specific address 5/13/2008 5:53:44 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL (19) LOCK (O) (20) M/IO, D/C, W/R (O) (21) NMI (I) (22) PCHK (O) (23) PLOCK (O) (24) PWT, PCD (O) (25) RDY (I) (26) RESET (I) 2.1.1.6 207 If it is active, the processor will not pass control to an external bus controller when it receives a HOLD signal See Table 2.1 The nonmaskable interrupt signal causes an interrupt 2 If it is set active then a data parity error has occurred The active pseudo lock signal identifies that the current data transfer requires more than one bus cycle The page write-through (PWT) and page cache disable (PCD) are used with cache control When it is active, the addressed system has sent data on the data bus or read data from the bus If the reset signal is high for more than 15 clock cycles, then the processor will reset itself Interrupt System In the Intel microprocessors, the interrupt lines are interrupt request pin (INTR), nonmaskable interrupt request pin (NMI), and system reset pin (RESET), all of which are high signals. The INTR pin is activated when an external device, such as a hard disk or a serial port, wishes to communicate with the processor. This interrupt is maskable and the processor can ignore the interrupt if it wants. NMI pin is a nonmaskable interrupt and is always acted on. When it becomes active the processor calls the nonmaskable interrupt service routine. The RESET pin signal causes a hardware reset and is normally made active when the processor is powered up. 2.1.2 Microprocessor Unit Interrupt Operations The interrupt I/O is a process of data transfer whereby an external device or a peripheral can inform the processor that it is ready for communication and it requests attention. The process is initiated by an external device and is asynchronous, meaning that it can be initiated at any time without reference to the system clock. However, the response to an interrupt request is directed or controlled by the microprocessor. Unlike the polling technique, an interrupt processing allows a program or an external device to interrupt the task currently being executed by the microprocessor. The generation of Zhang_Ch02.indd 207 5/13/2008 5:53:44 PM 208 INDUSTRIAL CONTROL TECHNOLOGY an interrupt can occur by hardware (hardware interrupt) or by software (software interrupt). When an interrupt occurs an interrupt service routine (ISR) is called. For a hardware interrupt, the ISR then communicates with the device and processes data. When it has finished the program execution, it then returns to the original program. A software interrupt causes the program to interrupt its execution and goes to an ISR. Software interrupts include the processor-generated interrupts normally occurring either when a program causes a certain type of error or if it is being used in a debug mode. In debug mode the program can be made to break from its execution when a breakpoint occurs. It seems that software interrupts, in most cases, do not require the program to return back when the ISR task is complete. Apart from this difference between them, both the software interrupts and the hardware interrupts use the same mechanisms, methodologies, and processes to handle interrupts. The interrupt requests are classified in two categories: maskable interrupt and nonmaskable interrupt. The microprocessor can ignore or delay a maskable interrupt request if it is performing some critical task; however, it must respond to a nonmaskable interrupt immediately. 2.1.2.1 Interrupt Process (1) The operation of a real mode interrupt. When the microprocessor completes executing the current instruction, it determines whether an interrupt is active by checking the following: (1) instruction executions, (2) single step, (3) NMI pin, (4) coprocessor segment overrun, (5) INTR pin, and (6) INT instruction, in the order presented. If one or more of these interrupt conditions are present, the following sequence of events occurs: (a) The contents of the flag register are pushed onto the stack. (b) Both the interrupt (IF) and trap (TF) flags are cleared. This disables the INTR pin and the trap or single-step feature. (c) The contents of the code segment register (CS) are pushed onto the stack. (d) The contents of the instruction pointer (IP) are pushed onto the stack. (e) The interrupt vector contents are fetched and then placed into both IP and CS so that the next instruction executes the ISR addressed by the vector. Whenever an interrupt is accepted, the microprocessor stacks the contents of the flag register, CS and IP; clears both IF and TF; and jumps to the procedure addressed by the interrupt vector. After the flags are pushed onto the stack, Zhang_Ch02.indd 208 5/13/2008 5:53:44 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 209 IF and TF are cleared. These flags are returned to the state prior to the interrupt when the IRET instruction is encountered at the end of the ISR. Therefore, if interrupts were enabled prior to the ISR, they are automatically reenabled by the IRET instruction at the end of the interrupt service routine. The return address (stored in CS and IP) is pushed onto the stack during the interrupt. Sometimes, the return address points to the next instruction in the program; sometimes it points to the instruction or point in the program where the interrupt occurred. Interrupt type numbers 0, 5, 6, 7, 8, 10, 11, 12, and 13 push a return address that points to the offending instruction, instead of to the next instruction in the program. This allows the ISR to possibly retry the instruction crashed in certain error cases. Some of the protected mode interrupts (type 8, 10, 11, 12, and 13) place an error code on the stack following the return address. The error code identifies the selector that caused the interrupt. In case no selector is involved, the error code is 0. (2) The operation of a protected mode interrupt. In the protected mode, interrupts have exactly the same assignments as in the real mode, but the interrupt vector table is different. In place of interrupt vectors, protected mode uses a set of 256 interrupt descriptors that are stored in an interrupt descriptor table (IDT). The interrupt descriptor table is normally 256 × 8 (2k) bytes long, with each descriptor containing 8 bytes. The IDT is located at any memory location in the system by the IDT address register (IDTR). Each entry in the IDT contains the address of the ISR in the form of a segment selector and a 32-bit offset address. It also contains the P bit (present) and DPL bits to describe the privilege level of the interrupt. Real mode interrupt vectors can be converted into protected mode interrupts by copying the interrupt procedure addresses from the interrupt vector table and converting them to 32-bit offset addresses that are stored in the interrupt descriptors. A single selector and segment descriptor can be placed in the global descriptor table that identifies the first 1M byte of memory as the interrupt segment. Other than the IDT and interrupt descriptors, the protected mode interrupt functions like the real mode interrupt. They return from both interrupts by using the IRET or IRETD instruction. The only difference is that in protected mode the microprocessor accesses the IDT instead of the interrupt vector table. (3) Interrupt flag bits. The interrupt flag (IF) and trap flag (TF) are both cleared after the contents of the flag register are stacked Zhang_Ch02.indd 209 5/13/2008 5:53:45 PM 210 INDUSTRIAL CONTROL TECHNOLOGY during an interrupt. When the IF bit is set, it allows the INTR pin to cause an interrupt; when the IF bit is cleared, it prevents the INTR pin from causing an interrupt. When IF = 1, it causes a trap interrupt (interrupt type number 1) to occur after each instruction executes. This is why we often call trap a single step. When TF = 0, normal program execution occurs. The interrupt flag is set and cleared by the STI and CLI instructions, respectively. There are no special instructions that set or clear the trap flag. 2.1.2.2 Interrupt Vectors The interrupt vectors and vector table are crucial to the understanding of hardware and software interrupts. Interrupt vectors are addresses that inform the interrupt handler as to where to find the ISR (also called interrupt service procedure). All interrupts are assigned a number from 0 to 255, with each of these interrupts being associated with a specific interrupt vector. The interrupt vector table is normally located in the first 1024 bytes of memory at addresses 000000H–0003FFH. It contains 256 different interrupt vectors. Each vector is 4 bytes long and contains the starting address of the ISR. This starting address consists of segment and offset of the ISR. Figure 2.6 illustrates the interrupt vector table used for the Intel microprocessors. Remember that in order to install an interrupt vector (sometimes called a hook), the assembler must address absolute memory. In an interrupt vector table, the first five interrupt vectors are identical in all Intel microprocessor family members, from the 8086 to the Pentium. Other interrupt vectors exist for the 80286 that are upward-compatible to 80386, 80486, and Pentium to Pentium 4, but not downward-compatible to the 8086 or 8088. Intel reserves the first 32 interrupt vectors for its use in various microprocessor family members. The last 224 vectors are available as user interrupt vectors. 2.1.2.3 Interrupts Service Routine (ISR) The interrupts of the entire Intel family of microprocessors include two hardware pins that request interrupts (INTR pin and NMI pin), and one hardware pin (INTA) that acknowledges the interrupt requested through INTR. In addition to the pins, the Intel microprocessor also has software interrupt instructions: INT, INTO, INT 3, and BOUND. Two flag bits, IF (interrupt flag) and TF (trap flag), are also used with the interrupt structure Zhang_Ch02.indd 210 5/13/2008 5:53:45 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 0003FFH 211 Type 32 – 255: User interrupt vectors Type 14 – 31: Reserved Type 18: Machine check Type 17: Alignment check Type 16: Coprocessor error Type 15: Unassigned Type 14: Page fault Type 13: General protection Type 12: Stack segment overrun Type 11: Segment not present Type 10: Invalid task state segment Type 9: Coprocessor segment overrun Type 8: Double fault Type 7: Coprocessor not available Type 6: Undefined opcode Type 5: BOUND Type 4: Overflow (INTO) Type 3: 1-byte breakpoint Type 2: NMI pin Type 1: Single-step Type 0: Divide error 000000H (a) Segment (low) Offset (high) Offset (low) (b) Figure 2.6 (a) The interrupt vector table for the Intel microprocessor, and (b) the contents of an interrupt vector. Zhang_Ch02.indd 211 5/13/2008 5:53:45 PM 212 INDUSTRIAL CONTROL TECHNOLOGY and with a special return instruction IRET (or IRETD in the 80386, 80486, or Pentium-Pentium 4). (1) Software interrupts. Intel microprocessors provide five software interrupt instructions: BOUND, INTO, INT, INT 3, and IRET. Of these five software interrupt instructions, INT and INT 3 are very similar, BOUND and INTO are conditional, and IRET is a special interrupt return instruction. The INT n instruction calls the ISR that begins at the address represented in vector number n. The only exception to this is the “INT 3” instruction, a 1-byte instruction. The INT 3 instruction is often used as breakpoint-interrupt, because it is easy to insert a 1-byte instruction into a program. As mentioned previously, breakpoints are often used to debug faulty software. The BOUND instruction, which has two operands, compares a register with two words of memory data. The INTO instruction checks the overflow flag (OF); If OF = 1, the INTO instruction calls the ISR whose address is stored in interrupt vector type number 4. If OF = 0, then the INTO instruction performs no operation and the next sequential instruction in the program executes. The IRET instruction is a special return instruction used to return for both software and hardware interrupts. The IRET instruction is much like a “far RET” because it retrieves the return address from the stack. It is unlike the “near return” because it also retrieves a copy of the flag register from the stack. An IRET instruction removes six bytes from the stack: two for the IP, two for CS, and two for flags. In the 80386 to Pentium 4, there is also an IRETD instruction because these microprocessors can push the EFLAG register (32 bit) on the stack, as well as the 32-bit EIP in the protected mode. If operated in the real mode, we use the IRET instruction with the 80386 to Pentium 4 microprocessors. (2) Hardware interrupts. The microprocessor has two hardware inputs: nonmaskable interrupt (NMI) and interrupt request (INTR). Whenever the NMI input is activated, a type 2 interrupt occurs because NMI is internally decoded. The INTR input must be externally decoded to select a vector. Any interrupt vector can be chosen for the INTR pin, but we usually use an interrupt type number between 20H and FFH. Intel has reserved interrupts 00H through 1FH for internal and future expansion. The INTA signal is also an interrupt pin on the microprocessor, but it is an output that is used in response to the INTR input to apply a vector-type number to the data bus connections D7–D0. Zhang_Ch02.indd 212 5/13/2008 5:53:45 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 213 The NMI is an edge-triggered input that requests an interrupt on the positive edge (0-to-1 transition). After a positive edge, the NMI pin must remain logic 1 until it is recognized by the microprocessor. The NMI input is often used for parity errors and other major system faults, such as power failure. Power failures are easily detected by monitoring the AC power line and causing an NMI interrupt whenever AC power drops out. The interrupt request input (INTR) is level sensitive, which means that it must be held at logic 1 level until it is recognized. The INTR pin is set by an external event and cleared inside the ISR. This input is automatically disabled once it is accepted by the microprocessor and reenabled by the IRET instruction at the end of the ISR. The microprocessor responds to the INTR input by pulsing the INTA output in anticipation of receiving an interrupt vector-type number on data bus connection D7–D0. There are two INTA pulses generated by the system that are used to insert the vector-type number on the data bus. 2.1.3 Microprocessor Unit Input/Output Rationale The I/O devices can be interfaced with a microprocessor using both techniques: isolated I/O (also called peripheral-mapped I/O) and memorymapped I/O. The process of data transfer in both is identical. Each device is assigned a binary address, called a device address or port number, through its interface circuit. When the microprocessor executes a data transfer instruction for an I/O device, it places the appropriate address on the address bus, sends the control signals, enables the interfacing device, and then transfers data. The interface device is like a gate for data bits, which is opened by the microprocessor whenever it intends to transfer data. 2.1.3.1 Basic Input/Output Techniques As previously mentioned, there are two main methods of communicating with external equipment: either the equipment is mapped into the physical memory and given a real address on the address bus of the microprocessor (memory mapped I/O), or it is mapped into a special area of input/output memory (isolated I/O). Devices mapped into memory are accessed by reading or writing to the physical address of the memory. Isolated I/O provides ports that are gateways between the interface device and the processor. They are isolated from the system using a buffering system and are accessed by four machine code instructions: IN, INS, OUT, OUTS. The IN (INS) instruction inputs a byte, or a word, and the Zhang_Ch02.indd 213 5/13/2008 5:53:45 PM 214 INDUSTRIAL CONTROL TECHNOLOGY OUT (OUTS) instruction outputs a byte, or a word. A high-level compiler interprets the equivalent high-level functions and produces machine code that uses these instructions. Figure 2.7 shows the two methods. This figure also tells us that devices are not directly connected onto the address and data bus because they may use part of the memory that a program uses or they could cause a hardware fault. This device interprets the microprocessor signals and generates the required memory signals. Two main output lines differentiate between a read and a write operation (R/W) and between direct and isolated memory access (M/IO). The R/W line is low when data is being written to memory and high when data is being read. When M/IO is high, direct memory access is selected, and when low, the isolated memory is selected. (1) Isolated I/O. The most common I/O transfer technique used in the Intel microprocessor-based system is isolated I/O. The term “isolated” describes how the I/O locations are isolated from the memory system in a separate I/O address space. The addresses for isolated I/O devices, called ports, are separate from the memory. Because the ports are separate, the user can expand the memory to its full size without using any of the memory space for I/O devices. A disadvantage of isolated I/O is that the data transferred between I/O and the microprocessor must be accessed Bus controller Read/write R/W Memory/isolated M/IO Address bus Microprocessor Data bus Memory mapped I/O Interface device Address bus Data bus Isolated I/O Figure 2.7 Access memory-mapped and isolated I/O. Zhang_Ch02.indd 214 5/13/2008 5:53:45 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 215 by the IN, INS, OUT, and OUTS instructions. Separate control signals for the I/O space are developed (using M/IO and R/W), which indicate an I/O read (IORC) or an I/O write (IOWC) operation. These signals indicate that an I/O port address, which appears on the address bus, is used to select the I/O device. In the personal computer, isolated I/O ports are used for controlling peripheral devices such as direct memory access (DMA) controller, NMI reset, game I/O adaptor, floppy disk controller, second serial port (COM2), and primary serial port (COM1). An 8-bit port address is used to access devices located on the system board, such as the timer and keyboard interface, while a 16-bit port is used to access serial and parallel ports as well as video and disk drive system. (2) Memory-mapped I/O. Interface devices can map directly onto the system address and data bus. Unlike isolated I/O, memorymapped I/O does not use the IN, INS, OUT, or OUTS instructions. Instead, it uses any instruction that transfers data between the microprocessor and memory. A memory-mapped I/O device is treated as a memory location in the memory map. The main advantage of memory-mapped I/O is that any memory transfer instruction can be used to access the I/O device. The main disadvantage is that a portion of the memory system is used as the I/O map, which reduces the amount of the usable memory volumes for applications. In a PC-compatible system the address bus is 20 bits wide, from address 00000h to FFFFFh (1MB). Figure 2.8 gives a typical memory allocation in PC. FFFFFFFFh (4 GB) Extended memory 00FFFFFFh (16 MB) Extended memory Video graphic text display Application programs (640 kB) Interrupt vectors BIOS 000FFFFFh (1 MB) 0009FFFFh (640 kB) 00000600h 00000000h Figure 2.8 Typical PC memory map. Zhang_Ch02.indd 215 5/13/2008 5:53:45 PM 216 INDUSTRIAL CONTROL TECHNOLOGY 2.1.3.2 Basic Input/Output Interfaces The basic input device is a set of three-state buffers. The basic output device is a set of data latches. The term IN refers to moving data from the I/O device into the microprocessor and the term OUT refers to moving data out of the microprocessor to the I/O device. Many I/O devices accept or release information at a much slower rate than the microprocessor. Another method of I/O control, called “handshaking” or “polling,” synchronizes the I/O device with the microprocessor. An example device that requires handshaking is a parallel printer that prints 100 characters per second (CPS). It is obvious that the microprocessor can send more than 100 CPS to the printer, so a handshaking must be used to slow the microprocessor down to match speeds with the printer. (1) The basic input interface. Three-state buffers 74ALS244 are used to construct the 8-bit input port depicted in Fig. 2.9(a). The external TTL data (simple toggle switches in this example) are connected to the inputs of the buffers. The outputs of the buffers connect to the data bus. The exact data bus connections depend on the version of the microprocessor. For example, the 8088 has data bus connections D7–D0, the 80486 has D31–D0, and the Pentium to Pentium 4 have D63–D0. The circuit of Fig. 2.9(a) allows the microprocessor to read the contents of the eight switches that connect to any 8-bit section of the data bus when the select signal SEL becomes logic 0. Thus, whenever the IN instruction executes, the contents of the switches are copied into the AL register. When the microprocessor executes an IN instruction, the I/O port address is decoded to generate the logic 0 on SEL. A 0 placed on the output control inputs (1G and 2G) of the 74ALS244 buffer causes the data input connections (A) to be connected to the data input (Y) connections. If a logic 1 is placed on the output control inputs of the 74ALS244 buffer, the device enters the three-state high-impedance mode that effectively disconnects the switches from the data bus. The basic input circuit is not optional and must appear any time that input data are interfaced to the microprocessor. Sometimes it appears as a discrete part of the circuit, as shown in Fig. 2.9(a); sometimes it is built into a programmable I/O device. It is possible to interface 16- or 32-bit data to various versions of the microprocessor, but this is not nearly as common as using 8-bit data. To interface 16 bits of data, the circuit in Fig. 2.9(a) is doubled to include two 74ALS244 buffers that connect 16 bits of Zhang_Ch02.indd 216 5/13/2008 5:53:46 PM 217 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 10 k 1 2 1 16 3 4 5 6 7 8 2 2 15 4 3 4 5 14 13 12 6 8 11 6 7 8 11 10 9 13 15 17 1 19 1A1 !A2 1Y1 1Y2 1A3 1A4 2A! 1Y3 1Y4 2Y1 2A2 2A3 2A4 2Y2 2Y3 2Y4 Data bus 18 16 14 12 9 7 5 3 1G 2G 74ALS244 . SEL (a) Data bus D0 D1 D2 Q0 Q1 Q2 D3 D4 D5 Q3 Q4 Q5 D6 D7 Q6 Q7 OC CLK SEL (b) Figure 2.9 The basic input and output interfaces. (a) The basic input interface illustrating the connection of eight switches. Note that the 74ALS244 is a three state that controls the application of switch data to the data bus. (b) The basic output interface connected to a set of LED displays. Zhang_Ch02.indd 217 5/13/2008 5:53:46 PM 218 INDUSTRIAL CONTROL TECHNOLOGY input data to the 16-bit data bus. To interface 32 bits of data, the circuit is expanded by a factor of 4. (2) The basic output interface. The basic output interface receives data from the microprocessor and must usually hold it for some external device. Its latches or flip-flops, like the buffers found in the input device, are often built into the I/O device. Figure 2.9(b) shows how eight simple light-emitting diodes (LEDs) connect to the microprocessor through a set of eight data latches. The latch stores the number output by the microprocessor from the data bus so that the LED can be lit with any 8-bit binary number. Latches are needed to hold the data because when the microprocessor executes an OUT instruction, the data are only present on the data bus for less than 1.0 µs. Without a latch, the viewer would never see the LED illuminate. When the OUT instruction executes, the data from AL, AX, or EAX are transferred to the latch via the data bus. Here, the D inputs of a 74ALS374 octal latch are connected to the data bus to capture the output data, and the Q outputs of the latch are attached to the LED. When a Q becomes a logic 0, the LED lights. Each time that the OUT instruction executes, the SEL signal to the latch activates, capturing the data output to the latch from any 8-bit section of the data bus. The data are held until the next OUT instruction executes. Thus, whenever the output instruction is executed in this circuit, the data from the AL register appears on the LED. 2.1.4 Microprocessor Unit Bus System Operations This subsection uses the Peripheral Component Interconnect (PCI) bus to introduce the microprocessor unit bus system operations. The PCI bus has been developed by Intel for its Pentium processors. This technique can be populated with adaptors requiring fast accesses to each other and/or system memory and that can be accessed by the processor at speeds approaching that of the processor’s full native bus speed. A PCI physical device package may take the form of a component integrated onto the system board or may be implemented on a PCI add-in card. Each PCI package (referred to in the specification as a device) may incorporate from one to eight separate functions. A function is a logical device. Each function contains its own, individually addressable configuration space, 64 double words in size. Its configuration registers are implemented in this space. Using these registers, the configuration software can automatically detect the presence of a function, determine its resource requirements including memory space, I/O space, interrupt lines, etc., and can then assign resources Zhang_Ch02.indd 218 5/13/2008 5:53:46 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 219 to the function that are guaranteed not to conflict with the resources assigned to other devices. 2.1.4.1 Bus Operations The PCI bus operates in the multiplexing mode (also called normal mode) and/or in the burst mode. In multiplexing mode, the address and data lines are used alternatively. First, the address is sent, followed by a data read or write. Unfortunately, this mode requires two or three clock cycles for a single transfer that is an address followed by a read or write cycle. The multiplex mode obviously slows down the maximum transfer rate. Additionally, a PCI bus can be operated in burst mode. A burst transfer is one consisting of a single address phase followed by two or more data phases. In the burst mode, the bus master only has to arbitrate for bus ownership one time. The start addresses and transaction type are issued during the address phase. All devices on the bus latch the address and transaction type and decode them to determine which the target device is. The target device latches the start address into an address counter and is responsible for incrementing the address from data phase to data phase. Figure 2.10 shows an example of the burst data transfer. There are two participants in every PCI burst transfer: the initiator and the target. The initiator, or bus master, is the device that initiates a transfer. The target is the device currently addressed by the initiator for the purpose of performing a data transfer. PCI initiator and target devices are commonly referred to as PCI-compliant agents in the specifications. It should be noted that a PCI target may be designed such that it can only handle single data phase transactions. When a bus master attempts to perform a burst transaction, the target forces the master to terminate the transaction at the completion of the first data phase. The master must rearbitrate for Address and command Data Data Data Data Data Address and command Data Data …………. Figure 2.10 Example of the burst data transfer. Zhang_Ch02.indd 219 5/13/2008 5:53:46 PM 220 INDUSTRIAL CONTROL TECHNOLOGY the bus to attempt resumption of the burst when the next data phase completes. Each burst transfer consists of the following basic components: (1) the address and the transfer type are output during the address phase; (2) a data object may then be transferred during each subsequent data phase. Assuming that neither the initiator nor the target device inserts wait states in each data phase, a data object may be transferred on the rising edge of each PCI clock cycle. At a PCI bus clock frequency of 33 MHz, a transfer rate of 132 MB/s may be achieved. A transfer rate of 264 MB/s may be achieved in a 64-bit implementation when performing 64-bit transfers during each data phase. (1) Address phase. Refer to Fig. 2.11. Every PCI transaction (with the exception of a transaction using 64-bit addressing) starts off with an address phase one PCI clock period in duration. During the address phase, the initiator identifies the target device and the type of transaction (also referred to as command type). The target device is identified by driving a start address within its assigned range onto the PCI address and data bus. At the same time, the initiator identifies the type of transaction by driving the command type onto the 4-bit wide PCI Command/Byte Enable bus. The initiator also asserts the FRAME# signal to indicate the presence of a valid start address or transaction type on the bus. Since the initiator only presents the start address and Initiator starts transaction by inserting Target latch and decode address and command Turnaround cycle, initiator stops driving AD bus Address phase 1 2 Data phase 1 Wait state 3 4 Data phase 2 Wait state 5 6 Data phase 3 Wait state 7 Data 2 Data 3 8 9 CLK Target begins to drive data back to initiator FRAME# AD C/BE# IRDY# Address Bus cmd Data 1 Byte enables Byte enables Byte enables Wait states TRDY# Data transfer DEVSEL# Target device asserts DEVSET# GNT# Figure 2.11 Typical PCI bus transactions. Zhang_Ch02.indd 220 5/13/2008 5:53:46 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 221 command for one PCI clock cycle, it is the responsibility of every PCI target device to latch the address and command on the next rising edge of the clock so that it may be decoded subsequently. By decoding the address latched from the address bus and the command type latched from the Command/Byte Enable bus, a target device can determine if it is being addressed and the type of transaction in progress. It is important to note that the initiator only supplies a start address to the target during the address phase. Upon completion of the address phase, the address or data bus becomes the data bus for the duration of the transaction and is used to transfer data in each of the data phases. It is the responsibility of the target to latch the start address and to autoincrement it to point to the next group of locations during each subsequent data transfers. (2) Data phase. Refer to Fig. 2.11. The data phase of a transaction is the period during which a data object is transferred between the initiator and the target. The number of data bytes to be transferred during a data phase is determined by the number of Command/Byte Enable signals that are asserted by the initiator during the data phase. Each data phase is at least one PCI clock period in duration. Both the initiator and the target must indicate that they are ready to complete a data phase, or the data phase is extended by a wait state one PCI CLK period in duration. The PCI bus defines ready signal lines used by both the initiator (IRDY#) and the target (TRDY#) for this purpose. The initiator does not issue a transfer count to the target. Rather, in each data phase it indicates whether it is ready to transfer the current data item and, if it is, whether it is the final data item. FRAME# is inserted at the start of the address phase and remains inserted until the initiator is ready (inserts IRDY#) to complete the final data phase. When the target samples IRDY# are inserted and FRAME# are not inserted, it realizes that this is the final data phase. Refer to Fig. 2.11. The initiator indicates that the last data transfer (of a burst transfer) is in progress by uninserting FRAME# and inserting IRDY#. When the last data transfer has been completed, the initiator returns the PCI bus to the idle state by uninserting its ready line (IRDY#). If another bus master had previously been granted ownership of the bus by the PCI bus arbiter and was waiting for the current initiator to surrender the bus, it can detect that the bus has returned to the idle state by detecting FRAME# and IRDY# both uninserted on the same rising edge of the PCI clock. Zhang_Ch02.indd 221 5/13/2008 5:53:47 PM 222 2.1.4.2 INDUSTRIAL CONTROL TECHNOLOGY Bus System Arbitration Bus masters are devices on a PCI bus that are allowed to take control of the bus. A component named bus arbiter works for this purpose. An arbiter is usually integrated into the PCI chip set; specifically, it is typically integrated into the host/PCI or the PCI/expansion bus bridge chip. Each master device is physically connected to the arbiter via a separate pair of lines, with each of them being used as REQ# (request) signal or GNT# (grant) signal, respectively. Ideally, the bus arbiter should be programmable by the system. If it is, the startup configuration software can determine the priority to be assigned to each member by reading from the maximum latency (Max_Lat) configuration register associated with each bus master (see Fig. 2.12). The bus designer hardwires this register to indicate, in increments of 250 ns, how quickly the master requires access to the bus in order to achieve adequate performance. At a given instant in time, one or more PCI bus master devices may require use of the PCI bus to perform a data transfer with another PCI device. Each requesting master asserts its REQ# output to confirm to the bus arbiter its pending request for the use of the bus. In order to grant the PCI bus to a bus master, the arbiter asserts the device’s respective GNT# signal. This grants the bus to a bus master for one transaction as given in Fig. 2.11. If a master generates a request, it is subsequently granted the bus and does not initiate a transaction by asserting FRAME# signal within 16 PCI clocks after the bus goes idle; the arbiter may assume that this bus master is malfunctioning. In this case, the action taken by the arbiter would depend upon the system design. If a bus master has another transaction to 31 0 Unit ID Status Class code BIST Header 64-byte header Man. ID Command Latency Revision CLS Base address register Reserved Reserved Expansion ROM base address Reserved Reserved Max_Lat Min_GNT INT-pin INT-line Figure 2.12 PCI configuration space. Zhang_Ch02.indd 222 5/13/2008 5:53:47 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 223 perform immediately after the one it just initiated, it should keep its REQ# line asserted when it asserts FRAME# signal to begin the current transaction. This informs the arbiter of its desire to maintain ownership of the bus after completion of the current transaction. In the event that ownership is not maintained, the master should keep its REQ# line asserted until it is successful in acquiring bus ownership again. However, at a given instant in time, only one bus master may use the bus. This means that no more than one GNT# line will be asserted by the arbiter during any PCI clock cycle. On the other hand, a master must only assert its REQ# output to signal a current need for the bus. This means that a master must not use its REQ# line to “park” the bus on itself. If a system designer implements a bus parking scheme, the bus arbiter design should indicate a default bus owner by asserting the device’s GNT# signal when no request from any bus masters are currently pending. In this manner, signal REQ # from the default master is granted immediately once no other bus masters require the use of the PCI bus. The PCI specification does not define the scheme used by the PCI bus arbiter to decide the winner of the competition when multiple masters simultaneously request bus ownership. The arbiter may utilize any scheme, such as one based on fixed or rotational priority or a combination of these two, to avoid deadlocks. However, the central arbiter is required to implement a fairness algorithm to avoid deadlocks. Fairness means that each potential bus master must be granted access to the bus independent of other requests. Fairness is defined as a policy that ensures that high-priority masters will not dominate the bus to the exclusion of lower priority masters when they are continually requesting the bus. However, this does not mean that all agents are required to have equal access to the bus. By requiring a fairness algorithm there are no special conditions to handle when the signal LOCK# is active (assuming a resource lock) or when cacheable memory is located on PCI. A system that uses a fairness algorithm is still considered fair if it implements a complete bus lock instead of resource lock. However, the arbiter must advance to a new agent if the initial transaction attempting to establish a lock is terminated with retry. 2.1.4.3 Interrupt Routing The host/PCI bus bridge will transfer the interrupt acknowledgment cycle from the processor to the PCI bus, which requires the microprocessor chipset having an interrupt routing functionality. This router for the interrupt routing could be implemented using an Intel APIC I/O module as given in Figs 2.3(a) and 2.4. The APIC I/O module can be programmed to Zhang_Ch02.indd 223 5/13/2008 5:53:47 PM 224 INDUSTRIAL CONTROL TECHNOLOGY assign a separate interrupt vector (interrupt table entry number) for each of the PCI interrupt request lines. It can also be programmed so that it realizes that one of its inputs is connected to an Intel programmable interrupt controller. If a system does not have this kind of programmable interrupt controller, the microprocessor chipset should incorporate a software programmable interrupt routine device. In this case, the startup configuration software of the microprocessor attempts to program the router to distribute the PCI interrupt in an optimal fashion. Whenever any of the PCI interrupt request lines is asserted, the APIC I/O module supplies the vector (see Fig. 2.6 for an interrupt vector table) associated with that input to the processor’s embedded local APIC I/O module. Whenever this programmable interrupt controller generates a request, the APIC I/O informs the processor that it must poll this programmable interrupt controller to get this vector. In response, the Intel processor can generate two back-to-back Interrupt Acknowledge transactions. The first Interrupt Acknowledge forces this programmable interrupt controller to prioritize the interrupts pending, while the second Interrupt Acknowledge requests that the interrupt controller send the vector to the processor. For a detailed discussion of APIC operation, refer to the MindShare book entitled Pentium Processor System Architecture (published by Addison-Wesley). For a detailed description of the Programmable Interrupt Controller chipset, refer to Section 2.2.2. Figure 2.11 can also be used to explain an interrupt acknowledgment cycle on the PCI bus, where a single byte enable is asserted. The PCI bus performs only one interrupt acknowledgment cycle per interrupt. Only one device may respond to the interrupt acknowledgment; that device must assert DEVSEL# indicating that it is claiming the interrupt acknowledgment. The sequence is as follows: (1) During the address phase, the AD signals do not contain a valid address; they must be driven with stable data so that parity can be checked. The C/BE# signals contain the interrupt acknowledge command code (not shown). (2) IRDY# and the BE#s are driven by the host/PCI bus bridge to indicate that the bridge (master), is ready for response. (3) The target will drive DEVSEL# and TRDY# along with the vector on the data bus (not shown). 2.1.4.4 Configuration Registers Each PCI device has 256 bytes of configuration data, which is arranged as 64 registers of 32 bits. It contains a 64-byte predefined header followed Zhang_Ch02.indd 224 5/13/2008 5:53:47 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 225 by an extra 192 bytes which contain extra configuration data. Figure 2.12 shows the arrangement of the header. The definitions of the fields in this header are as follows: (1) Unit ID and Man. ID. A Unit ID of FFFFh defines that there is no unit installed, while any other address defines its ID. The PCI SIG, which is the governing body for the PCI specification, allocates a Man. ID. This ID is normally shown at BIOS start-up. (2) Status and command (3) Class code and revision. The class code defines PCI device type. It splits into two 8-bit values with a further 8-bit value that defines the programming interface for the unit. The first defines the unit classification, followed by a subcode which defines the actual type. (a) BIST, header, latency, CLS. The built-in-self test (BIST) is an 8-bit field, where the most significant bit defines if the device can carry out a BIST, the next bit defines if a BIST is to be performed (a 1 in this position indicates that it should be performed), and bits 3–0 define the status code after the BIST has been performed (a value of zero indicates no error). The header field defines the layout of the 48 bytes after the standard 16-byte header. The most significant bit of the header field defines whether the device is a multifunction device or not. A 1 defines a multifunction unit. The cache line size (CLS) field defines the size of the cache in units of 32 bytes. Latency indicates the length of time for a PCI bus operation, where the amount of time is the latency + 8 PCI clock cycles. (b) Base address register. This area of memory allows the device to be programmed with an I/O or memory address area. It can contain a number of 32- or 64-bit addresses. The format of a memory address is (i) Bit 64-4: base address; (ii) Bit 3: PRF. Prefetching, 0 identifies not possible, 1 identifies possible; (iii) Bit 2, 1: Type. 00—any 32-bit address, 01—less than 1 MB, 10—any 64-bit address, and 11—reserved; (iv) Bit 0: 0. Always set a 0 for a memory address. For an I/O address space it is defined as: (i) Bit 31-2: base address; (ii) Bit 1, 0: 01. Always set to a 01 for an I/O address. (c) Expansion ROM base address. It allows a ROM expansion to be placed at any position in the 32-bit memory address area. (d) Max_Lat, Min_GNT, INT-pin, INT-line. The Min_GNT and Max_Lat registers are read-only registers that define minimum Zhang_Ch02.indd 225 5/13/2008 5:53:47 PM 226 INDUSTRIAL CONTROL TECHNOLOGY and maximum latency values. The INT-line field is a 4-bit field that defines the interrupt line used (IRQ0–IRQ15). A value of 0 corresponds to IRQ0 and a value of 15 corresponds to IRQ15. The PCI bridge can then redirect this interrupt to the correct IRQ line. The 4-bit INT pin defines the interrupt line that the device is using. A value of 0 defines no interrupt line, 1 defines INTA, 2 defines INTB, and so on. 2.2 Programmable Peripheral Devices A programmable peripheral device is designed to perform various interface functions. Such a device can be set up to perform specific functions by writing an instruction (or instructions) in its internal register, called the control register. Furthermore, function can be changed any time during execution of the program by writing a new instruction in the control register. These devices are flexible, versatile, and economical; they are widely used in microprocessor-based products. In a programmable device, on the other hand, functions are determined through software instructions. A programmable peripheral device can not only be viewed as a multiple I/O device, but it also performs many other functions, such as time delay, interrupt handling, and graphic user– machine interactions, etc. In fact, it consists of many devices on a single chip, interconnected through a common bus. This is a hardware approach through software control to performing the I/O functions, discussed earlier in this chapter. This approach, a trade-off between hardware and software, should reduce programming efforts. This section describes five typical programmable peripheral devices that are the programmable I/O ports: interrupt, controller, timer, CMOS, and DMA. 2.2.1 Programmable Peripheral I/O Ports The programmable peripheral interface (PPI), especially the 8255 Programmable Peripheral I/O Interface, is a very popular and versatile input and output chip that is easily configured to function in several different configurations. The 8255 is used on several ranges of cards that plug into an available slot in controllers or computers. This chip allows the use of both digital input and output (DIO) with controllers or computers. As illustrated in Fig. 2.13, each 8255 Programmable Peripheral I/O Interface has three off 8-bit TTL-compatible I/O ports that will allow the Zhang_Ch02.indd 226 5/13/2008 5:53:47 PM 227 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL D0-D7 Data bus buffer RD WR A0 A1 Reset Read/write control logic GA control GB control I n t e r n a l d a t a PA PA0-PA7 PCU PC4-PC7 PCL PC0-PC3 CS b u s PB PB0-PB7 Figure 2.13 8255 Programmable peripheral I/O interface functional blocks. control of up to 24 individual outputs or 24 individual inputs or both input or output. For example, they can be attached to a robotic device to control movement by use of motors to control motion and switches to detect position, etc. Addressing ports is different from addressing memory. Ports have port addresses and memory has memory addresses; port address 1234 is different from memory address 1234. The 8255 Programmable Peripheral I/O Interface cards use port addresses and cannot be set to use memory addresses (see Table 2.2). The 8255 Programmable Peripheral I/O Interface cards plug into any available 8- or 16-bit slot (also known as an AT or ISA slot) on the motherboard of a controller or a computer, just like a sound card or disk drive controller card does with personal computers. The CPU of the motherboard communicates with cards by knowing the card’s address and sending data to it. By physically using jumpers on the card, we can assign a set of addresses to the card; then in software, we can tell the CPU what these addresses are (more about this in the programming section). The first thing that must be done, before the chip can be used, is to tell it which configuration is required. The configuration tells the 8255 whether ports are input or output and even some strange arrangements called bidirectional and strobed. The 8255 allows for three distinct operating modes (modes 0, 1, and 2) as follows: (1) Mode 0—Basic input/output. Ports A and B operate as either inputs or outputs and Port C is divided into two 4-bit groups either of which can be operated as inputs or outputs. Zhang_Ch02.indd 227 5/13/2008 5:53:47 PM 228 INDUSTRIAL CONTROL TECHNOLOGY Table 2.2 DC-0600 Addresses Options address 8255 8255Port Port 1A Port 1B Port 1C Port 1 Control register Port 2A Port 2B Port 2C Port 2 Control register Option 1: Default (JP2 linked) Option 2 (JP2 open) Address [Hex (decimal)] 300H (768) 301H (769) 302H (770) 303H (771) 304H (772) 305H (773) 306H (774) 307H (775) Address [Hex (decimal)] 360H (864) 361H (865) 362H (866) 363H (867) 364H (868) 365H (869) 366H (870) 367H (871) (2) Mode 1—Strobed input/output. Same as Mode 0 but Port C is used for handshaking and control. (3) Mode 2—Bidirectional bus. Port A is bidirectional (both input and output) and Port C is used for handshaking. Port B is not used. For most applications using this range of cards, mode 0 will be used. Each of the 3 ports has 8 bits, and each of these bits can be individually set ON or OFF, somewhat like having three banks of eight light switches. These bits are configured in groups to be inputs or outputs allowing their function to either read data into the computer or control data out of the computer. The various modes can be set by sending a value to the control port. The control port is Base Address + 3 (i.e., 768 + 3 = 771 decimal). Table 2.3 shows the different arrangements that can be configured and the values to be sent to the configuration port. Table 2.3 8255 Control Register Configuration (Mode 0) Controlword [Hex(Dec)] Port A Port B 80H (128) 82H (130) 85H (133) 87H (135) 88H (136) 8AH (138) 8CH (140) 8FH (143) OUT OUT OUT OUT IN IN IN IN OUT IN OUT IN OUT IN OUT IN Zhang_Ch02.indd 228 5/13/2008 5:53:48 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 229 As mentioned, the control port is Base Address + 3. Port A is always at Base Address; Port B is Base Address + 1; Port C is Base Address + 2. Thus, in our example Ports A, B, and C are at 768, 769, and 770 (decimal), respectively. By writing, say, 128, the control port will then configure the 8255 to have all three ports set for output. 2.2.2 Programmable Interrupt Controller Chipset Both microcontroller and microcomputer system designs require that I/O devices such as keyboards, displays, sensors, and other components receive servicing in an efficient manner so that large amounts of the total system tasks can be assumed by the microcomputer with little or no effect on throughput. As mentioned in Section 2.1.2, there are two common methods of servicing such devices: the first method is the polled approach; the second is a more desirable method called interrupt that allows the microprocessor to continue executing its main program and only stop to service peripheral devices when it is told to do so by the device itself. The programmable interrupt controller (PIC) functions as an overall manager in an interrupt-driven system environment. It accepts requests from the peripheral equipment, determines which of the incoming requests is of the highest importance (priority), ascertains whether the incoming request has a higher priority value than the level currently being serviced, and issues an interrupt to the CPU based on this determination. The PIC, after issuing an interrupt to the CPU, must somehow input information into the CPU that can “point” the program counter to the service routine associated with the requesting device. This “pointer” is an address in a vectoring table and will often be referred to, in this document, as vectoring data. The 8259A is taken as an example of the PIC. It manages eight levels or requests and has built-in features for expandability to other 8259As (up to 64 levels). It is programmed by the system’s software as an I/O peripheral. A selection of priority modes is available to the programmer so that the manner in which the requests are processed by the 8259A can be configured to match system requirements. The priority modes can be changed or reconfigured dynamically at any time the main program is executing. This means that the complete interrupt structure can be defined on the requirements of the total system environment. Figure 2.14 gives the block function diagram of 8259A PIC, which includes these function blocks and pins: (1) Interrupt request register (IRR) and in-service register (ISR). The interrupts at the IR input lines are handled by two registers Zhang_Ch02.indd 229 5/13/2008 5:53:48 PM 230 INDUSTRIAL CONTROL TECHNOLOGY INTAn INT Control logic D[7..0] RDn WRn CSn A0 RESET Data bus buffer Read/write logic In-service register Priority resolver Interrupt request register IR0 IR1 IR2 IR3 IR4 IR5 IR6 IR7 CAS0 CAS1 CAS2 Cascade buffer/ comparator Interrupt mask register SPnENn Figure 2.14 8259A PIC block diagram. in cascade, the IRR and the ISR. The IRR is used to store all the interrupt levels that are requesting service, and the ISR is used to store all the interrupt levels that are being serviced. (2) Priority resolver. This logic block determines the priorities of the bits set in the IRR. The highest priority is selected and strobed into the corresponding bit of the ISR during INTA pulse. (3) Interrupt mask register (IMR). The IMR stores the bits that mask the interrupt lines to be masked. The IMR operates on the IRR. Masking of a higher priority input will not affect the interrupt request lines of lower priority. (4) INT (interrupt). This output goes directly to the CPU interrupt input. The VOH level on this line is designed to be fully compatible with the 8080A, 8085A, and 8086 input levels. (5) INTA (interrupt acknowledge). INTA pulses will cause the 8259A to release vectoring information onto the data bus. The format of this data depends on the system mode (mPM) of the 8259A. (6) Data bus buffer. This three-state, bidirectional 8-bit buffer is used to interface the 8259A to the system data bus. Control words and status information are transferred through the data bus buffer. (7) Read/write control logic. The function of this block is to accept OUTPUT commands from the CPU. It contains the initialization command word (ICW) registers and operation command word (OCW) registers that store the various control formats for device operation. This function block also allows the status of the 8259A to be transferred onto the data bus. Zhang_Ch02.indd 230 5/13/2008 5:53:48 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 231 (8) CS (chip select). A LOW on this input enables the 8259A. No reading or writing of the chip will occur unless the device is selected. (9) WR (write). A LOW on this input enables the CPU to write control words (ICWs and OCWs) to the 8259A. (10) RD (read). A LOW on this input enables the 8259A to send the status of the IRR, ISR, IMR, or the interrupt level onto the data bus. (11) A0. This input signal is used in conjunction with WR and RD signals to write commands into the various command registers, as well as reading the various status registers of the chip. This line can be tied directly to one of the address lines. (12) The cascade buffer/comparator. This function block stores and compares the IDs of all 8259A’s used in the system. The associated three I/O pins (CAS0-2) are outputs when the 8259A is used as a master and are inputs when the 8259A is used as a slave. As a master, the 8259A sends the ID of the interrupting slave device onto the CAS0 ± 2 lines. The slave thus selected will send its preprogrammed subroutine address onto the data bus during the next one or two consecutive INTA pulses. The powerful features of the 8259A in a microcomputer system are its programmability and the interrupt routine addressing capability. The latter allows direct or indirect jumping to the specific interrupt routine requested without any polling of the interrupting devices. The normal sequence of events during an interrupt depends on the type of CPU being used. The events occur as follows in an MCS-80/85 system: (a) One or more of the INTERRUPT REQUEST lines (IR7 ± 0) are raised high, setting the corresponding IRR bit(s). (b) The 8259A evaluates these requests and sends an INT to the CPU, if appropriate. (c) The CPU acknowledges the INT and responds with an INTA pulse. (d) Upon receiving an INTA from the CPU group, the highest priority ISR bit is set, and the corresponding IRR bit is reset. The 8259A will also release a CALL instruction code (11001101) onto the 8-bit data bus through its D7 ± 0 pins. (e) This CALL instruction will initiate two more INTA pulses to be sent to the 8259A from the CPU group. (f) These two INTA pulses allow the 8259A to release its preprogrammed subroutine address onto the data bus. The lower 8-bit address is released at the first INTA pulse and the higher 8-bit address is released at the second INTA pulse. Zhang_Ch02.indd 231 5/13/2008 5:53:48 PM 232 INDUSTRIAL CONTROL TECHNOLOGY (g) This completes the 3-byte CALL instruction released by the 8259A. In the AEOI mode the ISR bit is reset at the end of the third INTA pulse. Otherwise, the ISR bit remains set until an appropriate EOI command is issued at the end of the interrupt sequence. The events occurring in an 8086 system are the same until the fourth step; from the fourth step onward: (d) Upon receiving an INTA from the CPU group, the highest priority ISR bit is set and the corresponding IRR bit is reset. The 8259A does not drive the data bus during this cycle. (e) The 8086 will initiate a second INTA pulse. During this pulse, the 8259A releases an 8-bit pointer onto the data bus where it is read by the CPU. (f) This completes the interrupt cycle. In the AEOI mode the ISR bit is reset at the end of the second INTA pulse. Otherwise, the ISR bit remains set until an appropriate EOI command is issued at the end of the interrupt subroutine. If no interrupt request is present at step (d) of either sequence (i.e., the request was too short in duration) the 8259A will issue an interrupt level 7. Both the vectoring bytes and the CAS lines will look like an interrupt level 7 was requested. When the 8259A PIC receives an interrupt, INT becomes active and an interrupt acknowledge cycle is started. If a higher priority interrupt occurs between the two INTA pulses, the INT line goes inactive immediately after the second INTA pulse. After an unspecified amount of time the INT line is activated again to signify the higher priority interrupt waiting for service. This inactive time is not specified and can vary between parts. The designer should be aware of this consideration when designing a system that uses the 8259A. It is recommended that proper asynchronous design techniques be followed. Advanced programmable interrupt controllers (APICs) are designed to attempt to solve interrupt routing efficiency issues in multiprocessor computer systems. There are two components in the Intel APIC system: the local APIC (LAPIC) and the IOAPIC. The LAPIC is integrated into each CPU in the system, and the IOAPIC is used throughout the system’s peripheral buses. There is typically one IOAPIC for each peripheral bus in the system. In the original system designs, LAPICs and IOAPICs were connected by a dedicated APIC bus. Newer systems use the system bus for communication between all APIC components. LAPICs manage all external interrupts for the processor that it is part of. In addition, they are able to accept and generate interprocessor interrupts (IPIs) between LAPICs. LAPICs may support up to 224 usable IRQ vectors Zhang_Ch02.indd 232 5/13/2008 5:53:48 PM 233 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL from an IOAPIC. Vectors numbers 0–31, out of 0–255, are reserved for exception handling by x86 processors. IOAPICs contains a redirection table, which is used to route the interrupts it receives from peripheral buses to one or more LAPICs. 2.2.3 Programmable Timer Controller Chipset The programmable timer controller provides a programmable interval timer and counter that are designed for use with microcomputer systems to solve one of the most common problems in any microcomputer system: the generation of accurate time delays under software control. Instead of setting up timing loops in software, the programmer configures the programmable timer controller to match the requirements and programs one of the counters for the desired delay. After the desired delay, the programmable timer controller will interrupt the CPU. Software overhead is minimal and variable length delays can easily be accommodated. Some of the other computer and timer functions common to microcomputers that can be implemented with it are real-time clock, event counter, digital one shot, programmable rate generator, square wave generator, binary rate multiplier, complex waveform generator, and complex motor controller. Figure 2.15 gives the typical function blocks for an 82C54 programmable interval timer controller, which has these main blocks: (1) Data bus buffer. This three-state, bidirectional 8-bit buffer is used to interface the 82C54 to the system bus. CLK 0 D7–D0 8 Counter 0 Data bus buffer OUT 0 RD WR Read/ write logic Control word register Internal bus A0 A1 GATE 0 Counter 1 CLK 1 GATE 1 OUT 1 CLK 2 Counter 0 GATE 2 OUT 2 Figure 2.15 82C54 Programmable timer controller function blocks. Zhang_Ch02.indd 233 5/13/2008 5:53:48 PM 234 INDUSTRIAL CONTROL TECHNOLOGY (2) Read/write logic. The read/write logic accepts inputs from the system bus and generates control signals for the other functional blocks of the 82C54. A1 and A0 select one of the three counters on the control word register to be read from or written into. A “low” on the RD input tells the 82C54 that the CPU is reading one of the counters. A “low” on the WR input tells the 82C54 that the CPU is writing either a control word or an initial count. Both RD and WR are qualified by CS; RD and WR are ignored unless the 82C54 has been selected by holding CS low. (3) Control word register. The control word register is selected by the read/write logic when A1, A0 = 11. If the CPU then does a write operation to the 82C54, the data is stored in the control word register and is interpreted as a control word used to define the counter operation. The control word register can only be written to. (4) Counter 0, Counter 1, Counter 2. These three functional blocks are identical in operation, so only a single counter will be described. The counters are fully independent. Each counter may operate in a different mode. The programmable timer is normally treated by the system software as an array of peripheral I/O ports; three are counters and the fourth is a control register for mode programming. Basically, the select inputs A0, A1 connects to the A0, A1 address bus signals of the CPU. The CS can be derived directly from the address bus using a linear select method or it can be connected to the output of a decoder. After power-up, the state of the programmable timer is undefined. The mode, count value, and output of all counters are undefined. How each counter operates is determined when it is programmed. Each counter must be programmed before it can be used. Unused counters need not be programmed. Counters are programmed by writing a control word and then an initial count. All control words are written into the control word register, which is selected when A1, A0 = 11. The control word specifies which counter is being programmed. By contrast, initial counts are written into the counters, not the control word register. The A1, A0 inputs are used to select the counter to be written into. The format of the initial count is determined by the control word used. (a) Write operations. A new initial count may be written to a counter at any time without affecting the counter’s programmed mode in any way. Counting will be affected as described in the mode definitions. The new count must follow the programmed count format. If a counter is programmed to read and write 2-byte counts, Zhang_Ch02.indd 234 5/13/2008 5:53:49 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 235 the following precaution applies. A program must not transfer control between writing the first and second byte to another routine that also writes into that same counter. Otherwise, the counter will be loaded with an incorrect count. (b) Read operations. There are three possible methods for reading the counters. The first is through the read-back command. The second is a simple read operation of the counter, which is selected with the A1, A0 inputs. The only requirement is that the CLK input of the selected counter must be inhibited by using either the GATE input or external logic. Otherwise, the count may be in the process of changing when it is read, giving an undefined result. 2.2.4 CMOS Chipset The complementary metal oxide semiconductor (CMOS) chip is battery-powered and stores the hard drive’s configuration and other information. In a microcomputer and a microcontroller, CMOS chips normally provide two functions: real-time clock (RTC) and CMOS memory. The real-time clock provides the board with time-of-day clock, periodic interrupt, and system configuration information to a microcomputer or a microcontroller. With respect to personal computers, CMOS chipset typically contains 64 (00hex-3Fhex) 8-bit locations of battery-backed up CMOS RAM (random access memory). The split is (1) 00hex-0Ehex, used for real-time clock functions (time of day), (2) 0Fhex-35hex, used for system configuration information, for example, hard drive type, memory size, etc., and (3) 36hex-3Fhex, used for power-on password storage. The CMOS memory is an accessible set of memory locations on the same chip as the RTC and has its own battery backup so that it retains both functions, even when the computer is turned off. Battery-powered CMOS and RTCs did not originally exist and the current time was entered manually every time the system was turned on. This memory location in CMOS is separate and apart from the RTC registers and there are several ways to update it. Specifically, the BIOS can update the century information, as can many operating systems, network time systems, and applications, or the user can set it using the right commands. 2.2.5 Direct Memory Access Controller Chipset Direct memory access (DMA) is an I/O technique commonly used for high-speed data transfer among internal memories, I/O ports, and peripherals, and also between the memories and I/O devices on different chipsets. Zhang_Ch02.indd 235 5/13/2008 5:53:49 PM 236 INDUSTRIAL CONTROL TECHNOLOGY DMA technique allows the microprocessor to release the control of the buses to a device called a DMA controller. The DMA controller manages data transfer between memory and a peripheral under its control, thus bypassing the microprocessor. The microprocessor communicates with the controller by using the chip select line, buses, and control signals. However, once the controller has gained control, it plays the role of a microprocessor for data transfer. For all practical purposes, the DMA controller is a microprocessor capable only of copying data at high speed from one location to another location. As an illustration, a programmable DMA controller, the Intel 8237A programmable DMA controller, is described below. The 8237A block diagram given in Fig. 2.16 includes the major logic blocks and all of the internal registers. The data interconnection paths are also shown. Not shown are the various control signals between the blocks. The 8237A contains 344 bits of internal memory in the form of registers. Table 2.4 lists these registers by name and shows the size of each. The 8237A contains three basic blocks of control logic. The Timing Control block generates internal timing and external control signals for the 8237A. The Program Command Control block decodes the various commands RESET CLK CSN Ready IORNIN IOWNIN EOPNIN AEN ADSTB EOPNOUT MEMRN MEMWN IORNOUT IOWNOUT 16-bit incrementor/ decrementor temp address reg 16-bit decrementor temp word count reg Timing and control Channel-3 Channel-2 AOUT [7..0] C8237REG Channel-1 Channel-0 Read/write State machine Current word count register Current word address register Write Base word address register Base word count register HLDA DBOUT [7..0] DREQ [3.0] HRQ DACK [3..0] Fixed priority and rotating priority logic Command register DBIN [7..0] Mask register AIN [3..0] Request register Mode register Status register Temporary register Figure 2.16 Intel 8237A DMA controller block diagram. Zhang_Ch02.indd 236 5/13/2008 5:53:49 PM 237 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL Table 2.4 8237A DMA Controller Internal Registers Name Base address registers Base word count registers Current address registers Current word count registers Temporary address register Temporary word count register Status register Command register Temporary register Mode registers Mask register Request register Size (bits) Number 16 16 16 16 16 16 8 8 8 6 4 4 4 4 4 4 1 1 1 1 1 4 1 1 given to the 8237A by the microprocessor prior to servicing a DMA request. It also decodes the mode control word used to select the type of DMA during the servicing. The Priority Encoder block resolves priority contention between DMA channels requesting service simultaneously. To perform block moves of data from one memory address space to another with a minimum of program effort and time, the 8237A includes a memory-to-memory transfer feature. Programming a bit in the command register selects channels 0 and 1 to operate as memory-to-memory transfer channels. The transfer is initiated by setting the software DREQ for channel 0. The 8237A requests a DMA service in the normal manner. After HLDA is true, the device, using four state transfers in block transfer mode, reads data from the memory. The channel 0 current address register is the source for the address used and is decremented or incremented in the normal manner. The data byte read from the memory is stored in the 8237A internal temporary register. Channel 1 then performs a four-state transfer of the data from the temporary register to memory using the address in its current address register and incrementing or decrementing it in the normal manner. The channel 1 current word count is decremented. When the word count of channel 1 goes to FFFFH, a TC is generated causing an EOP output terminating the service. Channel 0 may be programmed to retain the same address for all transfers. This allows a single word to be written to a block of memory. The 8237A will respond to external EOP signals during memory-to-memory transfers. Data comparators in block search schemes may use this input to terminate the service when a match is found. Zhang_Ch02.indd 237 5/13/2008 5:53:49 PM 238 INDUSTRIAL CONTROL TECHNOLOGY The 8237A will accept programming from the host processor any time that the HLDA is inactive; this is true even if HRQ is active. The responsibility of the host is to ensure that programming and HLDA are mutually exclusive. Note that a problem can occur if a DMA request occurs on an unmasked channel while the 8237A is being programmed. For instance, the CPU may be starting to reprogram the 2-byte address register of channel 1 when channel 1 receives a DMA request. If the 8237A is enabled (bit 2 in the command register is 0) and channel 1 is unmasked, a DMA service will occur after only 1 byte of the address register has been reprogrammed. This can be avoided by disabling the controller (setting bit 2 in the command register) or masking the channel before programming any other registers. Once the programming is complete, the controller can be enabled and unmasked. After power-up it is suggested that all internal locations, especially the mode registers, be loaded with some valid value. This should be done even if some channels are unused. An invalid mode may force all control signals to go active at the same time. The 8237A is designed to operate in two major cycles. These are called idle and active cycles. Each device cycle is made up of a number of states. The 8237A can assume seven separate states, each composed of one full clock period. State I (SI) is the inactive state. It is entered when the 8237A has no valid DMA requests pending. While in SI, the DMA controller is inactive but may be in the program condition, being programmed by the processor. State S0 (S0) is the first state of a DMA service. The 8237A has requested a hold but the processor has not yet returned an acknowledge. The 8237A may still be programmed until it receives HLDA from the CPU. An acknowledge from the CPU will signal that DMA transfers may begin. S1, S2, S3, and S4 are the working states of the DMA service. If more time is needed to complete a transfer than is available with normal timing, wait states (SW) can be inserted between S2 or S3 and S4 by the use of the ready line on the 8237A. Eight states are required for a single transfer. The first four states (S11, S12, S13, S14) are used for the readfrom-memory half and the last four states (S21, S22, S23, S24) for the write-to-memory half of the transfer. 2.2.5.1 Idle Cycle When no channel is requesting service, the 8237A will enter the idle cycle and perform “SI” states. In this cycle the 8237A will sample the DREQ lines every clock cycle to determine whether any channel is requesting a DMA service. The device will also sample CS, looking for an attempt by the microprocessor to write or read the internal registers of the 8237A. Zhang_Ch02.indd 238 5/13/2008 5:53:49 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 239 When CS is low and HLDA is low, the 8237A enters the program condition. The CPU can now establish, change, or inspect the internal definition of the part by reading from or writing to the internal registers. Address lines A0 ± A3 are inputs to the device and select which registers will be read or written. The IOR and IOW lines are used to select and time reads or writes. Special software commands can be executed by the 8237A in the program condition. These commands are decoded as sets of addresses with the CS and IOW. The commands do not make use of the data bus. Instructions include Clear First/Last Flip-Flop and Master Clear. 2.2.5.2 Active Cycle When the 8237A is in the idle cycle and a nonmasked channel requests a DMA service, the device will output an HRQ to the microprocessor and enter the active cycle. It is in this cycle that the DMA service will take place, in one of four modes: (1) Single transfer mode. In single transfer mode the device is programmed to make one transfer only. The word count will be decremented and the address decremented or incremented following each transfer. When the word count “rolls over” from 0 to FFFFH, a terminal count (TC) will cause an autoinitialize if the channel has been programmed to do so. DREQ must be held active until DACK becomes active in order to be recognized. If DREQ is held active throughout the single transfer, HRQ will go inactive and release the bus to the system. It will again go active and, upon receipt of a new HLDA, another single transfer will be performed. Details of timing between the 8237A and other bus control protocols will depend upon the characteristics of the microprocessor involved. (2) Block transfer mode. In block transfer mode the device is activated by DREQ to continue making transfers during the service until a TC, caused by word count going to FFFFH, or an external end of process (EOP) is encountered. DREQ need only be held active until DACK becomes active. Again, an autoinitialization will occur at the end of the service if the channel has been programmed for it. (3) Demand transfer mode. In demand transfer mode the device is programmed to continue making transfers until a TC or external EOP is encountered or until DREQ goes inactive. Thus, transfers may continue until the I/O device has exhausted its data capacity. After the I/O device has had a chance to catch up, the DMA service is reestablished by means of a DREQ. During the time Zhang_Ch02.indd 239 5/13/2008 5:53:49 PM 240 INDUSTRIAL CONTROL TECHNOLOGY between services when the microprocessor is allowed to operate, the intermediate values of address and word count are stored in the 8237A current address and current word count registers. Only an EOP can cause an autoinitialize at the end of the service. EOP is generated either by TC or by an external signal. DREQ has to be low before S4 to prevent another transfer. (4) Cascade mode. This mode is used to cascade more than one 8237A together for simple system expansion. The HRQ and HLDA signals from the additional 8237A are connected to the DREQ and DACK signals of a channel of the initial 8237A. This allows the DMA requests of the additional device to propagate through the priority network circuitry of the preceding device. The priority chain is preserved and the new device must wait for its turn to acknowledge requests. Since the cascade channel of the initial 8237A is used only for prioritizing the additional device, it does not output any address or control signals of its own. These could conflict with the outputs of the active channel in the added device. The 8237A will respond to DREQ and DACK but all other outputs except HRQ will be disabled. The ready input is ignored. Each of the three active transfer modes above can perform three different types of transfers. These are read, write, and verify. Write transfers move data from an I/O device to the memory by activating MEMW and IOR. Read transfers move data from memory to an I/O device by activating MEMR and IOW. Verify transfers are pseudotransfers. The 8237A operates as in read or write transfers generating addresses, and responding to EOP, etc. However, the memory and I/O control lines all remain inactive. The ready input is ignored in verify mode. 2.3 Application-Specific Integrated Circuit (ASIC) ASIC is basically an integrated circuit designed specifically for a special purpose or application. Strictly speaking, this also implies that an ASIC is built for one and only one customer. The opposite of an ASIC is a standard product or general purpose IC, such as a logic gate or a general purpose microcontroller, both of which can be used in any electronic application by anybody. ASICs are usually classified into one of three categories: full custom, semi-custom, and structured as listed below. (1) Full-custom ASICs are those that are entirely tailor-fitted to a particular application from the very start. Since ultimate design Zhang_Ch02.indd 240 5/13/2008 5:53:49 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 241 and functionality are prespecified by the user, they are manufactured with all the photolithographic layers of the device already fully defined, just like most off-the-shelf general purpose ICs. A full-custom ASIC cannot be modified to suit different applications, and it is generally produced as a single, specific product for a particular application only. (2) Semi-custom ASICs, on the other hand, can be partly customized to serve different functions within their general area of application. Unlike full-custom ASICs, semi-custom ASICs are designed to allow a certain degree of modification during the manufacturing process. A semi-custom ASIC is manufactured with the masks for the diffused layers already fully defined, so the transistors and other active components of the circuit are already fixed for that semi-custom ASIC design. The customization of the final ASIC product to the intended application is done by varying the masks of the interconnection layers, for example, the metallization layers. (3) Structured or platform ASICs, which belong to a relatively new ASIC classification, are those that have been designed and produced from a tightly defined set of (1) design methodologies, (2) intellectual properties, and (3) well-characterized silicon, aimed at shortening the design cycle and minimizing the development costs of the ASIC. A platform ASIC is built from a group of “platform slices,” with a platform slice being defined as a premanufactured device, system, or logic for that platform. Each slice used by the ASIC may be customized by varying its metal layers. The reuse of premanufactured and precharacterized platform slices simply means that platform ASICs are not built from scratch, thereby minimizing design cycle time and costs. There are two types of programmable ASIC: programmable logic devices (PLD) and field-programmable gate arrays (FPGA). The distinction between the two is blurred. The only real difference is their heritage. In this section, these two types of programmable ASICs are discussed, respectively. ASICs have been widely used in various industrial control applications. Examples of ASICs include (1) an IC that encodes and decodes digital data using a proprietary encoding and decoding algorithm, (2) a medical IC designed to monitor a specific human biometric parameter, (3) an IC designed to serve a special function within a factory automation system, (4) an amplifier IC designed to meet certain specifications not available in standard amplifier products, (5) a proprietary system-on-a-chip, and (6) an IC that is custom-made for particular automated test equipment. Zhang_Ch02.indd 241 5/13/2008 5:53:49 PM 242 INDUSTRIAL CONTROL TECHNOLOGY 2.3.1 ASIC Designs ASICs are used to design entire systems on a single chip. ASICs are interconnects of standard cells that have been standardized by fabrication houses. With the integration of more and more system components on a single IC, the complexity of IC fabrication has increased. An advanced system design involves complex layout issues. Specifications of cells are provided by the vendors in the form of a technology library that contains information about geometry, delay, and power characteristics of cells. Design flow of ASIC is highly automated. These automation tools provide reasonable performance and cost advantage over manual design process. Broadly, ASIC design flow can be divided into these phases given below in this subsection, which is also illustrated in Fig. 2.17. 2.3.1.1 ASIC Specification ASIC design specifications are written by designers at different levels of abstraction. Most common hardware specification languages used by designers are Verilog and VHDL. Both these languages are equally capable of providing complex constructs to describe complex functionality. Behavioral modeling forms the highest level of abstraction. (1) Behavioral specification. At the initial stage of the design process, the designer provides a behavioral specification of the functionality intended. The behavioral model does not care about the structure of the design, combinational, or sequential elements used in the design, clock signal, and the timing Design specification HDL (Verilog and VHDL) Technology library Design rule constraints Syntheses Simulation Place and Route Extraction Manufacture Post layout analysis Figure 2.17 ASIC design flow. Zhang_Ch02.indd 242 5/13/2008 5:53:50 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 243 constraints involved. It captures the intended behavior of the design. It is important to note that this specification does not capture timing information. (2) RTL specification. RTL stands for register transfer level. In this model the entire design is split into registers with flow of information between these registers at each clock cycle. RTL specification captures the change in design at each clock cycle. All the registers are updated at the same time in a clock cycle. Typically an RTL specification divides a design into registers and the logic blocks that join those registers together. RTL captures the data flow but fails to give a good specification of control flow. (3) Structural specification. Structural specification consists of a network of instances of logic gates and registers described by a technology library. Technology library is provided by fabrication houses. Technology library is a specification of simple AND, OR, NOT, and complicated multiple functionality cells. The specification of a cell includes its geometry, delay, and power characteristics. Structural modeling describes circuits in the form of instances of cells and interconnects between those cells. 2.3.1.2 ASIC Functional Simulation Logic simulation is an essential part of digital circuit design. Logic simulation and verification are used to verify the functionality described by a design specification against output values expected at the output ports of a digital integrated circuit. There are mainly three classes of logic simulators given below: (1) Compiled code logic simulator. Compiled code logic simulation algorithm evaluates every logic element in the design at each time step. The earliest logic simulators were compiled code simulators. In a compiled code simulator a combinational circuit is topologically ordered and an equation is generated for each gate output in terms of its inputs using Boolean operators AND, OR, and NOT. A compiled code simulator evaluates every circuit element for every new input pattern. Two limitations of compiled code simulators are (1) their inability to handle asynchronous feedback and (2) lack of accurate timing and delay information in their models. Also since circuit activity is very low at each element, run time of such algorithm is huge for big circuits. A large part of the design cycle is taken up by circuit simulation. (2) Interpretive event-driven logic simulator. An event-driven logic simulator works on the principle that output of a logic element Zhang_Ch02.indd 243 5/13/2008 5:53:50 PM 244 INDUSTRIAL CONTROL TECHNOLOGY changes only when one of its inputs changes. An event-driven logic simulator evaluates a logic element when an event occurs on one of its inputs. Statistical data shows that event activities in large circuits are very low, and with increase in size of the circuit percentage activity on a logic element decreases. Each concurrent process is converted to an abstract syntax tree. When a process is executed its tree is traversed, and nodes of the tree are interpreted and acted upon till the process suspends. A process may suspend when it finishes or due to nonavailability of one of the inputs. A suspended process is scheduled by the scheduler to wait for some event to wake it up. Execution of some statements in a process may resume other processes. There are two major classes of event-driven logic simulation algorithms: (1) Synchronous simulation algorithms: These algorithms are centralized-timed and are used for single processor machines. The algorithm follows the path of events in the circuit. Simultaneous events are handled through centralized control of time. In this scheme simulation does not advance until all the events that occurred on current simulation time are processed. To implement this algorithm one needs to store events in a global ordered queue of events that is circular in nature. Each slot in this queue represents simulation time and it stores a linked list of events that occur at that simulation time. As the events of the current time slot are processed, the output of those events is compared with the previous output of corresponding logic elements, and if they differ new events are generated on logic elements whose input is driven by the output of current event. (2) Asynchronous simulation algorithms: In asynchronous simulation there is no global centralized time. Instead each data item carries a time stamp that is indicative of time up to which data is valid. The evaluation of an event depends on availability of a token. An asynchronous algorithm can process events that occur at different time instances. Hence it can extract more parallelism compared to synchronous simulation algorithms. (3) Compiled-code event-driven simulation. Modern simulators employ the best of both of the above. Compiled-code eventdriven simulators compile the hardware description language (HDL) description of the design to machine code. The generated code is then linked with the simulator kernel. 2.3.1.3 ASIC Synthesis A design specification that is functionally correct is fed to a synthesis tool that extracts finite state machine from the design and performs data Zhang_Ch02.indd 244 5/13/2008 5:53:50 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 245 path optimizations on the finite state machine. The resultant hardware specification is mapped to gates, flip-flops, and nets to get gate-level netlist. User supplied timing constraints are used to perform timing optimization on gate-level netlist. The first step in synthesis process is to convert a given RTL into a finite state machine. Many transformations can be applied to finite state machine in order to reduce the number of states. Some of the common transformations applied to FSM are constant propagation, gate merging, dead code elimination, and arithmetic merging. The next step is to generate hardware. RTL synthesis involves three major steps: transition from RTL description into gates and flip-flops, optimization of logic, and placement and routing of optimized netlist. Most of the intelligence resides in the optimization stage but modern synthesis tools apply many smart techniques while converting RTL description into gates in order to reduce the number of gates in the design. There are broadly two types of optimizations: technology independent optimizations that are carried out once netlist has been mapped into technology cells provided by fabrication house and technologydependent optimization. Timing and area constraints are provided by the designer. Slack is defined as the difference between the expected arrival time and actual arrival time of the signal at a particular output port. Slack is calculated for input to output paths. The aim of timing optimization is to reduce slack on critical paths. Certain timing optimizations might lead to area escalation. Area reclamation algorithms try to reclaim the area that does not affect timing on critical paths. Other design rule constraints are maximum fan-out for a logic element, maximum capacitance, and the slope of signal from 20% of target to 80% of target. The technology library provided by the fabrication house contains basic components like sequential gates: AND, OR, NOT, NAND, NOR, XOR, BUFFER, and sequential elements like latches, flip-flops, and memories. Information about cell characteristics includes cell delay and area. There are three major quality metrics: area, time, and power. Designer’s quality metric for an IC is driven by specific application. (1) Area. With shrinking system size, ASIC should be able to accommodate maximum functionality in minimum area. The designer can specify area constraint and the synthesis tool will optimize for minimum area. Area can be optimized by having lesser number of cells and by replacing multiple cells with a single cell that includes both functionalities. (2) Timing. Designer specifies maximum delay between primary input and primary output. This is taken as maximum delay across Zhang_Ch02.indd 245 5/13/2008 5:53:50 PM 246 INDUSTRIAL CONTROL TECHNOLOGY any critical path. There are four types of critical paths: path between a primary input and primary output, path from any primary input to a register, path from a register to a primary output, and path from a register to another register. (3) Power. Development of handheld devices has led to reduction of battery size and hence low power consuming systems. Low power consumption has become a big requirement for lots of designers. 2.3.1.4 ASIC Design Verification The biggest challenge in IC design is verification because the cost of a single error is huge. Verification is time consuming and requires a large amount of resources. The types of verification tasks can be classified into two categories: (1) Functional verification that checks the functionality of synthesized and optimized design against golden representation of design. (2) Implementation verification that occurs once placement and routing is over. In implementation verification, the design is checked for functional correctness once again. Timing and power constraints are also verified. Formal verification methods are used to test the functional correctness of the gate-level netlist. Testing functional correctness involves testing an optimized design against a golden design specification. There are two methods of performing the verification: (1) Black box verification methods include simulation, emulation, and hardware acceleration. (2) White box verification methods involve the use of formal methods, for example, assertion-based verification. (1) Assertion. Assertion-based verification is aimed at digital designers. It is a white-box verification technique. Unlike simulation, it is not applied on the block level once the design is complete. Assertion-based verification can be applied alongside design process. In fact assertion-based verification entities reside in the HDL description of the design. Assertions are active comments embedded within the design. Assertions turn design specifications into verification objects. Assertions can be used to (1) monitor signals on interfaces that connect different blocks; (2) track expected behavior of a gate, flip-flop, or module; (3) watch for forbidden behavior within a design block. Assertions can be implicit or explicit: (1) Implicit assertions are supported by HDL like Verilog and VHDL. These assertions are added at the time of design analysis, synthesis, and HDL analysis. (2) Explicit assertions are user-defined assertions. Such assertions are provided by EDA vendors in the form of library Zhang_Ch02.indd 246 5/13/2008 5:53:50 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 247 such as OVL. Academic languages like CTL, LTL, and automata provide a way to define explicit assertions. (2) Emulation. The emulator is a hardware device that can be used to emulate a piece of hardware functionality. It is commonly used as a debugging tool to test a system under development for functional correctness. Emulation is a faster solution to a verification problem. In emulation a portion of the design is synthesized and optimized. The compiled design is then loaded onto an emulator. The rest of the design is simulated by the workstations that are connected to the emulator. Remember only the portion of the design that is being tested resides on the emulator. Emulators are able to provide execution speed close to real time. This allows verification engineers to reduce verification time. An emulation system typically consists of a small number of large FPGA. This provides multimillion ASIC-equivalent gate capacities. Such an emulation system comes as a separate box. An emulation box can be connected to a collection of workstations using PCI card. The workstations are connected via emulation network architecture. A complex IC is typically divided into a number of different modules. Each module is developed by a separate team of designers. Each team verifies the functionality of its own module. The modules then go to an integration team that integrates all the modules and carries out verification. With emulation providing faster methods of design verification, last minute changes can be incorporated in the design. This significantly reduces time to market. 2.3.1.5 ASIC Integrity Analyses Due to an increase in signal speed, miniaturization of features, smaller chip sizes, and lower power supply voltages, there has been greater interconnect signal integrity problems. Signal delay due to interconnect delay is more significant compared to gate delay. As a result, more powerful automation tools are required for layout parameter extraction, timing delay and crosstalk simulation, and power analysis. (1) Parasitic extraction. Accurate extraction of on-chip parasitic is crucial due to shrinking size and the increasing contribution of interconnect delay. The parasitic consists of resistance, inductance, and capacitance. Inductance is not critical for signal propagation until transmission line effect occurs. Resistance is easy to compute using algorithms like square counting and two-dimensional Zhang_Ch02.indd 247 5/13/2008 5:53:50 PM 248 INDUSTRIAL CONTROL TECHNOLOGY finite-difference approach. Another reason for easy resistance estimation is that one has to consider only one conductor trace at a time. On the other hand, capacitance extraction requires that neighborhood conductors be considered for electromagnetic coupling effect. (2) Signal integrity. The design for a high speed integrated circuit depends on understanding and predicting interconnect parasitic effects and behavior. Increasing switching speed and complexity of VLSI circuits are becoming crucial factors in determining reliability and performance of an electronic system. Estimation is complex due to increase in metallization layers, increasing material complexity, and higher operating frequencies. The various aspects of signal integrity include (a) Technology scale down. As technology dips into the deep submicrometer range, lateral coupling effects between interconnects dominate compared to vertical coupling effects in micrometer technology. Aluminum has been used until recently to manufacture interconnects but the increasing contribution of interconnects in signal propagation has forced IC manufacturers to replace it with materials like copper with lower receptivity. As a result, gain in propagation delay is almost double. Technology scale down has introduced some new problems like complex resistance, three-dimensional capacitance, and inductance. (b) Propagation delay. With decrease in the size of technology interconnect, delay increases. (c) Crosstalk. When two wire segments are closer to each other than a minimum threshold, they will interfere in each other’s functioning. A signal on one wire may weaken due to electromagnetic effects of a signal carried by the other wire. This interference with each other’s signal is called crosstalk. With diminishing technology size, crosstalk is a major contributor to high speed IC defects. (d) Crosstalk delay. Crosstalk delay is a major reason for timing uncertainty. The simultaneous switching of the victim and the affecting signals may lead to a wide variety of phenomena. Among the most important is delay increase when the victim and aggressor signals switch in opposite directions, starting with the victim signal followed by the aggressor. 2.3.2 Programmable Logic Devices (PLD) PLD are designed with configurable logic and flip-flops linked together with programmable interconnect. PLDs provide specific functions, including Zhang_Ch02.indd 248 5/13/2008 5:53:50 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 249 device-to-device interfacing, data communication, signal processing, data display, timing and control operations, and almost every other function a system must perform. Memory cells control and define the function that the logic performs and how the various logic functions are interconnected. Logic devices can be classified into two broad categories: fixed and programmable. As the name suggests, the circuits in a fixed logic device are permanent; they perform one function or a set of functions and once manufactured, they cannot be changed. With fixed logic devices, the time required to go from design to prototypes to a final manufacturing run can take from several months to more than a year, depending on the complexity of the device. If the device does not work properly, or if the requirements change, a new design must be developed. On the other hand, PLD are standard, off-the-shelf parts that offer customers a wide range of logic capacity, features, speed, and voltage characteristics—these devices can be changed at any time to perform any number of functions. With programmable logic devices, designers use inexpensive software tools to quickly develop, simulate, and test their designs. Then, a design can be quickly programmed into a device and immediately tested in a live circuit. The PLD that is used for this prototyping is the exact same PLD that will be used in the final production of a piece of end equipment, such as a network router, a DSL modem, a DVD player, or an automotive navigation system. There are no NRE costs and the final design is completed much faster than that of a custom, fixed logic device. Another key benefit of using PLD is that during the design phase customers can change the circuitry as often as they want until the design operates to their satisfaction. That is because PLDs are based on rewriteable memory technology: to change the design, simply reprogram the device. Once the design is final, customers can go into immediate production by simply programming as many PLDs as they need with the final software design file. PLDs can be described as being one of three different types: simple programmable logic devices (SPLD), complex programmable logic devices (CPLD), or field-programmable gate arrays (FPGA). The FPGA is individually discussed in Section 2.3.3. The distinction between CPLD and FPGA is often a little fuzzy, with manufacturers designing new, improved architectures, and frequently muddying the waters for marketing purposes. Together, CPLD and FPGA are often referred to as high-capacity programmable logic devices (HCPLD). The programming technologies for PLD devices are actually based on the various types of semiconductor memory. As new types of memories Zhang_Ch02.indd 249 5/13/2008 5:53:50 PM 250 INDUSTRIAL CONTROL TECHNOLOGY have been developed, the same technology has been applied to the creation of new types of PLD devices. Today, SPLD are devices that typically contain the equivalent of 600 or fewer gates, while HCPLD have thousands and hundreds of thousands of gates available. SPLDs are often used for address decoding, where they have several clear advantages over the 7400series TTL parts that they replaced. First, of course, is that one chip requires less board area, power, and wiring than several do. Another advantage is that the design inside the chip is flexible, so a change in the logic does not require any rewiring of the board. Rather, the decoding logic can be altered by simply replacing that one PLD with another part that has been programmed with the new design. Hardware designs for these simple PLDs are generally written in languages like ABEL or PALASM (the hardware equivalents of assembly). Inside each PLD is a set of fully connected macro cells. These macro cells are typically comprised of some amount of combinatorial logic (e.g., AND, OR gates) and a flip-flop. In other words, a small Boolean logic equation can be built within each macro cell. This equation will combine the state of some number of binary inputs into a binary output and, if necessary, store that output in the flip-flop until the next clock edge. Of course, the particulars of the available logic gates and flip-flops are specific to each manufacturer and product family. But the general idea is always the same. Because these chips are rather small, they do not have much relevance to the remainder of this discussion. But you do need to understand the origin of programmable logic chips before we can go on to talk about the larger devices. At the low end of the spectrum are the original programmable logic devices. These were the first chips that could be used to implement a flexible digital logic design in hardware. In other words, you could remove a couple of the 7400-series transistor-transistor logic parts (AND, OR, and NOT) from your board and replace them with a single PLD. Other names you might encounter from this class of device are programmable logic array (PLA), programmable array logic (PAL), and generic array logic (GAL). 2.3.3 Field-Programmable Gate Array (FPGA) Field-programmable gate arrays (FPGA) are integrated circuits (ICs) that contain an array of logic cells surrounded by programmable I/O blocks. FPGAs contain as many as tens of thousands of logic cells and an even greater number of flip-flops. Because of cost, FPGAs do not provide a 100% interconnection between logic cells; however, FPGAs still provide Zhang_Ch02.indd 250 5/13/2008 5:53:50 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 251 significantly higher capacities than programmable logic devices (PLD) that are interconnected through a central global routing pool. Often, design engineers use FPGA to program electrical connections through several iterations in order to minimize nonrecurring costs. FPGA are used in applications ranging from data processing and storage, to instrumentation, telecommunications, and digital signal processing. Other terms for FPGA include logic cell array and programmable application-specific integrated chip. 2.3.3.1 FPGA Types and Important Data Selecting field-programmable gate arrays requires an analysis of memory, performance, and I/O interface requirements. Available memory types include content addressable memory; Flash, random access memory (RAM); dual-port RAM; read-only memory (ROM); electrically erasable programmable read-only memory (EEPROM); first-in, first-out; and last-in, last-out. Performance considerations include internal frequency, the number of integrated phase-locked loops and delay-locked loops with clock-frequency-synthesis capabilities, and the total number of I/O ports. I/O interfaces include accelerated graphics port, bus low voltage differential signaling, and peripheral component interconnect (PCI). Field-programmable gate arrays are available with different numbers of system gates, shift registers, logic cells, and lookup tables. Logic blocks or logic cells do not include I/O blocks, but generally contain a lookup table to generate any function of inputs, a clocked latch (flip-flop) to provide registered outputs, and control logic circuits for configuration purposes. Logic cells are also known as logic array blocks, logic elements, and configurable logic blocks. Lookup tables or truth tables are used to implement a single logic function by storing the correct output logic state in a memory location that corresponds to each particular combination of input variables. Field-programmable gate arrays are available with many logic families. Transistor-transistor logic and related technologies such as Fairchild advanced Schottky use transistors as digital switches. By contrast, emittercoupled logic uses transistors to steer current through gates that compute logical functions. Another logic family, CMOS, uses a combination of P-type and N-type metal-oxide-semiconductor field effect transistors to implement logic gates and other digital circuits. Logic families for fieldprogrammable gate arrays include crossbar switch technology, gallium arsenide, integrated injection logic, and silicon on sapphire. Gunning with transceiver logic and gunning with transceiver logic plus are also available. Zhang_Ch02.indd 251 5/13/2008 5:53:50 PM 252 INDUSTRIAL CONTROL TECHNOLOGY Field-programmable gate arrays are available in a variety of IC package types and with different numbers of pins and flip-flops. Basic IC package types for field-programmable gate arrays include ball grid array, quad flat package, single in-line package, and dual in-line package. Many packaging variants are available. 2.3.3.2 FPGA Architecture The typical basic architecture consists of an array of logic blocks and routing channels. Multiple I/O pads may fit into the height of one row or the width of one column. Generally, all the routing channels have the same width (number of wires). Figure 2.18 illustrates the FPGA structure. (1) FPGA logic block. An application circuit must be mapped into an FPGA with adequate resources. The typical FPGA logic block consists of a 4-input lookup table (LUT) and a flip-flop, as shown in Fig. 2.19. There is only one output in each logic block, which can be either the registered or the unregistered LUT output. As shown in Figure 2.20, the logic block has four inputs for the LUT and a clock input. Since clock signals (and often other high-fanout Routing channel I/O pad Logic block Figure 2.18 FPGA structure. Inputs 4-input LUT Clock D Flip flop Out Figure 2.19 A FPGA logic block. Zhang_Ch02.indd 252 5/13/2008 5:53:51 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 253 In3 In4 In2 Out In1 Out Figure 2.20 FPGA logic block pin locations. signals) are normally routed via special-purpose dedicated routing networks in commercial FPGA, they are accounted for separately from other signals. Each input is accessible from one side of the logic block, while the output pin can connect to routing wires in both the channel to the right and the channel below the logic block. Each logic block output pin can connect to any of the wiring segments in the channels adjacent to it. Figure 2.21 should make the situation clear. Similarly, an I/O pad can connect to any one of the wiring segments in the channel adjacent to it. For example, an I/O pad at the top of the chip can connect to any of the W wires (where W is the channel width) in the horizontal channel immediately below it. (2) FPGA routing. Generally, the FPGA routing is unsegmented (Fig. 2.22). That is, each wiring segment spans only one logic block before it terminates in a switch box. By turning on some of the programmable switches within a switch box, longer paths can be constructed. For higher speed interconnect, some FPGA architectures use longer routing lines that span multiple logic blocks. Potential connection Logic block pin Routing wire Figure 2.21 Logic block pin to routing channel interconnect. Zhang_Ch02.indd 253 5/13/2008 5:53:51 PM 254 INDUSTRIAL CONTROL TECHNOLOGY Logic block Switch block Wire segment Figure 2.22 Unsegmented FPGA routing mechanism. Whenever a vertical and a horizontal channel intersect there is a switch box. In this architecture, when a wire enters a switch box, there are three programmable switches that allow it to connect to three other wires in adjacent channel segments. The pattern, or topology, of switches used in this architecture is the planar or domain-based switch box topology. In this switch box topology, a wire in track number 1 connects only to wires in track number 1 in adjacent channel segments, wires in track number 2 connect only to other wires in track number 2, and so on. Figure 2.23 illustrates the connections in a switch box. Modern FPGA families expand upon the above capabilities to include higher level functionality fixed into the silicon. Having these common functions embedded into the silicon reduces the area required and gives those functions increased speed compared to building them from primitives. Examples of these include multipliers, embedded processors, high speed I/O logic, and embedded memories. Wire segment Programmable switch Figure 2.23 FPGA switch box topology. Zhang_Ch02.indd 254 5/13/2008 5:53:51 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 2.3.3.3 255 FPGA Programming To define the behavior of the FPGA the user provides a hardware description language (HDL) or a schematic design. Common HDLs are VHDL and Verilog. Then, using an electronic design automation tool, a technology-mapped netlist is generated. The netlist can then be fitted to the actual FPGA architecture using a process called place-and-route, usually performed by the FPGA company’s proprietary place-and-route software. The user will validate the map, place and route results via timing analysis, simulation, and other verification methodologies. Once the design and validation process is complete, the binary file generated (also using the FPGA company’s proprietary software) is used to reconfigure the FPGA device. In an attempt to reduce the complexity of designing in HDLs, which have been compared to the equivalent of assembly languages, there are moves to raise the abstraction level of the design. Companies are promoting SystemC as a way to combine high level languages with concurrency models to allow faster design cycles for FPGAs than is possible using traditional HDL. Approaches based on standard C or C++ (with libraries or other extensions allowing parallel programming) are found in the Catapult C tools from Mentor Graphics, and in the Impulse C tools from Impulse Accelerated Technologies. Languages such as SystemVerilog, SystemVHDL, and Handel-C (from Celoxica) seek to accomplish the same goal, but are aimed at making existing hardware engineers more productive vs making FPGAs more accessible to existing software engineers. To simplify the design of complex systems in FPGAs, there exist libraries of predefined complex functions and circuits that have been tested and optimized to speed up the design process. These predefined circuits are commonly called intellectual property blocks and are available from FPGA vendors, from third-party IP suppliers, and in the public domain via OpenCores.org and other sources. In a typical design flow, an FPGA application developer will simulate the design at multiple stages throughout the design process. Initially, the RTL description in VHDL or Verilog is simulated by creating test benches to stimulate the system and observe results. Then after the synthesis engine has mapped the design to a netlist, the netlist is translated to a gate-level description where simulation is repeated to confirm the synthesis proceeded without errors. Finally, the design is laid out in the FPGA at which point propagation delays can be added and the simulation run again with these values back-annotated onto the netlist. Zhang_Ch02.indd 255 5/13/2008 5:53:52 PM 256 INDUSTRIAL CONTROL TECHNOLOGY Bibliography Altera (http://www.altera.com). 2005. C8237 DMA Controller. http://www.cast-inc .com/cores/c8237/cast_c8237-a.pdf. Accessed date: June. Best-Microprocessor (http://www.best-microcontroller-projects.com). 2005. http:// www.best-microcontroller-projects.com/hardware-interrupt.html. Accessed date: June. Buchanan, William and Wilson, Austin. 2001. Advanced PC Architecture. Reading, England: Addison-Wesley. Chipx (http://www.chipx.com). 2007a. Structured ASIC. http://www.chipx.com/ about/index.asp. Accessed date: May. Chipx (http://www.chipx.com). 2007b. Embedded ASIC. http://www.chipx.com/ embedded/index.asp. Accessed date: May. Datorarkitektur, I. 2004. Input/Output Device. http://www.ida.liu.se/~TDTS57/ info/lectures/lect4.frm.pdf. Accessed date: June 2005. DCD (http://www.dcd.pl). 2005. http://www.dcd.pl/dcdpdf/xil/d8255_ds.pdf. Accessed date: June. DDJ (http://www.ddj.com). 2005. http://www.x86.org/intel.doc/686manuals.htm. Accessed date: June. Decision Cards (http://www.decisioncards.com). 2005. http://www.decisioncards .com/io/index.php?style=isol. Accessed date: June. DELORIE (http://www.delorie.com). 2005. http://www.delorie.com/djgpp/doc/ ug/interrupts/inthandlers1.html. Accessed date: June. Design-Reuse (http://www.us.design-reuse.com). 2007. FPGA Design Articles. http://www.us.design-reuse.com/articles/fpga-0.html. Accessed date: May. FPGA-ASIC Engineering (http://www.ge-research.com/index.html). 2007. ASIC design Flow. http://www.ge-research.com/atmel_design.html. Accessed date: May. FtdiChip (http://www.ftdichip.com). 2007. ASIC Design Service. http://www .ftdichip.com/DesignServices/ASICDesign.htm. Accessed date: May. Fujitsu (http://www.fujitsu.com). 2007. Standard Cell ASIC. http://www.fujitsu .com/emea/services/microelectronics/asic/standardcell/index.html. Accessed date: May. Gaonkar, Ramesh S. 2002. Microprocessor Architecture, Programming, and Applications with the 8085. Fifth Edition. New Jersey: Prentice Hall. IECI (http://www.ieci.com). 2005. http://www.ieci.com.au/products/data_ acquisition_index.asp. Accessed date: June. InfoMit (http://www.informit.com). 2005. http://www.informit.com/articles/article .asp?p=482324&seqNum=3&rl=1. Accessed date: June. Intel (http://www.intel.com). 2005a. http://www.intel.com/pressroom/kits/ quickreffam.htm. Accessed date: June. Intel (http://www.intel.com). 2005b. 8259A Programmable Interrupt Controller. http://bochs.sourceforge.net/techspec/intel-8259a-pic.pdf.gz. Accessed date: June. Intel (http://www.intel.com). 2005c. 82C54 Programmable Interval Timer. http:// bochs.sourceforge.net/techspec/intel-82c54-timer.pdf.gz. Accessed date: June. Intel (http://www.intel.com). 2005d. 8237A Programmable DMA Controller. http:// bochs.sourceforge.net/techspec/intel-8237a-dma.pdf.gz. Accessed date: June. Zhang_Ch02.indd 256 5/13/2008 5:53:52 PM 2: COMPUTER HARDWARE FOR INDUSTRIAL CONTROL 257 Interface Bus (http://www.interfacebus.com). 2007. Programmable Logic Device Definition. http://www.interfacebus.com/Programmable_Logic.html. Accessed date: May. Intersil (http://www.intersil.com). 2005. http://www.ortodoxism.ro/datasheets/ intersil/fn2970.pdf. Accessed date: June. MITRE (http://www.mitre.org). 2005. Real-Time Clock and CMOS. http://www .mitre.org/tech/cots/RTC.html. Accessed date: June. Netrino (http://www.netrino.com). 2007. SPLD CPLD PLD. http://www.netrino .com/Publications/index.php. Accessed date: May. Patterson, David A. and Hennessey John L. 1998. Computer Organization and Design. Second Edition. San Francisco: Morgan Kaufmann. Real Time Devices (http://www.rtdfinland.fi). 2005. DM5854HR/DM6854HR Isolated Digital I/O-Module User’s Manual. Available from this company’s web site. Rieker, Mike 2005. Advanced Programmable Interrupt Controller. http://www .osdever.net/tutorials/pdf/apic.pdf. Accessed date: June. Silicon-Fareast (http://www.siliconfareast.com). 2005. Application-Specific Integrated Circuits. http://www.siliconfareast.com/asic.htm. Accessed date: June. Styles, Lain 2004. Lecture 11: I/O & Peripherals. http://www.cs.bham.ac.uk/ internal/courses/sys-arch/current/lecture11.pdf. Accessed date: June 2005. Tutorial-Report (http://www.tutorial-reports.com). 2007a. ASIC Design Guide. http://www.tutorial-reports.com/hardware/asic/tutorial.php. Accessed date: May. Tutorial-Report (http://www.tutorial-reports.com). 2007b. ASIC Simulation and Synthesis. http://www.tutorial-reports.com/hardware/asic/synthesis.php. Accessed date: May. Tutorial-Report (http://www.tutorial-reports.com). 2007c. FPGA Tutorials. http:// www.tutorial-reports.com/computer-science/fpga/tutorial.php?PHPSESSID= c3c8bde5dfc3cd38afdc175639f587c7. Accessed date: May. Wikipedia (http://en.wikipedia.org/wiki/Main_Page). 2005. Standard Cell ASIC. http://en.wikipedia.org/wiki/Standard_Cell. Accessed date: June. Xilinx (http://www.xilinx.com). 2007a. PLD Specifications. http://www.altium .com/Forms/libraries/dxp2002/library_contents.asp?zip=Xilinx%5F050503 %2Ezip&lib=Xilinx+PLD+XC7000%2EIntLib. Accessed date: May. Xilinx (http://www.xilinx.com). 2007b. PLD-SPLD CPLD. http://www.xilinx .com/index.shtml. Accessed date: May. Zilog (http://www.zilog.com). 2005. http://www.zilog.com/docs/z180/ps0140.pdf. Accessed date: June. Zhang_Ch02.indd 257 5/13/2008 5:53:52 PM Zhang_Ch02.indd 258 5/13/2008 5:53:52 PM 3 System Interfaces for Industrial Control 3.1 Actuator–Sensor (AS) Interface 3.1.1 Overview Industrial automation systems require large amounts of control devices, and the number of binary actuators and sensors on a typical system has increased over the years. Conventional input and output (I/O) methods for wiring include point-to-point connection or bus systems. For example, typical batching valve wiring networks attach each of the I/O to a central location resulting in multiple wire runs for each field device. Large expenditures are needed for cabling conduit, installation, and I/O points. Space for I/O racks and cabling must be accommodated in order to attach only a few field devices. These methods can prove to be too complex for networking simple binary devices and, therefore, too slow for the interactions between the controllers and the controlled devices. Point-to-point wiring is the most common method of wiring in the industry, but large wire bundles take up valuable space, installation is time consuming, and troubleshooting is complex. Actuator–sensor interface, or AS interface, was developed by a group of sensor manufacturers and introduced into the market in 1994. Since that time, it has become the standard for discrete sensors in process industries throughout the world. AS interface is also a bus system for low-level field applications in industrial automation to communicate with small binary sensors and actuators using the AS interface standard. The AS interface modernizes automation systems effectively and eliminates wire bundles completely, with only one wire cable required, compared to one cable from each device with point-to-point wiring. Junction boxes are also eliminated and the size of the control cabinet needed is significantly reduced. The plug and play wiring supports all typologies. Figure 3.1 gives the locations of the AS interface in industrial control networks. In comparison with conventional I/O wiring methods, the AS interface has many advantages. The most important ones are given below: (1) Minimum wiring and cost saving. AS interface offers a single cable, which uses simple serial connection to the controller, instead of parallel with a multitude of cables. 259 Zhang_Ch03.indd 259 5/13/2008 5:41:14 PM 260 INDUSTRIAL CONTROL TECHNOLOGY Control level Master PLC, PC, SCADA, PID, …… Field level (Profibus, Foundation Fieldbus, CAN bus, Ethernet, etc.) AS interface level Slave device Slave device Slave device Slave device …… Actuators, sensors level Figure 3.1 The functionality of AS interface in industrial control networks. The AS interface can be at two locations in an industrial control network: between the controllers and the actuators–sensors and between the field level and actuators–sensors. (2) Fast and safe installation. Sensors and actuators are simply installed with modules on the AS interface cable. Contact pins in the modules penetrate the insulation of the cable and establish contact with the copper wire. Incorrect connections are practically impossible because of the design of the cable and the special piercing method. (3) Flexible configuration. Owing to the distributed and modular design, plant sections can be tested in parallel even before the overall solution is finished. This permits flexible modification and expansion. (4) Open system. AS interface is an open system, which means that it is independent of manufacturer and future-proof. 3.1.2 Architectures and Components In industrial control networks, as displayed in Fig. 3.1, there are two types of AS interface architectures. Zhang_Ch03.indd 260 5/13/2008 5:41:14 PM 261 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 3.1.2.1 AS Interface Architecture: Type 1 In the first type of AS interface architecture, a controller such as PLC, SCADA, or PC applies the controls of sensors and actuators via the field level buses including Fieldbus, PROFIBUS, etc. As displayed in Fig. 3.2, the AS interface has gateways directly connected to the field level bus and the I/O module. The I/O module is the device of this AS interface architecture to contact the sensors and the actuators. A field level bus may be able to support several AS interface gateways depending on the system designs, each of which profiles a segment of an industrial control system. In this type of architecture, AS interface requires the following components: (1) Gateways. Gateways are interface modules between the AS interface and a higher level bus system. They are used when more complex applications are to be solved using standard products. AS interface gateways are the core of the wiring system, which handles the complete data transfer, cyclically polling (master/slave) all participants connected to the wiring system. The AS interface gateway can be placed anywhere in the AS interface segments. One gateway can handle 124 inputs and 124 outputs over 31 addressable I/O modules. For gateways, setup is accomplished through the setup tools for the respective system. . Controller or PC Field level bus AS interface Gateway AS interface I/O module AS interface Gateway AS interface I/O module AS interface Power supply/repeater AS interface Power supply/repeater AS interface I/O module . . . . . . Sensors or actuators Figure 3.2 AS interface architecture: Type 1. Zhang_Ch03.indd 261 5/13/2008 5:41:15 PM 262 INDUSTRIAL CONTROL TECHNOLOGY (2) I/O modules. I/O modules are the interface between standard sensors and actuators and AS interface. I/O modules are available for any kind of application, including flat modules for limited space applications, compact modules for a variety of mounting options, field modules that use cord grips instead of quick disconnects, standard modules that use both the mechanically keyed AS interface cable and the standard 16 AWG round cable. For enclosures and junction boxes, enclosure modules connect AS interface bus to a power rail system, and junction box modules for use within junction boxes. (3) Power supplies and repeaters. With AS interface, one single cable transmits both power and data. Power supplies contain internal data separation coils so that the capacitive filtering of the supply does not interfere with the data stream. Adding to the high interference immunity of AS interface is the power supply data isolation coil between the voltage transformer and the output so that the data signals are isolated from line noise. Repeaters extend AS interface networks up to 100 additional meters, and by using two in series, an AS interface network can be up to 300 m long. Repeaters do not require a network address and allow I/O modules to be placed anywhere along the network. (4) AS interface safety at work. This extension of AS interface allows for safety equipment to be wired together on a two-wire cable rather than hardwired back to a panel. A maximum of 31 category 4 inputs, for example, E-Stops, can be put on one cable. The parts included in this section are safety slaves, safety monitor, and configuration software. In many applications safety relevant functions are to be guaranteed. These are in the form of emergency stop buttons near process lines or the implementation of safe sensors (e.g., safe photo grits and locking of safety related doors) to automatically stop machines. Depending on the safety category, there are requirements of differing severity. Typically, a separate wiring is necessary as well as redundancy or increased protection for the cables. With the integration of the safety technique into the AS interface line under the terminology “AS interface safety at work,” the additional costs can be drastically reduced. The concept designates connection of the safety related switches by safe AS interface module. There is also a safety monitor on the AS interface line permanently observing the communication. The communication happens through a given and predetermined pattern by a dynamic code table with 8 times 4 bits sequence. The safe monitor continuously checks “must” and “actual” values of the Zhang_Ch03.indd 262 5/13/2008 5:41:15 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 263 communication through comparison. In case of the bit sequence “0000,” the safe monitor switches off the safe relay in less than 40 ms. Several safe monitors can be operated in one AS interface line arranged on any position. Clear benefits of AS interface safety at work include the following: only one AS interface line is required for the communication of safe and nonsafe data; full compatibility with all standard AS interface devices; no specific communication mechanisms required; mixed applications on one and the same AS interface line possible; diagnosis of the safe modules via the standard AS interface master possible. (5) AS interface encoders. In order to be able to meet the real-time requirements of many applications, a “multislave” solution was achieved. The position value, up to 16 bits in length, is transferred to the gateways within a single cycle, via the four integrated AS interface chips used for control purposes. AS interface rotary encoders include 13-bit-Singleturn and 16-bit-Multiturn. (6) Accessories. To make AS interface perfect and to make the installation as easy as possible, various accessories ranging from hand-held addressing devices to mounting bases to simulators for higher level bus systems are offered: sealing for flat cable and adaptor to round cable. 3.1.2.2 AS Interface Architecture: Type 2 In the second type of AS interface architecture, as shown in Fig. 3.3, the AS interface master module resides inside a controller such as PLC, SCADA, or PC. In this type of AS interface architecture, the AS interface master terminal enables the direct connection of AS interface slaves. The AS interface compliant interface supports digital and analog slaves. The AS interface master does not manage the sensors and actuators via the field level buses, but rather via the AS interface slave modules or cables. The slave modules are connected to each other by means of the AS interface cable which can be branched with the cable branch device. Power supply and repeater are used too. A group of slave modules frames a segment of an industrial control network with one interface cable. The AS interface master module is able to support several segments depending on the designed system capabilities. In this type of architecture, AS interface requires the following components: (1) AS interface masters. The AS interface master automatically controls all communication over the AS interface cable without Zhang_Ch03.indd 263 5/13/2008 5:41:15 PM 264 INDUSTRIAL CONTROL TECHNOLOGY Controller or PC AS interface cable AS interface Master module AS interface Power supply /repeater AS interface AS interface Slave module Sensors/actuators Sensors/actuators Segment A Cable . . . . . Cable Cable Branch Cable AS interface Slave module Segment B Figure 3.3 AS interface architecture: Type 2. the need for special software. The master can connect the system to a controller such as PLC, SCADA, or PC, act as a standalone controller, or serve as a gateway to higher level bus systems. There exist the following AS interface masters in the current markets: (a) Standard AS interface master. Up to 31 standard slaves or slaves with the extended addressing mode can be attached to standard AS interface masters. (b) Extended AS interface masters. The extended AS interface masters support 31 addresses that can be used for standard AS interface slaves or AS interface slaves with the extended addressing mode. AS interface slaves with the extended addressing mode can be connected in pairs (programmed as A or B slaves) to an extended AS interface master and can use the same address. This increases the number of addressable AS interface slaves to a maximum of 62. Due to the address expansion, the number of binary outputs is reduced to three per AS interface slave on slaves using the extended addressing mode. Zhang_Ch03.indd 264 5/13/2008 5:41:16 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 265 (2) AS interface slaves. All the nodes that can be addressed by an AS interface master are defined as AS interface slaves. (a) AS interface slave assembly system. AS interface slaves with the following assembly systems are available: (i) AS interface modules. AS interface modules are AS interface slaves to which up to four conventional sensors and up to four conventional actuators can be connected. The standard coupling module, which is the lower section of a standard device, connects the user module to the yellow AS interface cable. The user module connects the sensors and actuators, while the application modules connect via screw terminals or connectors. Sensors and actuators with a built-in AS interface chip can be directly connected to the AS interface cable. (ii) Sensors/actuators with an integrated AS interface connection. Sensors/actuators with an integrated AS interface connection can be connected directly to the AS interface. (b) Addressing mode. AS interface slaves are available with the following addressing modes: (i) Standard slaves. Standard slaves each occupy one address on the AS interface. Up to 31 standard slaves can be connected to the AS interface. (ii) Slaves with an extended addressing mode (A/B slaves). Slaves with an extended addressing mode can be operated in pairs at the same address with an extended AS interface master. This doubles the number of addressable AS interface slaves to 62. One of these AS interface slaves must be programmed as an A slave using the addressing unit and the other as a B slave. Due to the address expansion, the number of binary outputs is reduced to three per AS interface slave. Slaves can also be operated with a standard AS interface master. For more detailed information about these functions, refer to the AS interface master discussion in the previous paragraphs. (c) Analog slaves. Analog slaves are special AS interface standard slaves that exchange analog values with the AS interface master. Analog slaves require special program sections in the user program (drivers, function blocks) that execute the sequential transfer of analog data. Analog slaves are intended for operation with extended AS interface masters. The extended AS interface masters handle the exchange of analog data with these slaves automatically. No special drivers or function blocks are required in the user program. Zhang_Ch03.indd 265 5/13/2008 5:41:16 PM 266 INDUSTRIAL CONTROL TECHNOLOGY (3) Further AS interface system components. The further AS interface components include AS interface cable, AS interface power supply unit, addressing unit, and SCOPE for AS interface. (a) AS interface cable. The trapezoidal AS interface cable is recommended over standard two-wire round cable for quick and simple connection of slaves. The AS interface cable is available in different colors to signify its voltage rating with color assignments as follows: (i) Yellow. The yellow AS interface cable is used for data and control power between the master and its slaves. (ii) Black. It is the external output power cable up to 60 VDC. (iii) Red. It is the external output power cable up to 240 VAC. The AS interface cable, designed as an unshielded two-wire cable, transfers signals and provides the power supply for the sensors and actuators connected using AS interface modules. Networking is not restricted to one type of cable. If necessary, appropriate modules or “T pieces” can be used to change to a simple two-wire cable. (b) AS interface power supply unit. The AS interface power supply unit supplies power to the AS interface nodes connected to the AS interface cable. For actuators with particularly high power requirements, the connection of an additional load power supply may be necessary (e.g., using special application modules). Data and control power are normally transmitted simultaneously via the AS interface cable. Power for the electronics and inputs is supplied by a special AS interface power supply that feeds a symmetrical supply voltage into the AS interface cable via a data-decoupling device. (c) Addressing unit. The addressing unit allows simple programming of AS interface slave addresses. (d) SCOPE for AS interface. SCOPE AS interface is a monitoring program for Windows that can record and evaluate the data exchange in AS interface networks during the commissioning phase and during operation. SCOPE AS interface can be operated on a PC under Windows in conjunction with an AS interface master communications processor. 3.1.3 Working Principle and Mechanism AS interface utilizes a single, trapezoidal, unshielded two-wire cable, which eliminates the extensive parallel control wiring required with most installations. In a network with AS interface, a simple gateway interfaces Zhang_Ch03.indd 266 5/13/2008 5:41:16 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 267 the network into the field communication bus. Data and power are transferred over the two-wire network to each of the AS interface compatible field devices. The existing controller sees AS interface as remote I/O; therefore, AS interface connects to the existing network with minimal programming changes. The AS interface system utilizes only one master per network to control the exchange of data. This allows the master to interrogate up to 31 slaves and update all I/O information within 5 ms (10 ms for 62 slaves). For slave connection, an insulated two-wire cable is recommended to prevent reversing polarity. The electrical connection is made using contacts that pierce the insulation of the cable, contacting the two wires, thus eliminating the need to strip the cable and wire to screw terminals. For data exchange to occur, each slave must be programmed with an address that is stored internally in nonvolatile memory and remains even after power is removed. The tasks and functions of an AS interface master are described below, which is important for understanding the functions, modes, and interfaces available with the AS interface master modules. 3.1.3.1 Master–Slave Principle The AS interface operates on the master–slave principle. This means that the AS interface master connected to the AS interface cable controls the data exchange with the slaves via the interface to the AS interface cable. Figure 3.4 illustrates the two interfaces of the AS interface master communication processor. (1) The process data and parameter assignment commands are transferred via the interface between the master CPU and the master communication processor. The user programs have suitable function calls and mechanisms available for reading and writing via this interface. (2) Information is exchanged with the AS interface slaves via the interface between the master communication processor and AS interface cable. (1) Tasks and functions of the AS interface master. The AS interface master specification distinguishes masters with different ranges of functions known as a “profile.” For standard AS interface masters and extended AS interface masters, there are three different master classes (M0, M1, M2 for standard masters, and M0e, M1e, M2e for extended masters). The AS interface specification Zhang_Ch03.indd 267 5/13/2008 5:41:16 PM 268 INDUSTRIAL CONTROL TECHNOLOGY PLC/PC CPU User program AS interface master communication processor AS interface slave I/O Configuration Parameters Interface Address Figure 3.4 AS interface operation. stipulates the functions a master in a particular class must be able to perform. The profiles have the following practical significance: (a) Master profile M0/M0e. The AS interface master can exchange I/O data with the individual AS interface slaves. The station configuration on the cable, called the “expected configuration,” is used to configure the master. (b) Master profile M1/M1e. This profile covers all the functions according to the AS interface master specification. (c) Master profile M2/M2e. The functionality of this profile corresponds to master profile M0/M0e, but in this profile the AS interface master can also assign parameters to the AS interface slaves. The essential difference between extended AS interface masters and standard AS interface masters is that they support the attachment of up to 62 AS interface slaves using the extended addressing mode. Extended AS interface masters also provide particularly simple access for AS interface analog slaves complying with profile specifications. However, if standard operation (master profile M0) is chosen for use, the following contents can be skipped. (2) How an AS interface slave functions (a) Connecting to the AS interface cable. The AS interface slave has an integrated circuit (AS interface chip) that provides the attachment of an AS interface device (sensor/actuator) to the common bus cable to the AS interface master. The integrated circuit contains these components: four configurable data inputs and outputs; four parameter outputs. Zhang_Ch03.indd 268 5/13/2008 5:41:16 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 269 The operating parameters, configuration data with I/O assignment, identification code, and slave address are stored in additional memory (e.g., EEPROM). (b) I/O data. The useful data for the automation components that were transferred from the AS interface master to the AS interface slave are available at the data outputs. The values at the data inputs are made available to the AS interface master when the AS interface slave is polled. (c) Parameter. Using the parameter outputs of the AS interface slave, the AS interface master can transfer values that are not interpreted as simple data. These parameter values can be used to control and switch over between internal operating modes of the sensors or actuators. It could, for example, be possible to update a calibration value during the various operating phases. This function is possible with slaves with an integrated AS interface connection providing they support the function in question. (d) Configuration. The input/output configuration (I/O configuration) indicates which data lines of the AS interface slave are used as inputs, outputs, or as bidirectional outputs. The I/O configuration (4 bits) can be found in the description of the AS interface slave. In addition to the I/O configuration, the type of the AS interface slave is described by an identification code; with newer AS interface slaves it is identified by three identification codes (ID code, ID1 code, ID2 code). For more detailed information on the ID codes, refer to the manufacturer’s description. 3.1.3.2 Data Transfer (1) Information and data structure. Before introducing the operating phases and the functions during these operating phases, a brief outline of the information structure of the AS interface master/ slave system is necessary. In Fig. 3.5, the data fields and lists of the system are configured in the system structure diagram as given in Fig. 3.4. The following structures are found on the AS interface master: (a) Data images. These contain temporarily stored information: (i) actual parameters that are an image of the parameters currently on the AS interface slave; (ii) actual configuration data that contains the I/O configurations and ID codes of all connected AS interface Zhang_Ch03.indd 269 5/13/2008 5:41:16 PM 270 INDUSTRIAL CONTROL TECHNOLOGY PLC/PC CPU AS interface master communication processor User program Data images I/O data AS interface slave I/O data Parameters Active parameters Active configuration data Configuration Address LDS LAS Configuration data Expected configuration data Parameters LPS Figure 3.5 Data transfer between the AS interface master and the AS interface slave. slaves once these data have been read from the AS interface slaves; (iii) the list of detected AS interface slaves (LDS) that specifies which AS interface slaves were detected on the AS interface bus; (iv) the list of activated AS interface slaves (LAS) that specify which AS interface slaves were activated by the AS interface master. I/O data are only exchanged with activated AS interface slaves. (b) I/O data. The I/O data are the process input and output data. Zhang_Ch03.indd 270 5/13/2008 5:41:17 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 271 (c) Configuration data. These are nonvolatile data (e.g., stored in an EEPROM), which are available unchanged even following a power failure. (i) Expected configuration data that are selectable comparison values which allow the configuration data of the detected AS interface slaves to be checked. (ii) List of permanent AS interface slaves (LPS) that specifies the AS interface slaves expected on the AS interface cable by the AS interface master. The AS interface master checks continuously whether all the AS interface slaves specified in the LPS exist and whether their configuration data match the expected configuration data. The AS interface slave has the following structures: (a) I/O data (b) Parameters (c) Actual configuration data. The configuration data include the I/O configuration and the ID codes of the AS interface slave. (d) Address. The AS interface slaves have address “0” when installed. To allow a data exchange, the AS interface slaves must be programmed with addresses other than “0.” The address “0” is reserved for special functions. (2) The operating phases. Figure 3.6 illustrates the individual operating phases. (a) Initialization mode. The initialization mode, also known as the offline phase, sets the basic status of the master. The module is initialized after switching on the power supply or following a restart during operation. During the initialization, the images of all the slave inputs and the output data from the point of view of the application are set to the value “0” (inactive). After switching on the power supply, the configured parameters are copied to the parameter field so that subsequent activation uses the preset parameters. If the AS interface master is reinitialized during operation, the values from the parameters field that may have changed in the meantime are retained. (b) Start-up phase. (i) Detection phase. Detection of AS interface slaves in the startup phase. During startup or after a reset, the AS interface master runs through a startup phase during which it detects which AS interface slaves are connected to the AS interface cable and what type of slaves these are. The “type” of the slaves is specified by the configuration data stored Zhang_Ch03.indd 271 5/13/2008 5:41:17 PM 272 INDUSTRIAL CONTROL TECHNOLOGY Initialization Offline phase Startup phase Detection phase Activation phase in the protected mode Activation phase in the configuration mode “Startup with configured data” “Startup without configured data/obtain configuration data” Normal operation Data exchange phase Management phase Inclusion phase Figure 3.6 How do the individual operating phases work in the data transfer through an AS interface. permanently on the AS interface slave when it is manufactured and can be queried by the master. Configuration files contain the I/O assignment of an AS-I slave and the slave type (ID codes). The master enters detected slaves in the list of detected slaves (LDS). (ii) Activation phase: Activating AS interface slaves. After the AS interface slaves are detected, the master sends a special call which activates them. When activating individual slaves, a distinction is made between two modes on the AS interface master: Master in the configuration mode: All detected stations (with the exception of the slave with address “0”) are activated. In this mode, it is possible to read actual values and to store them for a configuration. Master in the protected mode: Only the stations corresponding to the expected configuration stored on the AS interface master are activated. If the actual configuration found on the AS interface cable differs from this Zhang_Ch03.indd 272 5/13/2008 5:41:17 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 273 expected configuration, the AS interface master indicates this. The master enters activated AS interface slaves in the list of activated slaves (LAS). (iii) Normal mode. On completion of the startup phase, the AS interface master switches to the normal mode. (iv) Data exchange phase. In the normal mode, the master sends cyclic data (output data) to the individual AS interface slaves and receives their acknowledgment messages (input data). If an error is detected during the transmission, the master repeats the appropriate poll. (v) Management phase. During this phase, all existing jobs of the control application are processed and sent. Possible jobs are, for example, as follows: Parameter transfer: Four parameter bits (three parameter bits with AS interface slaves with the extended addressing mode) are transferred to a slave and are used, for example, for a threshold value setting. Changing slave addresses: This function allows the addresses of AS interface slaves to be changed by the master if the AS interface slave supports this particular function. (vi) Inclusion phase. In the inclusion phase, newly added AS interface slaves are included in the list of detected AS interface slaves and, providing the configuration mode is selected, they are also activated (with the exception of slaves with address “0”). If the master is in the protected mode, only the slaves stored in the expected configuration of the AS interface master are activated. With this mechanism, slaves that were temporarily out of service are also included again. (3) Interface functions. To control the master and slave interaction from the user program, there are various functions available on the interface. The possibilities are explained below. The possible operations and the direction of data flow are illustrated in Fig. 3.7. (a) Read/write. When writing, parameters are transferred to the slave and the parameter images on the communication processor; when reading, parameters are transferred from the slave or from the communication processor parameter image to the CPU. (b) Read and store (configured) configuration data. Configured parameters or configuration data are read from the nonvolatile memory of the communication processor. Zhang_Ch03.indd 273 5/13/2008 5:41:17 PM 274 INDUSTRIAL CONTROL TECHNOLOGY AS interface master CPU AS interface slave Communication processor Process image IO data Data images I/O data I/O data 1.Read/write User program Activation parameters Parameters Activation configuration data Configuration data 4. Supply slaves with configuration parameters (activation) LDS LAS 2. Read/store configuration data 3. Configure actual Configuration data (EEPROM) Expected configuration data Parameters LAS Figure 3.7 How does the AS interface function. (c) Configure actual. When reading, the parameters and configuration data are read from the slave and stored permanently on the communication processor; when writing, the parameters and configuration data are stored permanently on the communication processor. (d) Supply slaves with configured parameters. Configured parameters are transferred from the nonvolatile area of the communication processor to the slaves. (4) Operating extended AS interface slaves with standard AS interface masters. The following information is about operating extended AS interface with standard AS interface masters. (a) Slaves are connected to standard masters. The most significant slave bit (bit 4) of each A slave must be set to “0.” The most significant parameter bit (bit 4) must also be set to “1” (default value). Without these settings, the A slave cannot be operated with a standard master. (b) B slaves must not be connected to standard AS interface masters. Zhang_Ch03.indd 274 5/13/2008 5:41:18 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 275 3.1.4 System Characteristics and Important Data 3.1.4.1 How the AS Interface Functions The AS interface or AS interface system operates as outlined below: (1) Master–slave access techniques. The AS interface is a “single master system.” This means that there is only one master per AS interface network that controls the operations of process. This polls all AS interface slaves one after the other and waits for a response. (2) Electronic address setting. The address of an AS interface slave is its identifier. This only occurs once within an AS interface system. The setting can either be made using a special addressing unit or by an AS interface master. The address is always stored permanently on the AS interface slave. (3) Operating reliability and flexibility. The transmission technique used (current modulation) guarantees high operating reliability. The master monitors the voltage on the cable and the transferred data. It detects transmission errors and the failure of slaves and sends a message to the controller such as a PLC or PC. The user can then react to this message. Replacing or adding AS interface slaves during normal operation does not affect communication with other AS interface slaves. 3.1.4.2 Physical Characteristics The most important physical characteristics of the AS interface and its components are as follows: (1) The two-wire cable for data and power supply. A simple twowire cable can be used. Shielding or twisting is not necessary. Both the data and the power are transferred on this cable. The power available depends on the AS interface power supply unit used. For optimum wiring, the mechanically coded AS interface cable is available preventing the connections from being reversed and making simple contact with the AS interface application modules using the penetration technique. (2) Tree structure network with a cable. The “tree structure” of the AS interface allows any point on a cable section to be used as the start of a new branch. (3) Direct integration. Practically all the electronics required for a slave have been integrated on a special integrated circuit. This allows the AS interface connector to be integrated directly in binary actuators or sensors. Zhang_Ch03.indd 275 5/13/2008 5:41:18 PM 276 INDUSTRIAL CONTROL TECHNOLOGY (4) Increased functionality, more uses for the customer. Direct integration allows devices to be equipped with a wide range of functions. Four data and four parameter lines are available. The resulting “intelligent” actuators/sensors increase the possibilities, for example, monitoring, parameter assignment, wear or pollution checks, etc. (5) Additional power supply for higher power requirements. An external source of power can be provided for slaves with a higher power requirement. 3.1.4.3 System Limits (1) Cycle time (a) Maximum 5 ms with standard AS interface slaves. (b) Maximum 10 ms with AS interface slaves using the extended addressing mode. AS interface uses constant message lengths. Complicated procedures for controlling transmission and identifying message lengths or data formats are not required. This makes it possible for a master to poll all connected standard slaves within a maximum of 5 ms and to update the data both on the master and slave. If only one AS interface slave using the extended addressing mode is located at an address, this slave is polled at least every 5 ms. If two extended slaves (A and B slave) share an address, the maximum polling cycle is 10 ms. (B slaves can only be connected to extended masters.) (2) Number of connectable AS interface slaves (a) Maximum of 31 standard slaves. (b) Maximum of 62 slaves with the extended addressing mode. AS interface slaves are the input and output channels of the AS interface system. They are only active when called by the AS interface master. They trigger actions or transmit reactions to the master when commanded. Each AS interface slave is identified by its own address (1–31). A maximum of 62 slaves using the extended addressing mode can be connected to an extended master. Pairs of slaves using the extended addressing mode occupy one address; in other words, the addresses 1–31 can be assigned to two extended slaves. If standard slaves are connected to an extended master, these occupy a complete address; in other words, a maximum of up to 31 standard slaves can be connected to an extended master. (3) Number of inputs and outputs (a) A maximum of 248 binary inputs and outputs with standard modules. Zhang_Ch03.indd 276 5/13/2008 5:41:18 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 277 (b) A maximum of 248 inputs and 186 outputs with modules using the extended addressing mode. Each standard AS interface slave can receive 4 bits of data and send 4 bits of data. Special modules allow each of these bits to be used for a binary actuator or a binary sensor. This means that an AS interface cable with standard AS interface slaves can have a maximum of 248 binary attachments (124 inputs and 124 outputs). All typical actuators or sensors can be connected to the AS interface in this way. The modules are used as distributed inputs/outputs. If modules with the extended addressing mode are used, a maximum of 3 inputs and 3 outputs is available per module; in other words a maximum of 248 inputs and 186 outputs can be operated with modules using the extended addressing mode. 3.1.4.4 Range of Functions of the Master Modules The functions of the AS interface master modules are stipulated in the AS interface master specification. An overview of these functions can be found in the master module manual provided by the vendor or manufacturer. The AS interface protocol was created in Germany in 1994 by a consortium of factory automation suppliers. Originally developed to be a lowcost method for addressing discrete sensors in factory automation applications, AS interface has since gained acceptance in process industries due to its high power capability, simplicity of installation and operation, and low cost adder for devices. Each AS interface segment can network up to 31 devices. This provides for 124 inputs and 124 outputs, giving a maximum capacity of 248 I/O per network on a v2.0 segment. The AS interface v2.1 specification doubles this to 62 devices per segment, providing 248 inputs and 186 outputs for a total network capacity of 434 I/O points. Both signal and power are carried on two wires. Up to 8 A at 30 VDC of power are available for field devices such as solenoid valves. 3.1.4.5 AS Interface in a Real-Time Environment The system characteristics listed below can offer the AS interface the capability to work in a real-time environment: (1) Optimized system for binary sensors and actuators and for simple analog elements. (2) Master–slave principle with cyclic polling. Zhang_Ch03.indd 277 5/13/2008 5:41:18 PM 278 INDUSTRIAL CONTROL TECHNOLOGY (3) Tree structure of the network. (4) Both data and power by means of one unshielded two-wire cable. (5) Flat cable for contacting by piercing technology. (6) Modules as remote I/O ports for conventional sensors and actuators. (7) Integrated slaves with their own AS interface capabilities. (8) No communication software in the slaves, only firmware in the self-configuring master. (9) Low costs, simple installation, easy handling, flexible networks, high reliability in an industrial environment, open and internationally accepted system with many manufacturers and products. There are three aspects of the AS interface that are of particular importance in real-time applications: connectivity, cycle time, and availability. (1) Connectivity. AS interface has two distinct ways to be connected to the first control level. The first and most important way is a direct connection as the type 2 of AS interface architecture given in Section 3.1.2. In that case, the system’s master is part of a controller such as PLC, SCADA, or PC, running at its own cycle time. As the AS interface is an open system, any kind of controller such as PLC, SCADA, or PC manufacturer can build a master for their own system. There are masters available to a lot of systems already, with several more in development. The second way is to connect AS interface via a coupler to a higher Fieldbus and to use it as a subsystem, which has been given as the type 1 of AS interface architecture in Section 3.1.2. In that case, all data from the AS interface network is handled in one node of the Fieldbus and it is connected to the above lying host together with other components of the higher Fieldbus. The application program has to handle all data as usual for the particular Fieldbus. For real-time applications, an analysis of the cycle time and the availability of the combination of the two systems has to be done. AS interface is definitely open to such solutions and offers couplers to most known higher Fieldbus like PROFIBUS, CAN, etc., with others (e.g., LON, Fieldbus Foundation) being in preparation. Together with its tree structure, AS interface thus offers the most flexible networking solution to any application in automation. (2) Cycle time. AS interface is a single-master system with cyclic polling. Thus, any slave is addressed in a definite time. Zhang_Ch03.indd 278 5/13/2008 5:41:18 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 279 For a complete net with 31 slaves, the cycle time is 5 ms. It may be shorter with fewer slaves. (With very few slaves the cycle time can be shortened to less than 500 µs.) Analog data with more than 4 bits needs several cycles depending on its length, but without affecting the basic cycle time for binary sensors and actuators. The cycle time includes all steps from and to the interface to the host system and even includes one repetition. The data exchange with the host happens from here via process I/O images at the end of each cycle stored in, for example, a dual-ported memory at the interface. Therefore no other steps have to be taken into account for a direct connection to the control device. This is asynchronous coupling, and in real-time applications of the cycle times of both the network and the controller this may present a restriction, but for many systems and applications this is short enough. (3) Availability. Availability in this context means that a system will deliver reliable data and diagnostic values continuously and in time under all specified conditions, especially under severe electromagnetic noise. The answers to three questions are of special importance for real-time applications: (a) Can electromagnetic noise or other faults disturb the reliability of data? (b) How much time is necessary for the correction of a faulty transmission? (c) How often does such a fault happen and can this affect the whole system? 3.2 Industrial Control System Interface Devices In reference to Fig. 3.1, there exist two kinds of interface between the control level and the actuator/sensor level in industrial control systems, which are AS interface and field level interface. In additional to these two kinds of interface, the interface between controller and either AS interface or field level interface is also of importance in industrial control systems. The interface between controller and either AS interface or field level interface normally resides in the controller’s microprocessor unit or chipset to bridge the central processing unit (CPU) with exterior environments, which therefore can be defined as controller interface, or simplified as interfaces hereafter. Section 3.1 gives a detailed discussion on AS interface. This section concentrates on the field level in Section 3.2.1, and interfaces in Section 3.2.2. Zhang_Ch03.indd 279 5/13/2008 5:41:18 PM 280 INDUSTRIAL CONTROL TECHNOLOGY 3.2.1 Fieldbus System In recent years, there have emerged literally hundreds of Fieldbuses developed by different companies and organizations all over the world. The term Fieldbus covers many different industrial control protocols. The following lists some typical Fieldbuses with their applications as shown in Fig. 3.1. 3.2.1.1 Foundation Fieldbus The Foundation Fieldbus can be flexibly used in process automation applications. The specification supports bus-powered field devices as well as allows application in hazardous areas. The Fieldbus Foundation, an independent not-for-profit organization which aims at developing and maintaining an internationally uniform and successful Fieldbus for automation tasks, claimed to establish an international, interoperable Fieldbus standard to replace the expensive, conventional 4–20 mA wiring in the field and enables bidirectional data transmission. The entire communication between the devices and the automation system as well as the process control station takes place over the bus system, and all operating and device data are exclusively transmitted over the Fieldbus. The communication between control station, operating terminals, and field devices simplifies the start-up and parameterization of all components. The communication functions allow diagnostic data, which are provided by up-to-date field devices, to be evaluated. The essential objectives in Fieldbus technology are to reduce installation costs, save time and costs due to simplified planning, as well as improve the operating reliability of the system due to additional performance features. Fieldbus systems are usually implemented in new plants or existing plants that must be extended. To convert an existing plant to Fieldbus technology, the conventional wiring can either be modified into a bus line or be replaced with a shielded bus cable, if required. (1) Performance features. The Foundation Fieldbus provides a broad spectrum of services and functions compared to other Fieldbus systems: (a) Intrinsic safety for use in hazardous environments (b) Bus-powered field devices (c) Line or tree topology (d) Multimaster capable communication (e) Deterministic (predictable) dynamic behavior (f) Distributed data transfer (DDT) (g) Standardized block model for uniform device interfaces (h) Flexible extension options based on device descriptions. Zhang_Ch03.indd 280 5/13/2008 5:41:18 PM 281 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL The characteristic feature of distributed data transfer enables single field devices to execute automation tasks so that they are no longer just sensors or actuators, but contain additional functions. For the description of a device’s function(s) and for the definition of a uniform access to the data, the Foundation Fieldbus contains predefined function blocks. The function blocks implemented in a device provide information about the tasks the device can perform. Typical functions provided by sensors include the following: analog input or discrete input (digital input). Control valves usually contain the following function blocks: analog output or discrete output (digital output). The following blocks exist for process control tasks: Proportional and Derivative (PD controller) or Proportional and Integral and Derivative (PID controller). If a device contains such a function block, it can control a process variable independently. The shift of automation tasks—from the control level down to the field—results in the flexible, distributed processing of control tasks. This reduces the load on the central process control station which can even be replaced entirely in small-scale installations. Therefore, an entire control loop can be implemented as the smallest unit, consisting only of one sensor and one control valve with integrated process controller, which communicates over the Foundation Fieldbus (see Fig. 3.8). The enhanced functionality of the devices leads to higher requirements to be met by the device hardware and comparably complex software implementation and device interfaces. User 1 User 2 Switch Bridge High speed ethernet H1 bus 2 1 Junction box 3 5 6 Figure 3.8 Foundation Fieldbus control network. Zhang_Ch03.indd 281 5/13/2008 5:41:18 PM 282 INDUSTRIAL CONTROL TECHNOLOGY (2) Layered communications model. The Foundation Fieldbus specification is based on the layered communications model and consists of three major functional elements as illustrated in Fig. 3.9: (a) Physical layer (b) Communication “stack” (c) User application is made up of function blocks and the device description. It is directly based on the communication stack. Depending on which blocks are implemented in a device, users can access a variety of services. System management utilizes the services and functions of the user application and the application layer to execute its tasks (Fig. 3.9(b) and (c)). It ensures proper cooperation between the individual bus components as well as synchronizes the measurement and control tasks of all field devices with regard to time. The Foundation Fieldbus layered communications model is based on the ISO/OSI reference model. As is the case for most Fieldbus systems, and in accordance with an IEC specification, layers 3–6 are not used. The comparison in Fig. 3.9 shows that the communication stack covers the tasks of layers 2 and 7 and that Layer 7 consists of the Fieldbus Access Sublayer and the Fieldbus Message Specification. User application (a) Communication stack Physical layer User application (b) Application layer Presentation layer Session layer Transport layer Network layer Data link layer Physical layer Function block model Device description (c) Fieldbus message specification Fieldbus access sublayer Presentation layer Session layer Transport layer Network layer Data link layer Physical layer Figure 3.9 Structure and description of the Foundation Fieldbus communication model. Zhang_Ch03.indd 282 5/13/2008 5:41:19 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 283 (3) Physical layer. The Foundation Fieldbus model solves pending communication tasks by using two bus systems, the slow, intrinsically safe H1 bus and the fast, higher level H2 bus as given in Fig. 3.8. (a) H1 bus. The following summary gives a brief overview of the basic values and features of the H1 bus. (i) Manchester coding is used for data transfer. The data transfer rate is 31.25 kbit/s. (ii) Proper communication requires that the field devices have enough voltage. Each device should have minimum 9 V. To make sure that this requirement is met, software tools are available which calculate the resulting currents and terminal voltages based on the network topology, the line resistance, and the supply voltage. (iii) The H1 bus allows the field devices to be powered over the bus. The power supply unit is connected to the bus line in the same way (parallel) as a field device. Field devices powered by supply sources other than the bus must be additionally connected to their own supply sources. (iv) With the H1 bus it must be ensured that the maximum power consumption of current consuming devices is lower than the electric power supplied by the power supply unit. (v) Network topologies used are usually line topology or, when equipped with junction boxes, star, tree, or a combination of topologies. The devices are best connected via short spurs using tee connectors to enable connection/disconnection of the devices without interrupting communication. (vi) The maximum length of a spur is limited to 120 m and depends on the number of spurs used as well as the number of devices per spur. (vii) Without repeaters, the maximum length of a H1 segment can be as long as 1900 m. By using up to four repeaters, a maximum of 5 × 1900 m = 9500 m can be achieved. The short spurs from the field device to the bus are included in this total length calculation. (viii) The number of bus users per bus segment is limited to 32 in intrinsically safe areas. In explosion-hazardous areas, this number is reduced to only a few devices due to power supply limitations. Zhang_Ch03.indd 283 5/13/2008 5:41:19 PM 284 INDUSTRIAL CONTROL TECHNOLOGY (ix) Various types of cables are useable for Fieldbus. Type A is recommended as preferred Fieldbus cable, and only this type is specified for the maximum bus length of 1900 m. (x) Principally, there need to be two terminators per bus segment, one at or near each end of a transmission line. (xi) It is not imperative that bus cables be shielded, however, it is recommended to prevent possible interferences and for best performance of the system. The H1 bus can be designed intrinsically safe (Ex-i) to suit applications in hazardous areas. This requires that proper barriers be installed between the safe and the explosion-hazardous area. In addition, only one device, the power supply unit, must supply the Fieldbus with power. All other devices must always, that is, also when transmitting and receiving data, function as current sinks. Since the capacity of electrical lines is limited in intrinsically safe areas depending on the explosion group—IIB or IIC—the number of devices that can be connected to one segment depends on the effective power consumption of the used devices. Since the Foundation Fieldbus specification is not based on the FISCO model, the plant operator must ensure that intrinsic safety requirements are met when planning and installing the communications network. For instance, the capacitance and inductance of all line segments and devices must be calculated to ensure that the permissible limit values are observed. (b) High speed Ethernet (HSE). The HSE is based on standard Ethernet technology. The required components are therefore widely used and are available at low cost. The HSE runs at 100 Mbit/s and cannot be equipped not only with electrical lines, but also with optical fiber cables. The Ethernet operates by using random (not deterministic) CSMA bus access. This method can only be applied to a limited number of automation applications because it requires real-time capability. The extremely high transmission rate enables the bus to respond sufficiently fast when the bus load is low and devices are only few. With respect to process engineering requirements, real-time requirements are met in any case. If the bus load must be reduced due to the many connected devices, or if several HSE partial networks are to be combined Zhang_Ch03.indd 284 5/13/2008 5:41:19 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 285 to create a larger network, Ethernet switches must be used (see Fig. 3.8). A switch reads the target address of the data packets that must be forwarded and then passes the packets on to the associated partial network. This way, the bus load and the resulting bus access time can be controlled to best adapt it to the respective requirements. (c) Bridge to H1–HSE coupling. A communications network that consists of a H1 bus and a HSE network results in a topology as illustrated in Fig. 3.8. To connect the comparatively slow H1 segments to the HSE network, coupling components, so-called bridges, are required. A bridge is used to connect the individual H1 buses to the fast high speed Ethernet. The various data transfer rates and data telegrams must be adapted and converted, considering the direction of transmission. This way, powerful and widely branched networks can be installed in larger plants. (4) Communication stack. The field devices used with the Foundation Fieldbus are capable of assuming process control functions. This option is based on distributed communication which ensures that each controlling field device can exchange data with other devices (e.g., reading measuring values, forwarding correction values), all field devices are served in time (“in time” meaning that the processing of the different control loops is not negatively influenced), and two or more devices never access the bus simultaneously. To meet these requirements, the H1 bus of the Foundation Fieldbus uses a central communication control system. (a) Link active scheduler (LAS). The LAS controls and schedules the communication on the bus. It controls the bus activities using different commands which it broadcasts to the devices. Since the LAS also continuously polls unassigned device addresses, it is possible to connect devices during operation and to integrate them in the bus communication. Devices that are capable of becoming the LAS are called Link Masters. Basic devices do not have the capability to become LAS. In a redundant system containing multiple Link Masters, one of the Link Masters will become the LAS if the active LAS fails (fail-operational design). (b) Communication control. The communication services of the FF specification utilize scheduled and unscheduled data transmission. Time-critical tasks, such as the control of process variables, are exclusively performed by scheduled services, whereas parameterization and diagnostic functions are carried out using unscheduled communication services. Zhang_Ch03.indd 285 5/13/2008 5:41:19 PM 286 INDUSTRIAL CONTROL TECHNOLOGY (i) Scheduled data transmission. To solve communication tasks in time and without access conflicts, all time-critical tasks are based on a strict transmission schedule. This schedule is created by the system operator during the configuration of the Foundation Field system. The LAS periodically broadcasts a synchronization signal (TD: Time Distribution) on the Fieldbus so that all devices have exactly the same data link time. In scheduled transmission, the point of time and the sequence are exactly defined. This is why it is called a deterministic system. (ii) Unscheduled transmission. Device parameters and diagnostic data must be transmitted when needed, that is, on request. The transmission of this data is not time critical. For such communication tasks, the Foundation Fieldbus is equipped with the option of unscheduled data transmission. Unscheduled data transmission is exclusively restricted to the breaks in between scheduled transmission. The LAS grants permission to a device to use the Fieldbus for unscheduled communication tasks if no scheduled data transmission is active. Permission for a certain device to use the bus is granted by the LAS when it issues a pass token (PT command) to the device. The pass token is sent around to all devices entered in the Live List which is administrated by the LAS. Each device may use the bus as long as required either until it returns the token or until the maximum granted time to use the token has elapsed. The Live List is continuously updated by the LAS. The LAS sends a special command, the Probe Node (PN), to the addresses not in the Live List, searching for newly added devices. If a device returns a Probe Response (PR) message, the LAS adds the device to the Live List where it receives the pass token for unscheduled communication according to the order submitted for transmission in the Live List. Devices which do not respond to the PT command or return the token after three successive tries are removed from the Live List. Whenever a device is added or removed from the Live List, the LAS broadcasts these changes to all devices. This allows all Link Masters to maintain a current copy of the Live List so that they can become the LAS without the loss of information. Zhang_Ch03.indd 286 5/13/2008 5:41:19 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 287 (c) Communication schedule. The LAS follows a strict schedule to ensure that unscheduled communication using the token as well as the TD or PN commands do not interfere with the scheduled data transmission. Before each operation, the LAS refers to the transmission list to check for any scheduled data transmissions. If this is the case, it waits (idle mode) for precisely the scheduled time and then sends a Compel Data (CD) message to activate the operation. In case there are no scheduled transmissions and sufficient time is available for additional operations, the LAS sends one of the other commands. With PN it searches for new devices, or it broadcasts a TD message for all devices to have exactly the same data link time, or it uses the PT massage to pass the token for unscheduled communication. Following this, the sequence starts all over again with the abovementioned check of the transmission list entries. It is obvious that this cycle gives scheduled transmission the highest priority and that the scheduled times are strictly observed, regardless of other operations. (5) User application layer. The Fieldbus Access Sublayer (FAS) and Fieldbus Message Specification (FMS) layer form the interface between the data link layer and the user application (see Fig. 3.9). The services provided by FAS and FMS are invisible for the user. However, the performance and functionality of the communication system considerably depends on these services. (a) Fieldbus access sublayer (FAS). FAS services create Virtual Communication Relationships (VCR) which are used by the higher level FMS layer to execute its tasks (Figure 3.10). VCRs describe different types of communication processes and enable the associated activities to be processed more quickly. Foundation Fieldbus communication utilizes three different VCR types as follows: (i) The Publisher/Subscriber VCR type is used to transmit the input and output data of function blocks. As described above, scheduled data transmission with the CD command is based on this type of VCR. However, the Publisher/Subscriber VCR is also available for unscheduled data transmission; for instance, if a subscriber requests measuring or positioning data from a device. (ii) The Client/Server VCR type is used for unscheduled, user-initiated communication based on the PT command. If a device (client) requests data from another device, the requested device (server) only responds Zhang_Ch03.indd 287 5/13/2008 5:41:20 PM 288 INDUSTRIAL CONTROL TECHNOLOGY Client/Server Operator communication Report distribution Event notification, alarms, trend reports Publisher/subscriber Data publication Set point changes Mode and device data changes Send process alarms to operator consoles Send actual value of a transmitter to PID block and operator console Upload/download Adjusting alarm values Access display views Remote diagnostics Send trend reports to data historians Figure 3.10 Virtual Communication Relationships of the FAS. when it receives a PT from the LAS. The Client/Server communication is the basis for operator-initiated requests, such as set point changes, tuning parameter access and change, diagnosis, device upload and download, etc. (iii) Report distribution communication is used to send alarm or other event notifications to the operator consoles or similar devices. Data transmission is unscheduled when the device receives the PT command together with the report (trend or event notification). Fieldbus devices that are configured to receive the data await and read this data. (b) Fieldbus message specification (FMS). FMS provides the services for standardized communication. Data types that are communicated over the Fieldbus are assigned to certain communication services. For a uniform and clear assignment, object descriptions are used. Object descriptions not only contain definitions of all standard transmission message formats, but also include application-specific data. For each type of object there are special, predefined communication services. Object descriptions are collected together in a structure called an object dictionary. The object description is identified by its index. (1) Index 0, called the object dictionary header, provides a description of the dictionary itself. (2) Indices between 1 and 255 define standard data types that are used to build more complex object descriptions. (3) The User Application object descriptions can start at any index above 255. The FMS defines Virtual Field Devices (VFD) which are used to make the object descriptions of a field device as Zhang_Ch03.indd 288 5/13/2008 5:41:20 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 289 well as the associated device data available over the entire network. The VFDs and the object description can be used to remotely access all local field device data from any location by using the associated communication services. 3.2.1.2 PROFIBUS PROFIBUS is the largest Fieldbus in the world with cost-saving solutions in factory automation and process automation plus safety, drives, and motion control coverage. This Fieldbus approach produces significant cost savings in design, installation, and maintenance expenses over the old approach of point-to-point wiring. For many years, PROFIBUS development has continued with undiminished enthusiasm and energy. With more than 13,000,000 nodes installed there are significantly more PROFIBUS nodes installed than of any other Fieldbus. Current PROFIBUS activities are targeted at system integration, PROFIBUS engineering development, and application profiles. Because of these application profiles, PROFIBUS today is the only Fieldbus that provides robust engineering solutions for both factory and process automation. (1) Working mechanism. PROFIBUS is suitable for both fast, time-critical applications and complex communication tasks. PROFIBUS communication is in the international standards IEC 61158 and IEC 61784. The application and engineering aspects are specified in the generally available guidelines of the PROFIBUS User Organization. This fulfills user demand for manufacturer independence and openness and ensures communication between devices of various manufacturers. PROFIBUS can handle large amounts of data at high speed and can serve the needs of large installations. Based on a realtime capable asynchronous token bus principle, PROFIBUS defines multimaster and master–slave communication relations, with cyclic or acyclic access, allowing transfer rates of up to 500 kbit/s. The physical layer (two-wire RS485), the data link layer, and the application layer are all standardized. PROFIBUS distinguishes between confirmed and unconfirmed services, allowing process communication with both broadcast and multitasking protocols. PROFIBUS DP is a master/slave polling network with the ability to upload/download configuration data and precisely synchronized multiple devices on the network. Multiple masters are possible in PROFIBUS, but the outputs of any device can only be assigned to one master. There is no power on the bus. Zhang_Ch03.indd 289 5/13/2008 5:41:20 PM 290 INDUSTRIAL CONTROL TECHNOLOGY (2) Basic types. PROFIBUS encompasses several Industrial Bus Protocol Specifications, including PROFIBUS-DP, PROFIBUSPA, PROFIBUS-FMS, PROFInet, PROFIBUS-safe, and PROFIBUS for motion control. (a) PROFIBUS-DP. PROFIBUS-DP is the main emphasis for factory automation; it uses RS485 transmission technology, one of the DP communications protocol versions, and has widespread usage for such items as remote I/O systems, motor control centers, and variable speed drives. PROFIBUS-DP communicates at speeds from 9.6 kbps to 12 Mbps over distances from 100 to 1200 m. PROFIBUS-DP does not natively support intrinsically safe installations. More than 2500 PROFIBUS-compliant products are available from which you can select best-in-class devices to suit your individual needs, with alternative sources usually available. (b) PROFIBUS-PA. PROFIBUS-PA is the main emphasis for process automation, typically with MBP-IS transmission technology, the communications protocol version DP-V1, and the application profile PA devices. PROFIBUS-PA is a full-function Fieldbus that is generally used for process level instrumentation. PROFIBUS-PA communicates at 31.25 kbps and has a maximum distance of 1900 m per segment. PROFIBUS-PA is designed to support intrinsically safe applications. PROFIBUS is also tailored to process automation requirements. It is of modular design and comprises the communication protocol PROFIBUS-DP, different transmission technologies, numerous application profiles, and structured device integration tools. Typical PROFIBUS-PA applications are formed by combining modules suited for or required by the respective applications. (c) PROFIBUS-FMS. PROFIBUS-FMS is designed for communication at the cell level according to Fieldbus message specification. At this level programmable controllers (e.g., PLC and PC) communicate primarily with each other. In this application area a high degree of functionality is more important than fast system reaction times. FMS services are a subset of the services (MMS = Manufacturing Message Specification, ISO 9506) which have been optimized for Fieldbus applications and to which functions for communication object administration and network management have been added. Execution of the FMS services via the bus is described by service sequences consisting of several interactions which are called service primitives. Service primitives describe the interaction between requester and responder. Zhang_Ch03.indd 290 5/13/2008 5:41:20 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 291 (d) PROFInet. PROFInet is the leading Industrial Ethernet standard for automation that includes plant-wide Fieldbus communication and plant-to-office communication. PROFInet is designed to work from I/O to MES and hence can simultaneously handle standard Ethernet transmissions and real-time transmissions at 1 ms speeds. PROFInet embraces industry standards like TCP/IP, XML, OPC, and ActiveX. Because of the integrated proxy technology it connects other Fieldbuses in addition to PROFIBUS, thus protecting the existing investment in plant equipment and networks (whether that is PROFIBUS or another Fieldbus). (e) Motion control with PROFIBUS. Motion control with PROFIBUS is the main emphasis for drive technology using RS485 transmission technology, the communications protocol version DP V2, and the application profile PROFI drive. The demands of motion control propelled the implementation of functionalities such as clock cycle synchronization or slave-to-slave communication. Decentralized drive applications can be realized economically by means of intelligent drives, since PROFIBUS now also permits the highly dynamic distribution of the technological signals among the drives. (f) PROFI-safe. PROFI-safe is the main emphasis for safetyrelevant applications (universal use for almost all industries), using RS485 or MBP-IS transmission technology, one of the available DP versions for communication, and the application profile PROFI-safe. PROFIBUS is the very first Fieldbus in merging standard automation and safety automation in one technology, running on the same bus, using the same communication mechanisms, and thus providing highest efficiency to the user. This supports simple and cost-effective installation and operation. 3.2.1.3 Controller Area Network (CAN bus) CAN is a serial bus system, which was originally developed for automotive applications in the early 1980s. The CAN protocol was internationally standardized in 1993 as ISO 11898-1 and comprises the data link layer of the seven layer ISO/OSI reference model. CAN bus system can theoretically link up to 2032 devices (assuming one node with one identifier) on a single network. However, due to the practical limitation of the hardware (transceivers), it can only link up to 110 nodes (with 82C250, Philips) on a single network. It offers high-speed communication rate up to 1 Mbit/s thus allowing real-time control. In addition, the error Zhang_Ch03.indd 291 5/13/2008 5:41:20 PM 292 INDUSTRIAL CONTROL TECHNOLOGY confinement and the error detection feature make it more reliable in noise critical environment. CAN bus systems provide the following: (1) A multimaster hierarchy, which allows building intelligent and redundant systems. If one network node is defective the network is still able to operate. (2) Broadcast communication. A sender of information transmits to all devices on the bus. All receiving devices read the message and then decide if it is relevant to them. This guarantees data integrity as all devices in the system use the same information. (3) Sophisticated error detecting mechanisms and retransmission of faulty messages. This also guarantees data integrity. The CAN serial bus system is used in a broad range of embedded as well as automation control systems. It usually links two or more microcontrollerbased physical devices. The original equipment manufacturers (OEM) design embedded control systems; the end user has no or only some knowledge of the embedded network functions and is therefore not responsible for the CAN communication system. However, automation control systems are specified by the end user. The system design including the CAN network services may be implemented by the end users themselves or by a system house. The main CAN application fields include (1) passenger cars, (2) trucks and buses, (3) off-highway and off-road vehicles, (4) maritime electronics; (5) aircraft and aerospace electronics, (6) factory automation, (7) industrial machine control, (8) lifts and escalators, (9) building automation, (10) medical equipment and devices, (11) nonindustrial control, (12) nonindustrial equipment. (1) CAN basic working mechanism. (a) Principles of data exchange. When data are transmitted by CAN, no stations are addressed, but instead, the content of the message (e.g., rpm or engine temperature) is designated by an identifier that is unique throughout the network. The identifier defines not only the content but also the priority of the message. This is important for bus allocation when several stations are competing for bus access. If the CPU of a given station wishes to send a message to one or more stations, it passes the data to be transmitted and their identifiers to the assigned CAN chip (“Make ready”). This is all the CPU has to do to initiate data exchange. The message is constructed and transmitted by the CAN chip. As soon as the CAN chip receives the bus allocation (“Send Message”) all other stations on the CAN network become receivers of this message (“Receive Message”). Each station Zhang_Ch03.indd 292 5/13/2008 5:41:20 PM 293 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL CAN station 1 CAN station 2 Accept Prepare Select CAN station 3 CAN station 4 Accept Select Select Receive message Receive message Send message Receive message Figure 3.11 Broadcast transmission and acceptance filtering by CAN nodes. in the CAN network, having received the message correctly, performs an acceptance test to determine whether the data received are relevant for that station (“Select”). If the data are of significance for the station concerned they are processed (“Accept”), otherwise they are ignored. Figure 3.11 illustrates this scenario. A high degree of system and configuration flexibility is achieved as a result of the content-oriented addressing scheme. It is very easy to add stations to the existing CAN network without making any hardware or software modifications to the existing stations, provided the new stations are purely receivers. Because the data transmission protocol does not require physical destination addresses for the individual components, it supports the concept of modular electronics and also permits multiple reception (broadcast, multicast) and the synchronization of distributed processes: measurements needed as information by several controllers can be transmitted via the network, in such a way that it is unnecessary for each controller to have its own sensor. (b) Nondestructive bitwise arbitration. For the data to be processed in real time, they must be transmitted rapidly. This not only requires a physical data transfer path with up to 1 Mbit/s but also calls for rapid bus allocation when several stations wish to send messages simultaneously (Fig. 3.12). In real-time processing the urgency of messages to be exchanged over the network can differ greatly: a rapidly changing dimension (e.g., engine load) has to be transmitted Zhang_Ch03.indd 293 5/13/2008 5:41:20 PM 294 INDUSTRIAL CONTROL TECHNOLOGY Recessive Dominant Bus line 1 1 2 3 2 3 1 loses 3 loses Figure 3.12 Principle of nondestructive bitwise arbitration. more frequently and therefore with fewer delays than other dimensions (e.g., engine temperature) which change relatively slowly. The priority at which a message is transmitted compared with another less urgent message is specified by the identifier of the message concerned. The priorities are laid down during system design in the form of corresponding binary values and cannot be changed dynamically. The identifier with the lowest binary number has the highest priority. Bus access conflicts are resolved by bitwise arbitration on the identifiers involved by each station observing the bus level bit for bit. In accordance with the “wired” mechanism, by which the dominant state (logical 0) overwrites the recessive state (logical 1), the competition for bus allocation is lost by all those stations with recessive transmission and dominant observation. All “losers” automatically become receivers of the message with the highest priority and do not reattempt transmission until the bus is available again. (c) Destructive bus allocation. Simultaneous bus access by more than one station causes all transmission attempts to be aborted and, therefore, there is no successful bus allocation. More than one bus access may be necessary in order to allocate the bus at all. The number of attempts before bus allocation is successful being a purely statistical quantity (examples: CSMA/CD, Ethernet). In order to process all transmission requests of a CAN network while complying with latency constraints at as low a data transfer rate as possible, the CAN protocol must implement a bus allocation method that guarantees that there Zhang_Ch03.indd 294 5/13/2008 5:41:21 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 295 is always unambiguous bus allocation even when there are simultaneous bus accesses from different stations. The method of bitwise arbitration using the identifier of the messages to be transmitted uniquely resolves any collision between a number of stations wanting to transmit, and it does this at the latest within 13 (standard format) or 33 (extended format) bit periods for any bus access period. Unlike the message-wise arbitration employed by the CSMA/ CD method, this nondestructive method of conflict resolution ensures that no bus capacity is used without transmitting useful information. Even in situations where the bus is overloaded, the linkage of the bus access priority to the content of the message proves to be a beneficial system attribute compared with existing CSMA/CD or token protocols: in spite of the insufficient bus transport capacity, all outstanding transmission requests are processed in order of their importance to the overall system (as determined by the message priority). The available transmission capacity is utilized efficiently for the transmission of useful data since “gaps” in bus allocation are kept very small. The collapse of the whole transmission system due to overload, as can occur with the CSMA/CD protocol, is not possible with CAN. Thus, CAN permits implementation of fast, traffic-dependent bus access which is nondestructive because of bitwise arbitration based on the message priority employed. Nondestructive bus access can be further classified into centralized bus access control or decentralized bus access control depending on whether the control mechanisms are present in the system only once (centralized) or more than once (decentralized). A communication system with a designated station (inter alia for centralized bus access control) must provide a strategy to take effect in the event of a failure of the master station. This concept has the disadvantage that the strategy for failure management is difficult and costly to implement and also that the takeover of the central station by a redundant station can be very time consuming. For these reasons and to circumvent the problem of the reliability of the master station (and thus of the whole communication system), the CAN protocol implements decentralized bus control. All major communication mechanisms, including bus access control, are implemented several times in the system because this is the only way to fulfill the high requirements for the availability of the communication system. Zhang_Ch03.indd 295 5/13/2008 5:41:21 PM 296 INDUSTRIAL CONTROL TECHNOLOGY In summary it can be said that CAN implements a trafficdependent bus allocation system that permits, by means of a nondestructive bus access with decentralized bus access control, a high useful data rate at the lowest possible bus data rate in terms of the bus busy rate for all stations. The efficiency of the bus arbitration procedure is increased by the fact that the bus is utilized only by those stations with pending transmission requests. These requests are handled in the order of the importance of the messages for the system as a whole. This proves especially advantageous in overload situations. Since bus access is prioritized on the basis of the messages, it is possible to guarantee low individual latency times in real-time systems. (d) Message frame formats. The CAN protocol supports two message frame formats, the only essential difference being in the length of the identifier (ID). In the standard format the length of the ID is 11 bits, and in the extended format the length is 29 bits. The message frame for transmitting messages on the bus comprises seven main fields (Fig. 3.13). A message in the standard format begins with the start bit “start of frame,” followed by the “arbitration field,” which contains the identifier and the remote transmission request (RTR) bit, which indicates whether it is a data frame or a request frame without any data bytes (remote frame). The “control field” contains the IDE (identifier extension) bit, which indicates either standard format or extended format, a bit reserved for future extensions and—in the last 4 bits—a count of the data bytes in the data field. The “data field” ranges from 0 to 8 bytes in length and is followed by the “CRC field,” which is used as a frame security check for detecting bit errors. The “ACK field” comprises the ACK slot (1 bit) and the ACK delimiter (1 recessive bit). The bit in the ACK slot is sent as a recessive bit and is overwritten as a dominant bit by those receivers which have at this time received the data correctly (positive acknowledgment). Correct messages are acknowledged by the receivers regardless of the result of the acceptance test. The end of the Arbitration field S O F 11-bit identifier Control field R I r T D 0 DLC R E Data field CRC field 0–8 bytes 15-bit CRC Ack field End of frame Int Bus idle Figure 3.13 Message frame for standard format (CAN Specification 2.0A). Zhang_Ch03.indd 296 5/13/2008 5:41:21 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 297 message is indicated by “end of frame.” “Intermission” is the minimum number of bit periods separating consecutive messages. If there is no following bus access by any station, the bus remains idle (“bus idle”). (e) Detecting and signaling errors. Unlike other bus systems, the CAN protocol does not use acknowledgment messages but instead signals any errors that occur. For error detection, the CAN protocol implements three mechanisms at the message level: (i) Cyclic redundancy check (CRC). The CRC safeguards the information in the frame by adding redundant check bits at the transmission end. At the receiver end these bits are recomputed and tested against the received bits. If they do not agree, there has been a CRC error. (ii) Frame check. This mechanism verifies the structure of the transmitted frame by checking the bit fields against the fixed format and the frame size. Errors detected by frame checks are designated “format errors.” (iii) ACK errors. As mentioned above, frames received are acknowledged by all recipients through positive acknowledgment. If no acknowledgment is received by the transmitter of the message (ACK error) this may mean that there is a transmission error which has been detected only by the recipients, that the ACK field has been corrupted, or that there are no receivers. The CAN protocol also implements two mechanisms for error detection at the bit level: (i) Monitoring. The ability of the transmitter to detect errors is based on the monitoring of bus signals: each node which transmits also observes the bus level and thus detects differences between the bit sent and the bit received. This permits reliable detection of all global errors and errors local to the transmitter. (ii) Bit stuffing. The coding of the individual bits is tested at bit level. The bit representation used by CAN is NRZ (nonreturn-to-zero) coding, which guarantees maximum efficiency in bit coding. The synchronization edges are generated by means of bit stuffing, that is, after five consecutive equal bits the sender inserts into the bit stream a stuff bit with the complementary value, which is removed by the receivers. The code check is limited to checking adherence to the stuffing rule. If one or more errors are discovered by at least one station (any station) using the above mechanisms, the Zhang_Ch03.indd 297 5/13/2008 5:41:22 PM 298 INDUSTRIAL CONTROL TECHNOLOGY current transmission is aborted by sending an “error flag.” This prevents other stations from accepting the message and thus ensures the consistency of data throughout the network. After transmission of an erroneous message has been aborted, the sender automatically reattempts transmission (automatic repeat request). There may again be competition for bus allocation. As a rule, retransmission will be begun within 23 bit periods after error detection; in special cases the system recovery time is 31 bit periods. However effective and efficient the method described may be, in the event of a defective station it might lead to all messages (including correct ones) being aborted, thus blocking the bus system if no measures for selfmonitoring were taken. The CAN protocol, therefore, provides a mechanism for distinguishing sporadic errors from permanent errors and localizing station failures (fault confinement). This is done by statistical assessment of station error situations with the aim of recognizing a station’s own defects and possibly entering an operating mode where the rest of the CAN network is not negatively affected. This may go as far as the station switching itself off to prevent messages erroneously recognized as incorrect from being aborted. (f) Extended format CAN messages. The SAE “Truck and Bus” subcommittee standardized signals and messages as well as data transmission protocols for various data rates. It became apparent that standardization of this kind is easier to implement when a longer identification field is available. To support these efforts, the CAN protocol was extended by the introduction of a 29-bit identifier. This identifier is made up of the existing 11-bit identifier (base ID) and an 18-bit extension (ID extension). Thus, the CAN protocol allows the use of two message formats: StandardCAN (Version 2.0A) and ExtendedCAN (Version 2.0B). As the two formats have to coexist on one bus, it is laid down which message has higher priority on the bus in the case of bus access collisions with differing formats and the same base identifier: the message in standard always has priority over the message in extended format. CAN controllers that support the messages in extended format can also send and receive messages in standard format. Zhang_Ch03.indd 298 5/13/2008 5:41:22 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 299 When CAN controllers that only cover the standard format (Version 2.0A) are used in one network, then only messages in standard format can be transmitted on the entire network. Messages in extended format would be misunderstood. However, there are CAN controllers that support only standard format but recognize messages in extended format and ignore them (Version 2.0B passive). The distinction between standard format and extended format is made using the IDE bit (Identifier Extension Bit) which is transmitted as dominant in the case of a frame in standard format. For frames in extended format it is recessive. The RTR bit is transmitted dominant or recessive depending on whether data are being transmitted or whether a specific message is being requested from a station. In place of the RTR bit in standard format the substitute remote request (SRR) bit is transmitted for frames with extended ID. The SRR bit is always transmitted as recessive, to ensure that in the case of arbitration the standard frame always has priority bus allocation over an extended frame when both messages have the same base identifier. Unlike the standard format, in the extended format the IDE bit is followed by the 18-bit ID extension, the RTR bit, and a reserved bit (r1). All the following fields are identical with standard format. Conformity between the two formats is ensured by the fact that the CAN controllers which support the extended format can also communicate in standard format. (g) Implementations of the CAN protocol. Communication is identical for all implementations of the CAN protocol. There are differences, however, with regard to the extent to which the implementation takes over message transmission from the microcontrollers which follow it in the circuit. CAN controllers with intermediate buffer (formerly called basicCAN chips) have implemented as hardware the logic necessary to create and verify the bit stream according to protocol. However, the administration of data sets to be sent and received, acceptance filtering in particular, is carried out to only a limited extent by the CAN controller. Typically, CAN controllers with intermediate buffer have two reception and one transmission buffer. The 8-bit code and mask registers allow a limited acceptance filtering (8 MSB of the identifier). Suitable choice of these register values allows groups of identifiers or in borderline cases all IDs to be selected. If more than the 8 ID-MSBs are necessary to Zhang_Ch03.indd 299 5/13/2008 5:41:22 PM 300 INDUSTRIAL CONTROL TECHNOLOGY differentiate between messages, then the microcontroller following the CAN controller in the circuit must complement acceptance filtering by software. CAN controllers with intermediate buffer may place a strain on the microcontroller with the acceptance filtering, but they require only a small chip area and can therefore be produced at lower cost. In principle they can accept all objects in a CAN network. CAN objects consist mainly of three components: identifier, data length code, and the actual useful data. CAN controllers with object storage (formerly called FullCAN) function like CAN controllers with intermediate buffers, but also administer certain objects. Where there are several simultaneous requests they determine, for example, which object is to be transmitted first. They also carry out acceptance filtering for incoming objects. The interface to the following microcontroller corresponds to a RAM. Data to be transmitted are written into the appropriate RAM area, and data received are read out correspondingly. The microcontroller has to administer only a few bits (e.g., transmission request). CAN controllers with object storage are designed to take as much strain as possible off the local microcontroller. These CAN controllers require a greater chip area, however, and are therefore more expensive. In addition to this, they can only administer a limited number of chips. CAN controllers are now available which combine both principles of implementation. They have object storage, at least one of which is designed as an intermediate buffer. For this reason there is no longer any point in differentiating between basicCAN and fullCAN. As well as CAN controllers which support all functions of the CAN protocol, there are also CAN chips which do not require a following microcontroller. These CAN chips are called serial link I/O (SLIO). CAN chips are CAN slaves and have to be administered by a CAN master. (2) CAN physical layer. (a) Physical CAN connection. Data rates (up to 1 Mbit/s) necessitate a sufficiently steep pulse slope, which can be implemented only by using power elements. A number of physical connections are basically possible. However, the users and manufacturers group, CAN in Automation, recommends the use of driver circuits in accordance with ISO 11898. Integrated driver chips in accordance with ISO 11898 are available from several companies (Bosch, Philips, Siliconix, Zhang_Ch03.indd 300 5/13/2008 5:41:22 PM 301 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL and Texas Instruments). The international users and manufacturers group, CAN in Automation (CiA), also specifies several mechanical connections (cable and connectors) (Fig. 3.14). (b) Physical media. The basis for transmitting CAN messages and for competing for bus access is the ability to represent a dominant and a recessive bit value. This is possible for electrical and optical media so far. For electrical media the differential output bus voltages are defined in ISO 11898-2 and ISO 11898-3, in SAE J2411, and ISO 11992. With optical media the recessive level is represented by “dark” and the dominant level by “light.” The physical medium most commonly used to implement CAN networks is a differentially driven pair of wires with common return. For vehicle body electronics, single wire bus lines are also used. Some efforts have been made to develop a solution for the transmission of CAN signals on the same line as the power supply. The parameters of the electrical medium become important when the bus length is increased. Signal propagation, Microcontroller CAN controller T×0 T×1 R×0 R×1 T×D R×D Ref +6 V Rs Vcc 100 nF CAN transceiver Gnd CAN_L CAN_H Bus termination Bus termination CAN_H RT CAN bus lines RT CAN_L Figure 3.14 Physical CAN connection according to ISO 11898. Zhang_Ch03.indd 301 5/13/2008 5:41:22 PM 302 INDUSTRIAL CONTROL TECHNOLOGY the line resistance, and wire cross-sections are factors when dimensioning a network. In order to achieve the highest possible bit rate at a given length, a high signal speed is required. For long bus lines the voltage drops over the length of the bus line. The wire cross-section necessary is calculated by the permissible voltage drop of the signal level between the two nodes farthest apart in the system and the overall input resistance of all connected receivers. The permissible voltage drop must be such that the signal level can be reliably interpreted at any receiving node. (c) Network topology. Electrical signals on the bus are reflected at the ends of the electrical line unless measures against that have been taken. For the node to read the bus level correctly, it is important that signal reflections are avoided. This is done by terminating the bus line with a termination resistor at both ends of the bus and by avoiding unnecessarily long stub lines of the bus. The highest possible product of transmission rate and bus length line is achieved by keeping as close as possible to a single line structure and by terminating both ends of the line. Specific recommendations for this can be found in the applicable standards (i.e., ISO 11898-2 and -3). It is possible to overcome the limitations of the basic line topology by using repeaters, bridges, or gateways. A repeater transfers an electrical signal from one physical bus segment to another segment. The signal is only refreshed and the repeater can be regarded as a passive component comparable to a cable. The repeater divides a bus into two physically independent segments. This causes an additional signal propagation time. However, it is logically just one bus system. A bridge connects two logically separated networks on the data link layer (OSI Layer 2). This is so that the CAN identifiers are unique in each of the two bus systems. Bridges implement a storage function and can forward messages or parts thereof in an independent time-delayed transmission. Bridges differ from repeaters since they forward messages, which are not local, whereas repeaters forward all electrical signals including the CAN identifier. A gateway provides the connection of networks with different higher layer protocols. It therefore performs the translation of protocol data between two communication systems. This translation takes place on the application layer (OSI Layer 7). (d) Bus access. For the connection between a CAN controller chip and a two-wire differential bus, a variety of CAN transceiver chips according to different physical layer standards are available ( ISO 11898-2 and -3, etc.). Zhang_Ch03.indd 302 5/13/2008 5:41:22 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 303 This interface basically consists of a transmitting amplifier and a receiving amplifier transceiver = transmit and receive). Aside from the adaptation of the signal representation between chip and bus medium, the transceiver has to meet a series of additional requirements. As a transmitter it provides sufficient driver output capacity and protects the on-controller-chip driver against overloading. It also reduces electromagnetic radiation. As a receiver the CAN transceiver provides a defined recessive signal level and protects the on-controller-chip input comparator against overvoltages on the bus lines. It also extends the common mode range of the input comparator in the CAN controller and provides sufficient input sensitivity. Furthermore, it detects bus errors such as line breakage, short circuits, shorts to ground, etc. A further function of the transceiver can also be the galvanic isolation of a CAN node and the bus line. (e) Physical CAN protocols. The CAN protocol defines the data link layer and part of the physical layer in the OSI model, which consists of seven layers. The International Standards Organization (ISO) defined a standard, which incorporates the CAN specifications as well as a part of physical layer: the physical signaling, which comprises bit encoding and decoding (Non-Return-to-Zero (NRZ)) as well as bit timing and synchronization. (i) Bit encoding. In the chosen NRZ bit coding the signal level remains constant over the bit time and thus just one time slot is required for the representation of a bit (other methods of bit encoding are, e.g., Manchester or pulsewidth modulation). The signal level can remain constant over a longer period of time; therefore, measures must be taken to ensure that the maximum permissible interval between two signal edges is not exceeded. This is important for synchronization purposes. Bit stuffing is applied by inserting a complementary bit after five bits of equal value. Of course the receiver has to unstuff the stuff bits so that the original data content is processed. (ii) Bit timing and synchronization. On the bit level (OSI level one, physical layer), CAN uses synchronous bit transmission. This enhances the transmitting capacity but also means that a sophisticated method of bit synchronization is required. While bit synchronization in a character-oriented transmission (asynchronous) is performed upon the reception of the start bit available with each character, a synchronous transmission protocol is just one start bit available at the beginning of a frame. Zhang_Ch03.indd 303 5/13/2008 5:41:22 PM 304 INDUSTRIAL CONTROL TECHNOLOGY To enable the receiver to read the messages correctly, continuous resynchronization is required. Phase buffer segments are, therefore, inserted before and after the nominal sample point within a bit interval. The CAN protocol regulates bus access by bitwise arbitration. The signal propagation from sender to receiver and back to the sender must be completed within one bit time. For synchronization purposes, a further time segment, the propagation delay segment, is needed in addition to the time reserved for synchronization, the phase buffer segments. The propagation delay segment takes into account the signal propagation on the bus as well as signal delays caused by transmitting and receiving nodes. Two types of synchronization are distinguished: hard synchronization at the start of a frame and resynchronization within a frame. After a hard synchronization the bit time is restarted at the end of the sync segment. Therefore, the edge, which caused the hard synchronization, lies within the sync segment of the restarted bit time. Resynchronization shortens or lengthens the bit time so that the sample point is shifted according to the detected edge. (iii) Interdependency of data rate and bus length. Depending on the size of the propagation delay segment, the maximum possible bus length at a specific data rate (or the maximum possible data rate at a specific bus length) can be determined. The signal propagation is determined by the two nodes within the system that are farthest apart from each other. It is the time that it takes a signal to travel from one node to the one farthest away (taking into account the delay caused by the transmitting and receiving node), synchronization and the signal from the second node to travel back to the first one. Only then can the first node decide whether its own signal level (recessive in this case) is the actual level on the bus or whether it has been replaced by the dominant level by another node. This fact is important for bus arbitration. (3) CAN application layer protocols. In the CAN world there are different standardized application layer protocols. Some are very specific and related to specific application fields. Examples of CAN-based application layer protocols are given below: (a) CANopen. CANopen is a CAN-based higher layer protocol. It was developed as a standardized embedded network with Zhang_Ch03.indd 304 5/13/2008 5:41:22 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 305 highly flexible configuration capabilities. CANopen was predeveloped in an Esprit project under the chairmanship of Bosch. In 1995, the CANopen specification was handed over to the CAN in Automation (CiA) international users’ and manufacturers’ group. Originally, the CANopen communication profile was based on the CAN Application Layer (CAL) protocol. Version 4 of CANopen (CiA DS 301) is standardized as EN 50325-4. The CANopen specifications cover application layer and communication profile (CiA DS 301), as well as a framework for programmable devices (CiA 302), recommendations for cables and connectors (CiA 303-1), and SI units and prefix representations (CiA 303-2). The application layer as well as the CAN-based profiles is implemented in software. Standardized profiles (device, interface, and application profiles) developed by CiA members simplify the system design job of integrating a CANopen network system. Offthe-shelf devices, tools, and protocol stacks are widely available at reasonable prices. For system designers, it is very important to reuse application software. This requires not only communication compatibility, but also interoperability and interchange ability of devices. In the CANopen device and interface profiles, defined application objects exist to achieve the interchangeability of CANopen devices. CANopen is flexible and open enough to enable manufacturer-specific functionality in devices, which can be added to the generic functionality described in the profiles. CANopen unburdens the developer from dealing with CAN-specific details such as bit-timing and implementationspecific functions. It provides standardized communication objects for real-time data (Process Data Objects, PDO), configuration data (Service Data Objects, SDO), and special functions (Time Stamp, Sync message, and Emergency message) as well as network management data (Boot-up message, NMT message, and Error Control). (b) CAN Kingdom. CAN Kingdom unleashes the full power of CAN. It gives system designers maximum freedom to create their own systems, which is not bound to the CSMA/AMP multimaster protocol of CAN but can create systems using virtually any type of bus management and topology. CAN Kingdom opens the possibility for a module designer to design general modules without knowing which system they will finally be integrated into and what type of higher layer CAN protocol it will have. As the system designer can allow Zhang_Ch03.indd 305 5/13/2008 5:41:22 PM 306 INDUSTRIAL CONTROL TECHNOLOGY only specific modules to be used in the system, the cost advantage of an open system can be combined with the security of a proprietary system! Since the identifier in a CAN message not only identifies the message but also governs the bus access, a key factor is the enumeration of the messages. Another important factor is to see to it that the data structure in the data field is the same in both the transmitting and receiving modules. By adopting a few simple design rules these factors can be fully controlled and communication optimized for any system. This is done during a short setup phase at the initialization of the system. Including some modules not following the rules of the CAN Kingdom into a CAN Kingdom system is even possible. CAN Kingdom also enforces a conform documentation of modules and systems. (c) DeviceNet. DeviceNet is a low-cost communications link to connect industrial devices (such as limit switches, photoelectric sensors, valve manifolds, motor starters, process sensors, bar code readers, variable frequency drives, panel displays, and operator interfaces) to a network and eliminate expensive hard wiring. The direct connectivity provides improved communication between devices as well as important device-level diagnostics not easily accessible or available through hard wired I/O interfaces. DeviceNet is a simple, networking solution that reduces the cost and time to wire and install factory automation devices, while providing interchangeability of “like” components from multiple vendors. DeviceNet specifications have been developed by the Open DeviceNet Vendor Association (ODVA) and are internationally standardized. Buyers of the DeviceNet Specification receive an unlimited, royalty-free license to develop DeviceNet products. (d) J1939-based higher layer protocols. A J1939 network connects electronic control units (ECU) within a truck and trailer system. The J1939 specification—with its engine, transmission, and brake message definitions—is dedicated to diesel engine applications. It is supposed to replace J1587/J1708 networks. Other industries adopted the general J1939 communication functions, in particular the J1939/21 and J1939/31 protocol definitions—they are required for any J1939compatible system. They added other physical layers and defined other application parameters. The ISO standardized the J1939-based truck and trailer communication (ISO 11992) and the J1939-based communication for agriculture Zhang_Ch03.indd 306 5/13/2008 5:41:22 PM 307 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL and forestry vehicles (ISO 11783). The National Maritime Electronics Association (NMEA) specified the J1939-based communication for navigation systems in marine applications (NMEA 2000). One reason for the incorporation of J1939 specifications into others is the fact that it makes sense to reinvent the basic communication services. An industryspecific document defines the particular combination of layers for that industry. CiA has developed several CANopen interface profiles for J1939-based networks (CiA DSP 413). Gateways are defined according to ISO 11992-2 and ISO 11992-3. In addition, the CANopen profile family includes a framework for gateways according to SAE J1939/71. (4) CAN standards. The original specification is the Bosch specification. Version 2.0 of this specification is divided into two parts: (a) Standard CAN (Version 2.0A). Uses 11 bit identifiers. (b) Extended CAN (Version 2.0B). Uses 29 bit identifiers. The two parts define different formats of the message frame, with the main difference being the identifier length. There are two ISO standards for CAN. The difference is in the physical layer, where ISO 11898 handles high speed applications up to 1Mbit/s. ISO 11519 has an upper limit of 125 kbit/s. (a) Part A and Part B compatibility. There are three types of CAN controllers: Part A, Part B passive, and Part B (Table 3.1). They are able to handle the different parts of the standard as follows: Most 2.0A controllers transmit and receive only standard format messages, although some (known as 2.0B passive) will receive extended format messages but then ignore them. 2.0B controllers can send and receive messages in both formats. Note that if 29 bit identifiers are used on a bus that contains part A controllers, the bus will not work! (b) CAN bus physical layer. The physical layer is not part of the Bosch CAN standard. However, in the ISO standards transceiver characteristics are included. CAN transmits signals on Table 3.1 CAN Part A and Part B Compatibility Message Format\CAN Chip Type Part A Part B Passive Part B 11 bit ID 29 bit ID Ok Error! Ok Tolerated on the bus, but ignored Ok Ok Zhang_Ch03.indd 307 5/13/2008 5:41:22 PM 308 INDUSTRIAL CONTROL TECHNOLOGY the CAN bus which consists of two wires, a CAN-High and CAN-Low. These two wires operate in differential mode, that is, they carry inverted voltages (to decrease noise interference). The voltage levels, as well as other characteristics of the physical layer, depend on which standard is being used. (i) ISO 11898. The voltage levels for a CAN network which follows the ISO 11898 (CAN High Speed) standard are described in Table 3.2. Note that for the recessive state, nominal voltage for the two wires is the same. This decreases the power drawn from the nodes through the termination resistors. These resistors are 120 Ω and are located on each end of the wires. Some people have played with using central termination resistors (i.e., putting them in one place on the bus). This is not recommended since that configuration will not prevent reflection problems. (ii) ISO 11519. The voltage levels for a CAN network which follows the ISO 11519 (CAN Low Speed) standard are described in Table 3.3. ISO 115519 does not require termination resistors. These are not necessary because the limited bit rates (maximum 125 kB/s) make the bus insensitive to reflections. The voltage level on the CAN bus is recessive when the bus is idle. Table 3.2 ISO 11898 Parameters for CAN Signal CAN-High CAN-Low Recessive State (V) Dominant State (V) Min Nominal Max Min Nominal Max 2.0 2.0 2.5 2.5 3.0 3.0 2.75 0.5 3.5 1.5 4.5 2.25 Table 3.3 ISO 11519 Parameters for CAN Signal CAN-High CAN-Low Zhang_Ch03.indd 308 Recessive State (V) Dominant State (V) Min Nominal Max Min Nominal Max 1.6 3.1 1.75 3.25 1.9 3.4 3.85 0 4.0 1.0 5.0 1.15 5/13/2008 5:41:22 PM 309 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL (iii) Bus lengths. The maximum bus length for a CAN network depends on the bit rate used. It is required that the wavefront of the bit signal has time to travel to the most remote node and back again before the bit is sampled. This means that if the bus length is near the maximum for the bit rate used, one should choose the sampling point with utmost care—on the other hand, one should always do that! Table 3.4 gives the different bus lengths and the corresponding maximum bit rates. (iv) Cable. According to the ISO 11898 standard, the impedance of the cable shall be 120 ± 12 Ω. It should be twisted par, shielded or unshielded. Work is in progress on the single-wire standard SAE J2411. 3.2.1.4 Interbus Interbus was one of the very first Fieldbuses to achieve widespread popularity. It continues to be popular because of its versatility, speed, diagnostic and autoaddressing capabilities. Physically, it has the appearance of being a typical line-and-drop-based network, but in reality it is a serial ring shift register. Each slave node has two connectors, one which receives data and one which passes data onto the next slave. Interbus technology provides an open Fieldbus system, which embraces all the process I/Os required for almost any control system. Interbus is able to fulfill essential requirements of high-performance control concepts, as it is (1) a cost-effective solution with bus systems, which transmits data serially and reduces the amount of parallel cabling required; (2) an open and manufacturer-independent networking system, which can be easily connected with existing control systems; (3) flexible with regard to future modifications or expansions. Table 3.4 CAN Bus Length Bus Length (m) Maximum Bit Rate (bit/s) 40 100 200 500 6 km 1 Mbit/s 500 kbit/s 250 kbit/s 125 kbit/s 10 kbit/s Zhang_Ch03.indd 309 5/13/2008 5:41:23 PM 310 INDUSTRIAL CONTROL TECHNOLOGY With its special features and an extensive product range, Interbus has established itself successfully in all sectors of industry. Its traditional field of application is the automotive industry, but Interbus is also increasingly being used as an automation solution in other areas such as materials handling and conveying, the paper and print industry, the food and beverage industry, building automation, the wood-processing industry, assembly and robotics applications, general mechanical engineering, and, more recently, in process engineering. In addition to standard applications for connecting a large number of sensors and actuators in the field to the higher level control system via a serial bus system, Interbus can also be used to fulfill a variety of special application requirements such as (1) driving synchronically a control loop application in a mill train and (2) alternative and changing bus configuration in a machining center. (1) Operation mechanism. Interbus works with a master/slave access method, in which the master also establishes the connection to the higher level control or bus system. In terms of topology, Interbus is a ring system with an active connection to communication devices. Starting at the Interbus master, the controller board, all devices are actively connected on the ring system. Each Interbus device (slave) has two separate lines for data transmission: one for forward data transfer and one for return data transfer. This eliminates the need for a return line from the last to the first device, necessary in a simple ring system. The forward and return lines run in one cable. From the installation point of view, Interbus is similar to bus or linear structures, as only one bus cable connects one device with the next. To enable the structuring of an Interbus system, subring systems (bus segments) can be formed on the main ring, the source of which is the master. These subring systems are connected with bus couplers (also known as bus terminal modules). Figure 3.15 illustrates the basic structure of an Interbus system with one main ring and two subring systems. The remote bus is installed from the controller board. Remote bus devices and bus couplers are connected to the remote bus. Each bus coupler connects the remote bus with a subring system. There are two different types of subring system, which are available in different installation versions: (a) The local bus (formally known as the I/O bus) is responsible for local management, connects local bus devices, and is typically used to form local I/O compact stations, for example, in the control cabinet. It is also available as a robust version for direct mounting on machines and systems. Zhang_Ch03.indd 310 5/13/2008 5:41:23 PM 311 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL Host system (IPC, PC, PLC) 256 remote bus devices, maximum Controller board (bus master) 4096 I/O points, maximum 512 devices in total Localbus Bus coupler LB device LB device 400 m Remote bus RB device Remote bus branch Bus coupler RB device RB device 400 m (1312.34 ft.) RB device RB—Remotebus LB—Local bus Figure 3.15 Basic structure of an Interbus system. (b) The remote bus branch connects remote bus devices and connects distributed devices over large distances. Remote bus branches can be used to set up complex network topologies, which are ideal for complex technical processes distributed over large distances. The Interbus remote bus cable forms an RS-485 connection and, because of the ring structure and the additional need for an equalizing conductor between two remote bus devices, it requires five cables. Due to the different physical transmission methods, the local bus is available with nine cables and TTL levels for short distances (up to 1.5 m) and as a two-wire cable with a TTYbased current interface for medium distances (up to 10 m). Due to the integrated amplifier function in each remote bus device, the total expansion of the Interbus system can reach 13 km. To ensure that the system is easy to operate, the number of Interbus devices is limited to a maximum of 512. Zhang_Ch03.indd 311 5/13/2008 5:41:23 PM 312 INDUSTRIAL CONTROL TECHNOLOGY Interbus works as a shift register, which is distributed across all bus devices and uses the I/O-based summation frame method for data transmission. Each bus device has data memories, which are combined via the ring connection of the bus system to form a large shift register. Figure 3.16 illustrates the data transmission principle. A data packet in the summation frame is made available in the send shift register by the master. The data packet contains all data that is to be transmitted to the bus devices (OUT data). The corresponding data registers in the bus devices contain the data to be transmitted to the master (IN data) (Fig. 3.16a). The OUT data is now transferred from the master to the device and the IN data is transferred from the devices to the master in one data cycle. The master starts by sending the loop-back word through the ring. At the end of the data cycle, Master Loopback OUT data 4 OUT data 3 OUT data 2 OUT data 1 Slave 1 IN data 1 Slave 2 IN data 2 Slave 4 IN data 4 IN data 3 Slave 1 OUT data 1 Slave 2 OUT data 2 Slave 4 OUT data 4 Slave 3 OUT data 3 Slave 3 (a) Master IN data 4 IN data 3 IN data 2 IN data 1 Loopback (b) Figure 3.16 Principle of data transmission on Interbus: (a) distribution of data before a data cycle and (b) distribution of data after a data cycle. Zhang_Ch03.indd 312 5/13/2008 5:41:23 PM 313 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL the master receives the loop-back word. The loop-back word “pulls” the OUT data along behind it while “pushing” the IN data along in front of it. This is called full duplex data transmission (Fig. 3.16b). The devices do not have to be addressed explicitly as the physical position of a device in the ring is known and the master can position the information to be transmitted at this point in the summation frame telegram. In the example, the first data word after the loop-back word is addressed to slave 4, for example. The amount of user data to be pushed through the ring corresponds to the total data length of all bus devices. The bus couplers are integrated into the ring but do not provide any user data. Data widths between 1 bit and 64 bytes per data direction are permitted in one Interbus device. Unlike local bus segments, whose components only really differ in terms of installation technology, Interbus loop (sensor loop, IP 65 local bus) offers a new physical transmission method. The individual devices are connected via a simple two-wire unshielded cable to form a ring. The data and the 24 V power supply for up to 32 sensors are also supplied via the cable. Figure 3.17 shows the configuration of an Interbus loop segment. Data is transmitted as load-independent current signals, which have a higher level of immunity to interference than the voltage signals normally used. The data to be transmitted is modulated using Manchester code on the 24 V supply voltage (Interbus usually uses the NRZ code). The physical bus Remote bus IN UL US Interbus Loop segment Loop device 1 10 m (32.81 ft.) Loop device 2 UA Loop device 64 ... ... Bus coupler Remote bus OUT 100 m (328.08 ft.) Figure 3.17 Interbus loop segment (UL, power supply for the bus logic; US, power supply for the Interbus loop; UA, local power supply for actuators). Zhang_Ch03.indd 313 5/13/2008 5:41:23 PM 314 INDUSTRIAL CONTROL TECHNOLOGY characteristics are converted by an appropriate bus terminal module, which can be connected to the Interbus ring at any point in a remote bus segment. One of the main fields of application of Interbus loop is the connection of individual devices with IP 65 and IP 54 connections directly in the system. An extensive range of functions and devices is available as bus devices. The Interbus protocol is not converted in any way in an Interbus loop, which means that complex gateways are not required and an Interbus loop segment can be used in conjunction with any other type of Interbus device. Data scanning is absolutely synchronous in all parts of the Interbus system. Despite this, the high scanning speed is maintained. An Interbus system is configured by connecting the bus devices one after the other in a ring. Bus couplers segment the ring according to the application requirements. With Interbus G4 (Generation 4) and later, it is possible to set up complex network topologies, which can be optimized for the structure of the automation system, by integrating bus couplers with an additional bus connection. There are two ways of structuring the configuration of this type of Interbus network: (i) divide the entire network into various levels; (ii) assign segment-specific device numbers. Both configuration methods are explained using the example of an Interbus network configuration with four levels, as illustrated in Fig. 3.18. The network is split into four different levels starting with the bus master on the main remote bus line as the first level. The branching secondary lines are now assigned a second level. The devices connected to these lines can form additional substructures, etc. In this way, a nesting depth of up to 16 levels can be achieved. The sequence is such that a local bus (formally known as the I/O bus) in a remote bus segment is always assigned to the next level. Segment-specific device numbers are assigned either automatically according to the physical configuration or they can be freely specified by the user. The numbering comprises two components: <Device number> = <Bus segment number> • <Position number in bus segment>. According to this pattern, the second digit of the device number for all remote devices is zero, for example, 1.0. The second digit is only used by the local bus devices (e.g., I/O Zhang_Ch03.indd 314 5/13/2008 5:41:27 PM 315 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL Bus master 1.0 ... 1.1 1.2 3.0 3.1 3.2 5.0 5.1 1.8 2.0 BK ... 3.8 4.0 BK 5.2 ... 5.8 6.0 BK 8.0 7.0 8.1 Level 1 Level 2 Level 3 Level 4 BK—Bus coupler with additional remote bus branch, e.g., IBS ST 24 BK RB-T —Remotebus —Localbus Figure 3.18 Interbus network configuration with four levels. modules) connected downstream of the remote device, for example, 1.1. Bus couplers with an additional remote bus branch appear as two separate remote bus devices with one local bus/remote bus branch, for example, bus coupler 1.0/2.0. When physically assigning this type of remote bus device, the remote bus branch is assigned the next consecutive number, for example, 3.0. Any additional subbranches on this branch are assigned the next consecutive number, for example, 4.0, 5.0, etc. The outgoing remote bus from the branch is counted as the last component, for example, 8.0. Device numbering is a structuring tool and should not be confused with device addressing. Although the device numbers can be used for addressing purposes, this is not absolutely necessary. (2) Interbus system devices (a) Protocol chip. The most important element in the electrical configuration of an Interbus device is the Interbus protocol chip, which manages the complete summation frame protocol and provides the physical interface to the Interbus ring. The bus master and Interbus slave devices use different protocol chips according to their function in the Interbus Zhang_Ch03.indd 315 5/13/2008 5:41:27 PM 316 INDUSTRIAL CONTROL TECHNOLOGY system. Hardware solutions tailored to meet specific technical requirements are available for both Interbus master and slave solutions. The parts of the Interbus protocol that correspond to layers 1 and 2 of the OSI reference model are processed entirely in the protocol machine. This means that basic devices require additional software or processing power. The protocol machine also provides physical access to the incoming (IB IN) and outgoing (IB OUT) Interbus interface. Both shift registers—the ID register and data register— operate as send and receive buffers in the ID and data cycle. The application and/or higher protocol layers can access this buffer via the MPM interface (Multifunction Pin, MFP). The MFP interface can be set according to interface requirements. The data registers can be expanded with external registers (ToExR, FromExR). The Interbus register chip SRE 1, which, if required, can expand the shift register width of an Interbus device to 64 bytes, is used for register expansion. By default, the register width of the SUPI 3 is 8 bytes. The diagnostic and report manager constantly monitors the operation (on chip diagnostics). Any error descriptions that are received, such as CRC errors, transient loss of medium, voltage dips, etc., are saved to the ID send buffer and can be read from there by the master at any time. This means that unique error locations can even be identified for sporadic errors that are difficult to diagnose. The Interbus slave chip enables all Interbus device variants for the remote and local bus to be implemented, with the exception of those for Interbus loop. Interbus loop also works with the Interbus protocol but uses a different physical transmission medium, which requires the protocol chip on the physical interface to be of the same format. The standard master protocol chip for Interbus masters is the IPMS microcontroller. The IPMS is designed to work with a wide range of different processors. The master chip is often used together with the Motorola CPU 68332. The master firmware, which manages the Interbus functions, is stored in the EPROM. Only actual bit transmission (Layer 1, parts of Layer 2) takes place via the IPMS. The IPMS is connected to the relevant host system via a shared memory area, which, in its simplest format, is a Dual Port Memory (DPM) or a Multiport Zhang_Ch03.indd 316 5/13/2008 5:41:28 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 317 Memory (MPM). Interbus masters with IPMS are available in various formats depending on the functions required. (b) Local bus devices. An I/O bus interface for the two-wire protocol with the SUPI 3 is an interface example used to configure an ST local bus. The ST local bus operates with four transmission signals, which, due to the ring format of Interbus, are available twice at the incoming and outgoing local bus interface as IN and OUT signal lines. In addition, one incoming and one outgoing reset line are also available in the local bus. The bus signals can be connected directly to the local bus connectors, as the SUPI 3 meets the Interbus specification for the local bus even without external drivers and receivers. (c) Remote bus devices. If it is used as a remote bus device, the drivers and receivers required for differential signal transmission to RS-485 must be added to the SUPI. On the remote bus, transmission takes place via two twisted pair cables (DO+/DO–, DI+/DI–). Unlike the local bus, remote bus devices require a dedicated power supply for the device logic, as this is no longer provided via the bus cable. (d) Interbus loop devices. Although Interbus loop devices also operate with the standardized Interbus protocol, they do not transmit voltage signals to RS-485, which is usually the case on Interbus. Instead, they use load-independent current signals and Manchester coding to transmit the data and supply voltage on one and the same bus line (loop). Due to the different physical transmission medium, a special protocol chip, the IBS LPC, is available for Interbus loop. This chip is an ASIC with approximately 7000 gate equivalents and is supplied in QFP-44 housing. Special loop diagnostics are integrated into the LPC 2 to extend the familiar diagnostic functions of the SUPI 3. (3) Protocol structure. The Interbus protocol, which has been optimized specifically for the requirements of automation technology, transmits single-bit data from limit switches or to switching devices (process data) and complex programs or data records to intelligent field devices (parameter data) with the same level of efficiency and safety. Process data is transmitted in the fixed and cyclic time slot in real-time conditions, while parameter data comprises the acyclic transmission of larger volumes of data as and when required. The continuity of an Interbus network for very different tasks within an automation system—ensured in essence by the standard protocol—is supported by additional measures: (1) the adaptation of the physical transmission method Zhang_Ch03.indd 317 5/13/2008 5:41:28 PM 318 INDUSTRIAL CONTROL TECHNOLOGY “downward,” making it easy to install and connect individual sensors and actuators; (2) the provision of “upward” interface couplers to connect Interbus networks directly with factory and or company networks (Ethernet networks); (3) the guarantee of easy configuration, project planning, and diagnostics with uniform software tools. The Interbus protocol is based on the OSI reference model and for reasons of efficiency only takes into account layers 1, 2, and 7 (Fig. 3.19). Certain functions from layers 3 to 6 have been included in application Layer 7. The physical layer (Layer 1) defines both the time conditions (such as the baud rate, permissible jitter, etc.) and the formats for encoding information. The data link layer (Layer 2) ensures data integrity and manages cyclic data transfer via the bus using the summation frame protocol. The transmission methods and protocols on layers 1 and 2 can be found in DIN 19 258. Following on from the data link layer, data access to the Interbus devices takes place in the application layer as required via two different data channels: (a) The process data channel serves the primary use of Interbus as a sensor and actuator bus. The cyclic exchange of I/O data between the higher level control system and the connected sensors/actuators takes place via this channel. (b) The parameter channel supplements cyclic data exchange with individual I/O points in connection-oriented message exchange. This type of communication requires additional data packing, as large volumes of information are being exchanged between the individual communication partners. Data is transmitted using communication services based on the client/server model. Interbus devices almost always have one process data channel. A parameter channel can also be fitted as an optional extra. Application layer Parameter data channel Process data channel Layer 2 Data link layer Layer 1 Physical layer Network management Layer 7 Figure 3.19 Interbus protocol structure. Zhang_Ch03.indd 318 5/13/2008 5:41:28 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 319 During operation, an Interbus system requires settings to be made and provides a wide range of diagnostic information. This information is processed by the network management on each layer. More detailed information about readiness for operation, error states, and statistical data can also be accessed and evaluated, and network configuration settings can be made. The hybrid protocol structure of Interbus for the two different data classes (process data and parameter data) and its independent data transmission via two channels is a decisive factor in the performance of the Interbus protocol. The protocol enables the creation of a seamless network comprising control systems and intelligent field devices right down to individual sensors and actuators. 3.2.1.5 Ethernets/Hubs Ethernet is the major local area network (LAN) technology in use today, and is widely used for the LAN-connected PCs and workstations. Ethernet refers to the family of LAN products covered by the IEEE 802.3 standard, and the technology can run over both optical fiber and twisted-pair cables. Over the years, Ethernet has steadily evolved to provide additional performance and network intelligence. More than 300 million switched Ethernet ports have been installed worldwide. Ethernet technology enjoys such wide acceptance because it is easy to understand, deploy, manage, and maintain. Ethernet is low cost and flexible, and supports a variety of network topologies. Although traditional, non-Ethernet-based industrial solutions have a data rate of between 500 kbps to 12 Mbps, Ethernet technology can deliver substantially higher performance. Because it is based on industry standards, it can run and be connected over any Ethernet-compliant device from any vendor. This continual improvement has made Ethernet an excellent solution for industrial applications. Today, the technology can provide four data rates. (1) 10BASE-T Ethernet delivers performance of up to 10 Mbps over twisted-pair copper cable. (2) Fast Ethernet delivers a speed increase of 10 times the 10BASE-T Ethernet specification (100 Mbps) while retaining many of Ethernet’s technical specifications. These similarities enable organizations to use 10BASE-T applications and network management tools on Fast Ethernet networks. (3) Gigabit Ethernet extends the Ethernet protocol even further, increasing speed 10-fold over Fast Ethernet to 1000 Mbps, or Zhang_Ch03.indd 319 5/13/2008 5:41:28 PM 320 INDUSTRIAL CONTROL TECHNOLOGY 1 Gigabit/s. Because it is based upon the current Ethernet standard and compatible with the installed base of Ethernet and Fast Ethernet switches and routers, network managers can support Gigabit Ethernet without needing to retrain or learn a new technology. (4) 10 Gigabit Ethernet, ratified as a standard in June 2002, is an even faster version of Ethernet. It uses the IEEE 802.3 Ethernet media access control (MAC) protocol, the IEEE 802.3 Ethernet frame format, and the IEEE 802.3 frame size. Because 10 Gigabit Ethernet is a type of Ethernet, it can support intelligent Ethernetbased network services, interoperate with existing architectures, and minimize users’ learning curves. Its high data rate of 10 Gigabits/s makes it a good solution to deliver high bandwidth in wide area networks (WANs) and metropolitan area networks (MANs). (1) Industrial Ethernet. Recognizing that Ethernet is the leading networking solution, many industry organizations are porting the traditional Fieldbus architectures to Industrial Ethernet. Industrial Ethernet applies the Ethernet standards developed for data communication to manufacturing control networks (Fig. 3.20). Using IEEE standards-based equipment, organizations can migrate all or part of their factory operations to an Ethernet environment at the pace they wish. Instead of using architectures composed of multiple separate networks, Industrial Ethernet can unite a company’s administrative, control-level, and device-level networks to run over a single network infrastructure. In an Industrial Ethernet network, Fieldbus-specific information that is used to control I/O devices and other manufacturing components are embedded into Ethernet frames. Because the technology is based Device profile Valves Drivers Robotics Application object library Application Layer 2 (Data link) Layer 1 (Physics) Explicit messages, I/O messages Message routing, connection management TCP UDP IP Ethernet MAC/LLC Physical layer QoS parameter Layer 4(Transport Layer 3 (Network) Data management services Other Fieldbus—Spec Semiconductor Figure 3.20 Using intelligent Ethernet for automation control. Zhang_Ch03.indd 320 5/13/2008 5:41:28 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 321 on industry standards rather than on custom or proprietary standards, it is more interoperable with other network equipment and networks. Although Industrial Ethernet is based on the same industry standards as traditional Ethernet technology, the implementation of the two solutions is not always identical. Industrial Ethernet usually requires more robust equipment and a very high level of traffic prioritization when compared with traditional Ethernet networks in a corporate data network. The primary difference between Industrial Ethernet and traditional Ethernet is the type of hardware used. Industrial Ethernet equipment is designed to operate in harsh environments. It includes industrial-grade components, convection cooling, and relay output signaling. And it is designed to operate at extreme temperatures and under extreme vibration and shock. Power requirements for industrial environments differ from data networks, so the equipment runs using 24 V of DC power. To maximize network availability, it also includes fault-tolerant features such as redundant power supplies. Industrial Ethernet environments also differ from traditional Ethernet networks in their use of multicasting by hosts for certain applications. Industrial applications often use producer– consumer communication, where information “produced” by one device can be “consumed” by a group of other devices. In a producer–consumer environment, the most important priority for a multicast application is to guarantee that all hosts receive data at the same time. A traditional Ethernet network, on the other hand, focuses more on the efficient utilization of bandwidth in general, and less on synchronous data access. To help optimize synchronous data access, Industrial Ethernet equipment must include the intelligence and Quality of Services (QoS) features needed to enable organizations to appropriately prioritize multicast transmissions. Ethernet technology can provide not only excellent performance for manufacturing applications, but a wide range of network security measures to provide both confidentiality and data integrity. Confidentiality helps ensure that data cannot be accessed by unauthorized users. Data integrity protects data from intentional or accidental alteration. These network security advantages protect manufacturing devices like programmable logic controllers (PLCs) as well as PCs, and apply to both equipment and data security. Manufacturers can use many methods to help ensure network confidentiality and integrity. These network security measures can be grouped into Zhang_Ch03.indd 321 5/13/2008 5:41:28 PM 322 INDUSTRIAL CONTROL TECHNOLOGY several categories, including access control and authentication, and secure connectivity and management. Access control is commonly implemented using firewalls or network-based controls protecting access to critical applications, devices, and data so that only legitimate users and information can pass through the network. However, access-control technology is not limited to dedicated firewall devices. Any device that can make decisions to permit or deny network traffic, such as an intelligent switch, is part of an integrated access-control solution. When designing an access-control solution, network administrators can set up filtering decisions based on a variety of criteria, such as an IP address or TCP/UDP port number. Intelligent switches can provide support for this advanced filtering to limit network access to authorized users. At the same time, they can enable organizations to enforce policy decisions based on the IP or MAC address of a laptop or PLC. Virtual LANs (VLANs) are another access-control solution, providing the ability to create multiple IP subnets within an Ethernet switch. VLANs provide network security and isolation by virtually segmenting factory floor data from other data and users. VLANs can also be used to enhance network performance, separating low-priority end devices from high-priority devices. Access controls can also include a variety of device or userauthentication services. Authentication services determine who may access a network and what services they are authorized to use. For example, the 802.1x authentication protocol provides port-based authentication so that only legitimate devices can connect to switch ports. Authentication services are an effective complement to other network security measures in a manufacturing environment. To provide additional protection for manufacturing networks, organizations can take several approaches to authenticate and encrypt network traffic. Using virtual private network (VPN) technology, Secure Sockets Layer (SSL) encryption can be applied to application-layer data in an IP network. Organizations can also use IP Security (IPSec) technology to encrypt and authenticate network packets to thwart network attacks such as sniffing and spoofing. VPN client software, together with dedicated VPN network hardware, can be used to encrypt device monitoring and programming sessions, and to support strong authentication. Manufacturers can also use Secure Shell (SSH) Protocol encryption for remote terminal logins to network devices. Version 3 of Simple Network Management Protocol (SNMP) also offers Zhang_Ch03.indd 322 5/13/2008 5:41:28 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 323 support for encryption and authentication of management commands and data. (2) Network topology. Because factory floor applications run in real time, the network must be available to users on a continuous basis, with little or no downtime. Manufacturers can help ensure network reliability using effective network design principles, as well as intelligent networking services. Manufacturers deploying an Ethernet solution should design networks with redundant paths to ensure that a single device outage does not take down the entire network. Two network topologies most often used are ring and hub-and-spoke. In hub-and-spoke designs (Fig. 3.21), three layers of switches are usually installed. The first layer is often referred to as the access layer. These switches provide connections for end-point devices like PLCs, robots, and Human– Machine Interfaces (HMIs). A second layer called the distribution layer provides connectivity between the access-layer switches. And a third layer called the core layer provides connectivity to other networks or to the Internet service provider (ISP) via routers. The distribution layer may include switches with routing functions to provide inter-VLAN routing. Access-layer switches, on the other hand, generally provide only Layer 2 (data link) forwarding services. For optimum performance, network equipment at each of these layers must be aware of the information contained within the Layer 2 through Layer 4 packet headers. In ring topologies (Fig. 3.22), all devices are connected in a ring. Each device has a neighbor to its left and right. If a connection on one side of the device is broken, network connectivity can still be maintained over the ring via the opposite side of the device. In some situations, manufacturers install dual counterrotating rings Figure 3.21 Hub-and-spoke network topology. Zhang_Ch03.indd 323 5/13/2008 5:41:28 PM 324 INDUSTRIAL CONTROL TECHNOLOGY Figure 3.22 Ring topology. to maximize availability. In a ring topology, each switch functions as both an access-layer and a distribution-layer switch. (3) Network protocols. To prevent loops from being formed in the network when devices are interconnected via multiple paths, some organizations use the Spanning Tree Protocol. If a problem occurs on a network node, this protocol enables a redundant alternative link to automatically come back online. The traditional Spanning Tree Protocol has been considered too slow for industrial environments. To address these performance concerns, the IEEE standards committee has ratified a new Rapid Spanning Tree Protocol (802.1w). This protocol provides subsecond convergence times that vary between 200 and 800 ms, depending on network topology. Using 802.1w, organizations can enjoy the benefits of Ethernet networks, with the performance and reliability that manufacturing applications demand. Another spanningtree option is Multiple Spanning Tree Protocol (802.1s). This enables VLANs to be grouped into spanning-tree instances. Each instance has a spanning-tree topology that is independent from other spanning-tree instances. This architecture provides multiple forwarding paths for data traffic, enables load balancing, and reduces the number of spanning-tree instances needed to support a large number of VLANs. Ethernet switches provide excellent connectivity and performance; however, each switch is another device that must be managed on the factory floor. To make switched Ethernet networks easy to support and maintain, intelligent switches include built-in management capabilities. These intelligent features make it easy to connect manufacturing devices to the network, without creating additional configuration tasks. And they help minimize network downtime if part of the network should fail. One of the most useful intelligent features in a switched Ethernet network is Option 82. In an Ethernet network, Dynamic Host Configuration Zhang_Ch03.indd 324 5/13/2008 5:41:29 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 325 Protocol (DHCP) lets devices dynamically acquire their IP addresses from a central server. The DHCP server can be configured to give out the same address each time or generate a dynamic one from a pool of available addresses. Because the interaction of the factory floor devices requires specific addresses, Industrial Ethernet networks usually do not use dynamic address pools. However, static addresses can have drawbacks. Because they are linked to the MAC address of the client, and because the MAC address is often hard-coded in the network interface of the client device, the association is lost when a client device fails and needs to be replaced. Extended fields in the DHCP packet can be filled in by the switch, indicating the location of the device requesting an IP address. The 82nd optional field, called Option 82, carries the specific port number and the MAC address of the switch that received the DHCP request. This modified request is sent on to the DHCP server. If an access server is Option 82-aware, it can use this information to formulate an IP address based on the Option 82 information. Effective use of Option 82 enables manufacturers to minimize administrative demands and maintain maximum network uptime even in the event of the failure of individual devices. Because manufacturing processes depend on the precise synchronization of processes, network determinism must be optimized to deliver the best possible performance. Data must be prioritized using QoS to ensure that critical information is received first. The multicast applications that are prevalent in manufacturing environments must be well managed using Internet Group Management Protocol (IGMP) snooping. Many Industrial Ethernet applications depend on IP multicast technology. IP multicast allows a host, or source, to send packets to another group of hosts called receivers anywhere within the IP network using a special form of IP address called the IP multicast group address. While traditional multicast services, such as video or multimedia, tend to scale with the number of streams, Industrial Ethernet multicast applications do not. Industrial Ethernet environments use a producer–consumer model, where devices generate data called “tags” for consumption by other devices. The devices that generate the data are producers and the devices receiving the information are consumers. Multicast is more efficient than unicast, because consumers will often want the same information from a particular producer. Each device on the network can be both a producer and a consumer of traffic. While most devices generate very little data, networks with a large number of nodes can generate a large amount of multicast Zhang_Ch03.indd 325 5/13/2008 5:41:29 PM 326 INDUSTRIAL CONTROL TECHNOLOGY traffic, which can overrun end devices in the network. Using mechanisms like QoS and IGMP snooping, organizations can control and manage multicast traffic in manufacturing environments. Many manufacturing applications depend on multicast traffic, which can introduce performance problems in the network. To address these challenges in an Industrial Ethernet environment, organizations can deploy IGMP snooping. IGMP snooping limits the flooding of multicast traffic by dynamically configuring the interfaces so that multicast traffic is forwarded only to interfaces associated with IP multicast devices. In other words, when a multicast message is sent to the switch, the switch forward the message only to the interfaces that are interested in the traffic. This is very important because it reduces the load of traffic traversing through the network. It also relieves the hosts from processing frames that are not needed. In a producer–consumer model used by Industrial Ethernet, IGMP snooping can limit unnecessary traffic from the I/O device that is producing, so that it only reaches the device consuming that data. Messages delivered to a given device that were intended for other devices consume resources and slow performance, so networks with many multicasting devices will suffer performance issues if IGMP snooping or other multicast limiting schemes are not implemented. The IGMP snooping feature allows Ethernet switches to “listen” to the IGMP conversation between hosts. With IGMP snooping, the Ethernet switch examines the IGMP traffic coming to the switch and keeps track of multicast groups and member ports. When the switch receives an “IGMP join” report from a host for a particular multicast group, the switch adds the host port number to the associated multicast forwarding table entry. When it receives an IGMP “leave group” message from a host, it removes the host port from the table entry. After the switch relays the IGMP queries, it deletes entries periodically if it does not receive any IGMP membership reports from the multicast clients. A Layer 3 router normally performs the querying function. When IGMP snooping is enabled in a network with Layer 3 devices, the multicast router sends out periodic IGMP general queries to all VLANs. The switch responds to the router queries with only one “join” request per MAC multicast group. The switch then creates one entry per VLAN in the Layer 2 forwarding table for each MAC group from which it receives an IGMP join request. All hosts interested in this multicast traffic send “join” requests and are added to the forwarding table entry. Layer 2 multicast groups learned through IGMP snooping are dynamic. However, in a managed switch, organizations Zhang_Ch03.indd 326 5/13/2008 5:41:29 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 327 can statically configure MAC multicast groups. This static setting supersedes any automatic manipulation by IGMP snooping. Multicast group membership lists can consist of both userdefined settings and settings learned via IGMP snooping. (4) Quality of service (QoS). An Industrial Ethernet network may transmit many different types of traffic, from routine data to critical control information, or even bandwidth-intensive video or voice. The network must be able to distinguish among and give priority to different types of traffic. To address these issues, organizations can implement QoS using several techniques. QoS involves three important steps. First, different traffic types in the network need to be identified through classification techniques. Second, advanced buffermanagement techniques need to be implemented to prevent highpriority traffic from being dropped during congestion. Finally, scheduling techniques need to be incorporated to transmit highpriority traffic from queues as quickly as possible. In Layer 2 switches on an Ethernet network, QoS usually prioritizes native, encapsulated Ethernet frames, or frames tagged with 802.1p class of service (CoS) specifications. More advanced QoS mechanisms take this definition a step further. For example, advanced Ethernet switches can study and interpret the flow of QoS traffic as it is processed through the switch. A switch can be configured to prioritize frames based on given criteria at different layers of the OSI reference model. For example, traffic could be prioritized according to the source MAC address (in Layer 2) or the destination TCP port (in Layer 4). Any traffic traveling through the interface to which this QoS is applied is classified, and tagged with the appropriate priority. Once a packet has been classified, it is then placed in a holding queue in the switch, and scheduled based on the scheduling algorithm desired. In an Industrial Ethernet application, real-time I/O control traffic would share network resources with configuration (FTP) and data-collection flows, as well as other traffic, in the upper layers of the OSI reference model. By using QoS to give high priority to real-time UDP control traffic, organizations can prevent delay or jitter from affecting any control functions. 3.2.2 Interfaces Devices connect to the microprocessor using an interface bus. The specification of this bus defines speed between the microprocessor and the connected device that greatly affects the performance of the microprocessor. Zhang_Ch03.indd 327 5/13/2008 5:41:29 PM 328 INDUSTRIAL CONTROL TECHNOLOGY Peripherals can connect to the controller (or computer) using either an internal or an external interface. This subsection lists main interfaces popularly used in industrial control. 3.2.2.1 PCI, ISA, and PCMCIA (1) PCI bus. Intel has developed a standard interface, named the PCI (Peripheral Component Interface/Interconnect) local bus for microprocessors. This technology allows fast memory, disk and video access. The PCI bus is now the main interface bus used in most industrial controllers, and is rapidly replacing the ISA bus for internal interface devices. It is a very adaptable bus and most external buses, such as SCSI and USB connect to the processor via the PCI bus. The PCI bus transfers data using the system clock and can operate over a 32- or 64-bit data path. The high transfer rates used in PCI architecture machines limit the number of the PCI bus interfaces to two to three, normally the graphics adapter and hard disk controller. If data is transferred at 64 bits at a rate of 33 MHz, then the maximum transfer rate is 264 MB/s. Detailed descriptions for the PCI bus system architecture, the PCI operation, the bus arbitration, the bus configuration, and PCI bus interrupt handling are given in both Sections 2.1.4 and 7.3.1. (2) ISA bus. IBM developed the Industry Standard Architecture or ISA bus for their 80286-based AT (advanced technology) computer. It had the advantage of being able to deal with 16 bits of data at a time. An extra edge connector gives compatibility with the PC bus. This gives an extra 8 data bits and four address lines. Thus, the ISA bus has a 16-bit data and a 24-bit address bus. This gives a maximum of 16 MB of addressable memory and, like the PC bus, it uses a fixed clock rate of 8 MHz. The maximum data rate is thus 2 bytes (16 bits) per clock cycle, giving a maximum throughput of 16 MB/s. IBM’s PC/AT was designed with an expansion bus which not only provided for taking advantage of the new technology, but also remained compatible with the older style 8-bit XT add-in boards. Anticipating that advances in processors would again outpace advances in bus technology, the PC/AT was designed with two separate oscillators. In this way, the microprocessor and expansion bus could be run on different clocks with different speeds. Therefore, a controller or computer running a newer processor with 33 MHz clock speed could also run its expansion bus at an 8 MHz clock rate. ISA cards are more cumbersome to Zhang_Ch03.indd 328 5/13/2008 5:41:29 PM 329 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL install than other cards because I/O addresses, interrupts, and clock speed must be set using jumpers and switches on the card itself. The other bus options which use software to set these parameters are called Plug & Play. While there is nothing inferior about using jumpers and switches, it can be more intimidating for novice users. The ISA system, however, does not have a central registry from which to allocate system resources. Consequently, each device behaves as though it has sole access to system resources such as DMA, I/O ports, IRQs, and memory. Obviously, this can cause problems when using multiple add-in boards in a single system. In practice there is no speed difference between running many serial communication peripherals using a PCI or an ISA bus, though the PCI advantage is obvious for high-speed devices such as video cards. Thus, there is no reason to convert your current ISA serial communication systems to PCI, as ISA will provide equivalent functionality, generally at a lower price. However, if you are starting a new installation using a PC with few or no (as is increasingly the case today) ISA slots, or you prefer using Plug & Play cards, then you should consider using PCI adapters. Figure 3.23 shows a typical connection to the ISA bus. The ALE (sometimes known as BALE) controls the address latch; when active low, it latches the address lines A2–A19 to the ISA bus. The address is latched when ALE goes from a high to a low. The Pentium’s data bus is 64 bits wide, whereas the ISA expansion bus is 16 bits wide. It is the bus controller’s function to steer D0–D31 Processor Data latch D0–D15 Memory Address latch BE0 –BE3 A2–A19 ALE ISA bus A2–A31 A0 Bus controller A1 SBHE M16 IO16 Figure 3.23 ISA bus connections. Zhang_Ch03.indd 329 5/13/2008 5:41:29 PM 330 INDUSTRIAL CONTROL TECHNOLOGY data between the processor and the slave device for either 8-bit or 16-bit communications. The following are the descriptions of the ISA signals. (a) SA19 to SA0. System Address bits 19:0 are used to address memory and I/O devices within the system. These signals may be used along with LA23 to LA17 to address up to 16 MB of memory. Only the lower 16 bits are used during I/O operations to address up to 64K I/O locations. SA19 is the most significant bit. SA0 is the least significant bit. These signals are gated on the system bus when BALE is high and are latched on the falling edge of BALE. They remain valid throughout a read or write command. These signals are normally driven by the system microprocessor or DMA controller, but may also be driven by a bus master on an ISA board that takes ownership of the bus. (b) LA23 to LA17. Unlatched Address bits 23:17 are used to address memory within the system. They are used along with SA19 to SA0 to address up to 16 MB of memory. These signals are valid when BALE is high. They are “unlatched” and do not stay valid for the entire bus cycle. Decodes of these signals should be latched on the falling edge of BALE. (c) AEN. Address Enable is used to de-gate the system microprocessor and other devices from the bus during DMA transfers. When this signal is active, the system DMA controller has control of the address, data, and read/write signals. This signal should be included as part of ISA board select decodes to prevent incorrect board selects during DMA cycles. (d) BALE. Buffered Address Latch Enable is used to latch the LA23 to LA17 signals or decodes of these signals. Addresses are latched on the falling edge of BALE. It is forced high during DMA cycles. When used with AEN, it indicates a valid microprocessor or DMA address. (e) CLK. System Clock is a free-running clock typically in the 8–10 MHz range, although its exact frequency is not guaranteed. It is used in some ISA board applications to allow synchronization with the system microprocessor. (f) SD15 to SD0. System Data serves as the data bus bits for devices on the ISA bus. SD15 is the most significant bit. SD0 is the least significant bit. SD7 to SD0 are used for transfer of data with 8-bit devices. SD15 to SD0 are used for transfer of data with 16-bit devices. Sixteen-bit devices transferring data with eight-bit devices convert the transfer into two eight-bit cycles using SD7 to SD0. Zhang_Ch03.indd 330 5/13/2008 5:41:30 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 331 (g) –DACK0 to –DACK3 and –DACK5 to –DACK7. DMA Acknowledge 0 to 3 and 5 to 7 are used to acknowledge DMA requests on DRQ0 to DRQ3 and DRQ5 to DRQ7. (h) DRQ0 to DRQ3 and DRQ5 to DRQ7. DMA Requests are used by ISA boards to request service from the system DMA controller or to request ownership of the bus as a bus master device. These signals may be asserted asynchronously. The requesting device must hold the request signal active until the system board asserts the corresponding DACK signal. (i) –I/O CH CK. I/O Channel Check signal may be activated by ISA boards to request that a nonmaskable interrupt (NMI) be generated to the system microprocessor. It is driven active to indicate an incorrect error has been detected. (j) I/O CH RDY. I/O Channel Ready allows slower ISA boards to lengthen I/O or memory cycles by inserting wait states. This signals normal state is active high (ready). ISA boards drive the signal inactive low (not ready) to insert wait states. Devices using this signal to insert wait states should drive it low immediately after detecting a valid address decode and an active read or write command. The signal is released high when the device is ready to complete the cycle. (k) –IOR. I/O Read is driven by the owner of the bus and instructs the selected I/O device to drive read data onto the data bus. (l) –IOW. I/O Write is driven by the owner of the bus and instructs the selected I/O device to capture the write data on the data bus. (m) IRQ3 to IRQ7 and IRQ9 to IRQ12 and IRQ14 to IRQ15. Interrupt Requests are used to signal the system microprocessor that an ISA board requires attention. An interrupt request is generated when an IRQ line is raised from low to high. The line must be held high until the microprocessor acknowledges the request through its interrupt service routine. These signals are prioritized with IRQ9 to IRQ12 and IRQ14 to IRQ15 having the highest priority (IRQ9 is the highest) and IRQ3 to IRQ 7 having the lowest priority (IRQ7 is the lowest). (n) –SMEMR. System Memory Read instructs a selected memory device to drive data onto the data bus. It is active only when the memory decode is within the low 1 MB of memory space. SMEMR is derived from MEMR and a decode of the low 1 MB of memory. (o) –SMEMW. System Memory Write instructs a selected memory device to store the data currently on the data bus. It is Zhang_Ch03.indd 331 5/13/2008 5:41:30 PM 332 INDUSTRIAL CONTROL TECHNOLOGY active only when the memory decode is within the low 1 MB of memory space. SMEMW is derived from MEMW and a decode of the low 1 MB of memory. (p) –MEMR. Memory Read instructs a selected memory device to drive data onto the data bus. It is active on all memory read cycles. (q) –MEMW. Memory Write instructs a selected memory device to store the data currently on the data bus. It is active on all memory write cycles. (r) –REFRESH. Memory Refresh is driven low to indicate a memory refresh operation is in progress. (s) OSC. Oscillator is a clock with a 70 ns period (14.31818 MHz). This signal is not synchronous with the system clock (CLK). (t) RESET DRV. Reset Drive is driven high to reset or initialize system logic upon power up or subsequent system reset. (u) TC. Terminal Count provides a pulse to signal a terminal count has been reached on a DMA channel operation. (v) –MASTER. Master is used by an ISA board along with a DRQ line to gain ownership of the ISA bus. Upon receiving a –DACK a device can pull –MASTER low which will allow it to control the system address, data, and control lines. After –MASTER is low, the device should wait one CLK period before driving the address and data lines, and two clock periods before issuing a read or write command. (w) –MEM CS16. Memory Chip Select 16 is driven low by a memory slave device to indicate it is capable of performing a 16-bit memory data transfer. This signal is driven from a decode of the LA23 to LA17 address lines. (x) –I/O CS16. I/O Chip Select 16 is driven low by an I/O slave device to indicate it is capable of performing a 16-bit I/O data transfer. This signal is driven from a decode of the SA15 to SA0 address lines. (y) –0WS. Zero Wait State is driven low by a bus slave device to indicate it is capable of performing a bus cycle without inserting any additional wait states. To perform a 16-bit memory cycle without wait states, –0WS is derived from an address decode. (z) –SBHE. System Byte High Enable is driven low to indicate a transfer of data on the high half of the data bus (D15–D8). (3) PCMCIA (PC Card). The Personal Computer Memory Card International Association (PCMCIA) interface allows small, thin cards to be plugged into laptop, notebook, or palm computers. Zhang_Ch03.indd 332 5/13/2008 5:41:30 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 333 The interface was originally designed for memory cards (Version 1.0), but it has since been adopted for many other types of adapters (Version 2.0), such as fax/modems, sound cards, local area network cards, CD-ROM controllers, digital I/O cards, and so on. Most PCMCIA cards comply with either PCMCIA Type II or Type III. Type I cards are 3.3 mm thick, Type II take cards up to 5 mm thick, and Type III allows cards up to 10.5 mm thick. A new standard, Type IV, takes cards that are thicker than 10.5 mm. Type II interfaces can accept Type I cards, Type III accept Type I and Type II, and Type IV interfaces accept Type I, II, and III. The PCMCIA standard uses a 16-bit data bus (D0–D15) and a 26-bit address bus (A0–A25), which gives an addressable memory of 226 bytes (64 MB). The memory is arranged as: (1) Common memory and attribute memory, which gives a total addressable memory of 128 MB. (2) I/O addressable space of 65,536 (64K) 8-bit ports. The PCMCIA interface allows the PCMCIA device to map into the main memory or into the I/O address space. For example, a modem PCMCIA device would map its registers into the standard COM port addresses (such as 3F8h–3FFh for COM1 or 2F8h–2FF for COM2). Any accesses to the mapped memory area will be redirected to the PCMCIA rather than the main memory or I/O address space. These mapped areas are called windows. A window is defined with a START address and a LAST address. 3.2.2.2 IDE The most popular interface for hard disk drives is the integrated drive electronics (IDE) interface. Its main advantage is that the hard disk controller is built into the disk drive and the interface to the motherboard consists simply of a stripped-down version of the ISA bus. The most common standard is the ANSI-defined ATA-IDE standard. It uses a 40-way ribbon cable to connect to 40-pin header connectors. The standard allows for the connection of two disk drives in a daisy-chain configuration. This can cause problems because both drives have controllers within their drives. The primary drive is assigned as the master, and the secondary driver is the slave. A drive is set as a master or a slave by setting jumpers on the disk drive. They can also be set by software using the cable select pin on the interface. The specifications for the IDE are (1) Maximum of two devices (hard disks) (2) Maximum capacity for each disk of 528 MB Zhang_Ch03.indd 333 5/13/2008 5:41:30 PM 334 INDUSTRIAL CONTROL TECHNOLOGY (3) Maximum cable length of 18 in. (4) Data transfer rates of 3.3, 5.2, and 8.3 MB/s. A new standard called as enhanced IDE (E-IDE) allows for higher capacities than IDE has (1) Maximum of four devices (hard disks) (2) Uses two ports (for master and slaves) (3) Maximum capacity for each disk of 8.4 GB (4) Maximum cable length of 18 in. (5) Data transfer rates of 3.3, 5.2, 8.3, 11.1, and 16.6 MB/s. The PC (Personal Computer, in this chapter) is now a highly integrated system. The main elements of modern systems are the processor, the systems controller and the PCI IDE/ISA accelerator, as illustrated in Fig. 3.24. The system controller provides the main interface between the processor and the level-2 cache, the DRAM, and the PCI bus. It is one of the most important devices in the system and allows data to flow to and from the processor in the correct way. The PCI bus links to interface devices and also the PCI IDE/ISA accelerator (such as PIIX4 device). The PCI IDE/ISA device then interfaces to other buses, such as IDE and ISA. The IDE interface has separate signals for both the primary and secondary IDE drives; these are electrically isolated, which allows drives to be swapped easily without affecting the other port. The PCI IDE/ISA accelerator is a massively integrated device (the PIIX4 has 324 pins) and provides for an interface to other buses, such as Processor Level 2 cache System bus System controller (PAC/ MTXC) Cache bus DRAM DRAM bus PCI bus DMA PCI IDE/ISA accelerator (PIIX 4) interrupts ISA bus Reset USB bus Power management Primary IDE Secondary IDE X-bus SDIORDY# SDIOW# SDIOR# SDDREQ SDDACK# SDD [15:0] SDA [2.0 SDCS3# SDCS1# PDIORDY# PDIOW# PDIOR# PDDREQ PDDACK# PDD [15:0] PDD [2:0 PDS3# PDCS1# Figure 3.24 IDE system connections. Zhang_Ch03.indd 334 5/13/2008 5:41:30 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 335 USB and X-Bus. It also handles the interrupts from the PCI bus and ISA bus. It thus has two integrated 82C59 interrupt controllers, which support up to 15 interrupts. The PCI IDE/ISA accelerator also handles DMA transfers (on up to 8 channels), and thus has two integrated 82C37 DMA controllers. Along with this, it has an integrated 82C54, which provides for the system timer, DRAM refresh signal, and the speaker tone output. The IDE (or AT bus) is the de facto standard for most hard disks in PCs. It has the advantage over older type interfaces that the controller is integrated into the disk drive. Thus, the computer only has to pass high-level commands to the unit and actual control can be achieved with the integrated controller. Several companies developed a standard command set for an AT attachment (ATA). Commands include (1) read sector buffer—reads contents of the controller’s sector buffer (2) write sector buffer—writes data to the controller’s sector buffer (3) check for active (4) read multiple sectors (5) lock drive door. The control of the disk is achieved by passing a number of high-level commands through a number of I/O port registers. 3.2.2.3 SCSI Small computer systems interface (SCSI) has an intelligent bus subsystem and can support multiple devices cooperating concurrently. Each device is assigned a priority. The main types of SCSI are (1) SCSI-I. SCSI-I transfers at rate of 5MB/s with an 8-bit data bus and seven devices per controller. (2) SCSI-II. SCSI-II supports for SCSI-I and with one or more of the following: (a) Fast SCSI, which uses a synchronous transfer to give 10 MB/s transfer rate. The initiator and target initially negotiate to see if they can both support synchronous transfer. If they can, they then go into a synchronous transfer mode. (b) Fast and wide SCSI-2, which doubles the data bus width to 16 bits to give 20 MB/s transfer rate. (c) Fifteen devices per master device. (d) Tagged command queuing (TCQ), which greatly improves performance and is supported by Windows, NetWare, and OS-2. Zhang_Ch03.indd 335 5/13/2008 5:41:30 PM 336 INDUSTRIAL CONTROL TECHNOLOGY (e) Multiple commands sent to each device. (f) Commands executed in whatever sequence will maximize device performance. (3) Ultra SCSI (SCSI-III). Ultra SCSI operates either as 8-bit or 16-bit with either 20 or 40 MB/s transfer rate (Table 3.5). SCSI standard uses a 50-pin header connector and a ribbon cable to connect to up to eight devices. It overcomes the problem existing in IDE, where devices have to be assigned as a master and a slave. SCSI and fast SCSI transfer one byte at a time with a parity check on each byte. SCSI-II, wide SCSI, and ultra SCSI use a 16-bit data transfer and a 68-pin connector. An SCSI bus is made of an SCSI host adapter connected to a number of SCSI units via SCSI bus. As all units connect to a common bus, only two units can transfer data at a time, either from one SCSI unit to another or from one SCSI unit to the SCSI host. The great advantage of this transfer is that it does not involve the processor. Each unit on an SCSI unit is assigned a SCSI ID address. In the case of SCSI-I, this ranges from 0 to 7 (where 7 is normally reserved for a tape drive). The host adapter takes one of the addresses; thus a maximum of seven units can connect to the bus. Most systems allow the units to take on any SCSI ID address, but older systems required boot drives to be connected to a specific SCSI address. When the system is initially booted, the host adapter sends out a Start Unit command to each SCSI unit. This allows each of the units to start in an orderly manner (and not overload the local power supply). The host will start with the highest priority address (ID = 7) and finishes with the lowest address (ID = 0). Typically, the ID is set with a rotating switch selector or by three jumpers. Table 3.5 SCSI Types Indices Types Data Bus (bits) Transfer Rate (MB/s) Tagged Command Queuing Parity Checking Maximum Devices Pins on Cable and Connector SCSI-I SCSI-II fast SCSI-III fast/wide Ultra SCSI 8 8 5 10 (10 MHz) 20 (10 MHz) 40 (20 MHz) No Yes Option Yes 7 7 50 50 Yes Yes 15 68 Yes Yes 15 68 Zhang_Ch03.indd 336 16 16 5/13/2008 5:41:30 PM 337 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL SCSI defines an initiator control and a target control. The initiator requests a function from a target, which then executes the function, as illustrated in Fig. 3.25, where the initiator effectively takes over the bus for the time to send a command and the target executes the command and then contacts the initiator and transfers any data. The bus will then be free for other transfers. Table 3.6 gives the definitions of main SCSI signals. Each of the control signals can be true or false. They can be either OR-tied driven or Non-OR-tied driven. In OR-tied driven, the driver does not drive the signal to the false state. In this case, the bias circuitry of the bus terminators pulls the signal false whenever it is released by the drivers at every SCSI device. If any driver is asserted, then the signal is true. The BSY, SEL, and RST signals are OR-tied. In the ordinary operation of the bus, the BSY and RST signals may be simultaneously driven true by several drivers. However, in Non-OR-tied driven, the signal may be actively driven false. Initiator SCSI bus Function request Target Function execution Figure 3.25 Initiator and target in SCSI. Table 3.6 SCSI Main Signals Signals Definitions BSY ACK Indicates that the bus is busy, or not (an OR-tied signal). Activated by the initiator to indicate an acknowledgment for an REQ information transfer handshake. When active (low) resets all the SCSI devices (an OR-tied signal). Activated by the initiator to indicate the attention state. Activated by the target to indicate the message phase. Activated by the initiator; it is used to select a particular target device (an OR-tied signal). Activated by the target to identify whether there is data or control on the SCSI bus. Activated by the target to acknowledge a request for an ACK information transfer handshake. Activated by the target to show the direction of the data on the data bus. Input defines that data is an input to the initiator, else it is an output. RST ATN MSG SEL C/D (control/data) REQ I/O (input/output) Zhang_Ch03.indd 337 5/13/2008 5:41:30 PM 338 INDUSTRIAL CONTROL TECHNOLOGY No signals other than BSY, RST, and D(PARITY) are driven simultaneously by two or more drivers. The SCSI bus allows any unit to talk to any other unit, or the host to talk to any unit. Thus there must be some way of arbitration where units capture the bus. The main phases that the bus goes through are as follows: (1) Free bus. In this state, there are no units that either transfer data or have control of the bus. It is identified by deactivate SEL and BSY (both will be high). Thus, any unit can capture the bus. (2) Arbitration. In this state, a unit can take control of the bus and become an initiator. To do this, it activates the BSY signal and puts its own ID address on the data bus. After a delay, it tests the data bus to determine whether a high-priority unit has put its own address on the bus. If it has, then it will allow the other unit access to the bus. If its address is still on the bus, then it asserts the SEL line. After a delay, it then has control of the bus. (3) Selection. In this state, the initiator selects a target unit and gets the target to carry out a given function, such as reading or writing data. The initiator outputs the OR value of its SCSI-ID and the SCSI-ID of the target onto the data bus (e.g., if the initiator is 2 and the target is 5 then the OR-ed ID on the bus will be 00100100). The target then determines that its ID is on the data bus and sets the BSY line active. If this does not happen within a given time, then the initiator deactivates the SEL signal, and the bus will be free. The target determines that it is selected when the SEL signal and its SCSI ID bit are active and the BSY and I/O signals are false. It then asserts the BSY signal within a selection abort time. (4) Reselection. When the arbitration phase is complete, the wining SCSI device asserts the BSY and SEL signals and has delayed at least a bus clear delay plus a bus settle delay. The wining SCSI device sets the DATA BUS to a value that is the logical OR of its SCSI ID bit and the initiator’s CSI ID bit. Sometimes, the target takes some time to reply to the initiator’s request. The initiator determines that it is reselected when the SEL and I/O signals and its SCSI ID bit are true and the BSY signal is false. The reselected initiator then asserts the BSY signal within a selection abort time of its most recent detection of being reselected. An initiator does not respond to a reselection phase if other than two SCSI ID bits are on the data bus. After the target detects that the BSY signal is true, it also asserts the BSY signal and waits a given time delay and then releases the SEL signal. The target may then change the I/O signal and the data bus. After the reselected initiator detects the SEL signal is false, it releases the BSY signal. The target continues to assert the BSY signal until it gives up the SCSI bus. Zhang_Ch03.indd 338 5/13/2008 5:41:31 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 339 (5) Command. The command phase is used by the target to request command information from the initiator. The target asserts the C/D signal and negates the I/O and MSG signals during the REQ/ ACK handshake(s) of this phase. The format of the command descriptor block for 6-byte commands is: Byte 0—operation code; Byte 1—logical unit number (MSB, if required); Byte 2—logic block address; Byte 3—logic block address (LSB, if required); Byte 4—transfer length (if required)/parameter list length (if required)/allocation length (if required); Byte 5—control. (6) Data. The data phase covers both the data-in and data-out phases. In the data-in phase, the target requests that data be sent to the initiator from the target. For this purpose, the target asserts the I/O signal and negates the C/D and MSG signals during the REQ/ ACK handshake(s) of the phase. In the data-out phase, the target requests that data be sent from the initiator to the target. The target negates the C/D, I/O, and MSG signals during the REQ/ ACK handshake(s) of this phase. (7) Message. The message phase covers both the message-out and message-in phases. The first byte transferred in either of these phases can be either a single-byte message or the first byte of a multiple-byte message. Multiple-byte messages are contained completely within a single message phase. The message system allows the initiator and the target to communicate over the interface connection. Each message can be one, two, or more bytes in length. In a single message phase, one or more messages can be transmitted (but a message cannot be split between multiple message phases). (8) Status. The status phase allows the target to request that status information be sent from the target to the initiator. The target shall assert the C/D and I/O signals and negate the MSG signal during the REQ/ACK handshake(s) of this phase. The status phase normally occurs at the end of a command (although in some cases it may occur before transferring the command descriptor block). 3.2.2.4 USB and Firewire (1) Universal serial bus (USB). USB is mainly used for the connection of medium bandwidth peripherals such as keyboards, scanner, modem, video, game or graphic controller, music interface, etc. The great advantage of USB is that it allows for peripherals to be added and deleted from the system without causing any system upsets. The system will also automatically sense the connected device and load the required driver. Basically, USB provides these features: (1) easy to use; (2) self-identifying Zhang_Ch03.indd 339 5/13/2008 5:41:31 PM 340 INDUSTRIAL CONTROL TECHNOLOGY peripherals with automatic mapping of function to driver and configuration; (3) dynamically attachable and reconfigurable peripherals; (4) low-speed and medium-speed transfer rate of 1.5 Mbps or 12 Mbps. USB is a balanced bus architecture that hides the complexity of the operation from the devices connected to the bus. The USB host controller controls system bandwidth. Each device is assigned a default address when the USB device is first powered or reset. Hubs and functions are assigned a unique device address by USB software. All USB devices are attached to the USB via a port on specialized USB devices known as hubs. Hubs indicate the attachment or removal of a USB device in its per port status. Figure 3.26 shows an example connection of the USB 2.0 system. In this example, a memory hub is used to provide a fast data transfer (GB/s), while the Firewire connection provides ultrahigh-speed connection for video transfers. The USB connection provides low-high and full-speed connections to most of the peripherals that connect to the system. The USB connections can be internal or can connect to an external hub. In the implementation of USB, there are two main ways, as given below. (a) Open host controller interface (OHCI). This method defines the register level interface that enables the USB controller to communicate with the host computer and the operating system. OHCI is an industrial standard hardware interface for operating systems, device drivers, and the BIOS to manage the USB. It optimizes performance of the USB bus while minimizing CPU overhead to control the USB with a scatter/gather Processor AGP graphic controller RDRAM AGP 2.0 DRAM bus Host bus Memory controller hub (MCH) Hub interface Floppy disk USB 2.0 hub Hard disk Video device Firewire USB Port 1 USB 2.0 controller hub USB Port 2 Audio/modem USB 2.0 hub Scanner Adaptor Figure 3.26 An example connection of the USB 2.0 system. Zhang_Ch03.indd 340 5/13/2008 5:41:31 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 341 bushmaster hardware support. It has efficient isochronous data transfers allowing for high USB bandwidth without slowing down the host CPU. Furthermore, it ensures full compatibility with all USB devices. (b) Universal host controller interface (UHCI). This method defines how the USB controller talks to the host computer and its operating system. It is optimized to minimize host computer design complexity and uses the host CPU to control the USB bus. This method has the advantages of simple design which reduces the transistor count required to implement the USB interface on the host computer, thus reducing the system cost. Furthermore, it can provide full compatibility with all USB devices. In data transmission, USB supports two types of transfers: stream and message. A stream has no defined structure, whereas a message does. At start-up, one message pipe, control pipe 0, always exits as it provides access to the device’s configuration, status, and control information. USB optimizes large data transfers and real-time data transfers. When a pipe is established for an endpoint, most of the pipe’s transfer characteristics are determined and remain fixed for the lifetime of the pipe. Each bus transaction of USB involves the transmission of up to three packets which can be (1) token packet transmission, (2) data packet transmission, and (3) handshake packet transmission. With these transfer characteristics, USB defines four transfer types: (i) Control transfers. This is bursty, nonperiodic, hostsoftware-initiated request/response communication typically used for command/status operations. (ii) Isochronous transfers. This is periodic, continuous communication between host and device typically used for time-relevant information. This transfer type also preserves the concept of time encapsulated in the data. This does not imply, however, that the delivery needs of such data are always time-critical. (iii) Interrupt transfers. This is small data, nonperiodic, low frequency, bounded latency, device-initiated communication typically used to notify the host of device service needs. (iv) Bulk transfers. Nonperiodic, large bursty communication typically used for data that can use any available bandwidth and also is delayed until bandwidth is available. As mentioned earlier, a major advantage of USB is the hot attachment and detachment of devices. USB does Zhang_Ch03.indd 341 5/13/2008 5:41:31 PM 342 INDUSTRIAL CONTROL TECHNOLOGY this by sensing when a device is attached or detached. When this happens, the host system is notified, and system software interrogates the device. It then determines its capabilities, and automatically configures the devices. All the required drivers are then loaded and applications can immediately make use of the connected device. (1) Attachment of USB devices. All USB devices are addressed using the USB default address when initially connected or after they have been reset. The host determines whether the newly attached USB device is a hub or a function and assigns a unique USB address to the USB device. The host establishes a control pipe for the USB device using assigned USB address and endpoint number zero. If the attached USB device is a hub and USB devices are attached to its ports, then the above procedure is followed for each of the attached USB devices. If the attached USB device is a function, then attachment notifications will be dispatched by USB software to interested host software. (2) Removal of USB devices. When a USB device has been removed from one of its ports, the hub automatically disables the port and provides an indication of device removal to the host. Then the host removes knowledge of the USB device. If the removed USB device is a hub, then the removal process must be performed for all of the USB devices that were previously attached to the hub. If the removed USB device is a function, removal notifications are sent to interested host software. (2) Firewire. The main competitor to USB is the Firewire standard (IEEE 1394–1995 buses), which is a high-speed serial bus typically for video transfers, whereas USB supports low-tomedium-speed peripherals. Firewire supports rates of approximately 100, 200, and 400 Mbps, known as S100, S200, and S400, respectively. The future standard promises higher data rates, and ultimately it is envisaged that rates of 3.2 Gbps will be achieved when optical fiber is introduced into the system. It uses pointto-point interconnect with a tree topology: 1000 buses with 64 nodes gives 64,000 nodes. Firewire also can be automatic configuration and hot plugging. In additional to asynchronous transfer, Firewire is able to be isochronous data transfer, where a fixed bandwidth is dedicated to a particular peripheral. However, it has the limit of the maximum cable length as 4.5 m. This should Zhang_Ch03.indd 342 5/13/2008 5:41:31 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 343 subsequently reduce the costs of production of controller interfaces and peripheral connectors, as well as simplifying the requirements placed on users when setting up their devices. Firewire is a more economical interface bus standard that performs fast and high-bandwidth data transmissions. There are two bus categories in the Firewire: (a) Cable. This is a bus that connects external devices via a cable. This cable environment is a noncyclic network with finite branches consisting of bus bridges and nodes (cable devices). Noncyclic networks contain no loops and result in a tree topology, with devices daisy-chained and branched (where more than one device branch is connected to a device). Devices on the bus are identified by node IDs. Configuration of the node IDs is performed by the self ID and tree ID processes after every bus reset. This happens every time a device is added to or removed from the bus, and is invisible to the user. (b) Backplane. This type of topology is an internal bus. An internal IEEE-1394 device can be used alone, or incorporated into another backplane bus. Implementation of the backplane specification lags the development of the cable environment, but one could image internal IEEE-1394 hard disks in one computer being directly accessed by another IEEE-1394 connected computer. One of the key capabilities of IEEE-1394 is isochronous data transfer. Both asynchronous and isochronous are supported, and are useful for different applications. Isochronous transmission transmits data like real-time speech and video, both of which must be delivered uninterrupted, and at the rate expected, whereas asynchronous transmission is used to transfer data that is not tied to a specific transfer time. With IEEE-1394, asynchronous transmission is the conventional transfer method of sending data to an explicit address, and receiving confirmation when it is received. Isochronous, however, is an unacknowledged guaranteed bandwidth transmission method, useful for just-in-time delivery of multimedia type data. An isochronous “talker” requests an amount of bandwidth and a channel number. Once the bandwidth has been allocated, it can transmit data preceded by a channel ID. The isochronous listeners can then listen for the specified channel ID and accept the data following. If the data is not intended for a node, it will not be set to listen on the specific channel ID. Up to 64 isochronous channels are available, Zhang_Ch03.indd 343 5/13/2008 5:41:31 PM 344 INDUSTRIAL CONTROL TECHNOLOGY and these must be allocated, along with their respective bandwidths, by an isochronous resource manager on the bus. By comparison, asynchronous transfers are sent to explicit addresses on the 1394 bus. When data is to be sent, it is preceded by a destination address, which each node checks to identify packets for itself. If a node finds a packet addressed to itself, it copies it into its receive buffer. Each node is identified by a 16-bit ID, containing the 10-bit bus ID and 6-bit node or physical ID. The actual packet addressing, however, is 64 bits wide, providing a further 48 bits for addressing a specific offset within a node’s memory. 3.2.2.5 AGP and Parallel Ports (1) AGP. The accelerated graphic port (AGP) is a major advancement in the connection of three-dimensional graphics applications, and is based on an enhancement of the PCI bus. One of the major improvements is the speed of transfer between the main system memory and the local graphic card. This reduces the need for large areas of memory on the graphics card. The main gain in moving graphics memory from the display buffer (on the graphic card) to the main memory is the display of text information because (1) it is generally read-only, and does not have to be displayed in any special order. (2) Shifting text does not require a great deal of data transfer and can be easily cached in memory, thus reducing data transfer. A shift in text can be loaded from the cached memory. (3) It is dependent on the graphics quality of the application, rather than the resolution of the display. (4) It is not persistent, as it resides in memory only for the duration that it is required. When it has completed the main memory, it can be assigned to another application. A display buffer, on the other hand, is permanent. The 440LX was the first AGP set product designed to support the AGP interface. The HOST BRIDGE AGP implementation is compatible with the accelerated graphics port specification 1.0. HOST BRIDGE supports only a synchronous AGP interface, coupling with the host bus frequency. The AGP 1.0 interface can reach a theoretical 528 MB/s transfer rate and AGP 2.0 can achieve a theoretical 1.056 GB/s transfer rate. The actual bandwidth will be limited by the capability of the HOST BRIDGE memory subsystem. (2) Parallel port. The parallel port is hardly the greatest technology. In its standard form, it allows only for simple communications Zhang_Ch03.indd 344 5/13/2008 5:41:31 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 345 from the PC outwards. However, like the RS-232, the parallel port is a standard port of the PC, and it is cheaper. All parallel ports use a bidirectional link in either a compatible, nibble, or byte mode. These modes are relatively slow as the software must monitor the handshaking lines (up to 100 kbps). To allow high speeds, the enhanced parallel port and extended capabilities port protocol modes allow high-speed data transfer using automatic hardware handshaking. 3.2.2.6 RS-232, RS-422, RS-485, and RS-530 (1) RS-232. RS-232 (Recommended Standard-232) is a TIA/EIA standard for serial transmission between DTE and DCE. Using a 25-pin DB-25 or 9-pin DB-9 connector, its normal cable limitation of 50 ft can be extended to several hundred feet with highquality cable. RS-232 defines the purpose and signal timing for each of the 25 lines; however, many applications use less than a dozen. RS-232 transmits positive voltage for a 0 bit, negative voltage for a 1. In 1984, this interface was officially renamed TIA/EIA232-E standard (E is the current revision, 1991), although most people still call it RS-232. Table 3.7 lists the some RE-232 specifications. (2) RS-422 and RS-485. RS-422 (Recommended Standard-422) is a balanced serial interface for the transmission of digital data. The advantage of a balanced signal is the greater immunity to noise. The EIA describes RS-422 as a DTE to DCE interface for pointto-point connections. RS-422 was designed for greater distances and higher baud rates than RS-232. In its simplest form, a pair of converters from RS-232 to RS-422 (and back again) can be used to form an “RS-232 extension cord.” Data rates of up to 100 kbps and distances up to 4000 ft can be accommodated with RS-422. RS-422 is also specified for multidrop (party-line) applications where only one driver is connected to, and transmits on, a “bus” of up to 10 receivers. RS-485 (Recommended Standard-485) is standard for sending serial data. It uses a pair of wires to send a differential signal over distances up to 4000 ft without a repeater. The differential signal makes it very robust; RS-485 is one of the most popular communications methods used in industrial applications where its noise immunity and long-distance capability are a perfect fit. RS-485 is capable of multidrop communications—up to 32 nodes. Zhang_Ch03.indd 345 5/13/2008 5:41:32 PM 346 INDUSTRIAL CONTROL TECHNOLOGY Table 3.7 RS-232 and RS-422 Specifications Specifications Mode of operation Total number of drivers and receivers on one line Maximum cable length (ft) Maximum data rate Maximum driver output voltage (V) Driver output signal level Loaded (loaded minimum) (V) Driver output signal level Unloaded (unloaded maximum) (V) Driver load impedance (Ω) Maximum driver current in Power on high Z state Maximum driver current in Power off high Z state Slew rate (maximum) Receiver input voltage range (V) Receiver input sensitivity Receiver input resistance (Ohms) RS-232 RS-422 Single-ended 1 Driver 1 Receiver 50 20 kbits/s +/−25 +/−2.0 Differential 1 Driver 10 Receiver 4000 10 Mbits/s −0.25 to +6 +/−5 to +/−15 +/–6 +/−25 3–7 k N/A 100 N/A +/−100 µA +/−6 mA @ +/−2 V N/A −10 to +10 +/−200 mV 4k min 30 V/µs +/−15 +/−3 V 3–7 k RS-485 can be configured for their half or full duplex. Half duplex typically uses one pair of wires; full duplex requires two pairs. Both RS-422 and RS-485 use a twisted-pair wire (i.e., 2 wires) for each signal. They both use the same differential drive with identical voltage swings: 0 to +5 V. The main difference between RS-422 and RS-485 is that while RS-422 is strictly for point-topoint communications (and the driver is always enabled), RS-485 can be used for multiple drop systems. Since the basic differential receivers of RS-423-A and RS-422-A are electrically identical, it is possible to interconnect equipment using RS-423-A receivers and generators on one side of the interface with equipment using RS-422-A generators and receivers on the other side of the interface, if the leads of the receivers and generators are properly configured to accommodate such an arrangement and the cable is not terminated. Table 3.7 lists some specifications for RS-422. The data is coded as a differential voltage between the wires. The wires are named A (negative) and B (positive). When B > A then the output Zhang_Ch03.indd 346 5/13/2008 5:41:32 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 347 is a mark (1 or off) and when A > B then it is counted as a space (0 or on). In general, a mark is +1 VDC for the A line and +4 VDC for the B line. A space is +1 VDC for the B line and +4 VDC for the A line. At the transmitter end the voltage difference should not be less than 1.5 VDC and not exceed 5 VDC. At the receiver end the voltage difference should not be less than 0.2 VDC. The minimum voltage level is –7 VDC and maximum +12 VDC. (3) RS-530. RS-530 (Recommended Standard-530) employs differential signaling on its send, receive, and clocking signals, as well as its control and handshaking signals. The differential signals for RS-530 are labeled as either “A or B.” At both connectors, wire A always connects to A, and B connects to B. The RS-530 transmitter sends a data 0 (or logic ON) by setting the potential on the A signal to 0.3 V (or more) higher than the voltage on the B signal. The transmitter sends a data 1 (or logic OFF) by setting the potential on the B signal to 0.3 V or more than the voltage on the A signal. The voltage offset (from ground reference) is not to exceed 3 V, however, most receivers can handle much more; check the receiver data sheet for exact limits. This approach is relatively immune to noise when the cable is constructed so that the A and B signal wires are a twisted pair. Shielding the cable is generally not required. Data 0 = A > B + 0.3 V; Data 1 = B > A + 0.3 V Example: Data 0: A = 2 V, B = 1 V; Data 1: A = 1 V, B = 2 V. Most receivers can handle both + and – voltages; again check the data sheet on the part used to be sure. If you have the correct receivers it is possible for the older V.35 (+/–5 V) signaling to be wired to RS-530 or V.11. This is how Cisco and others get many different interfaces on their Smart Serial connectors, and you thought it was magic! 3.2.2.7 IEEE-488 Hewlett-Packard originally developed the IEEE-488 bus called the HP-IB to connect and control programmable instruments, and to provide a standard interface for communication between instruments from different sources. The interface quickly gained popularity in the computer industry. Because the interface was so versatile, the IEEE committee renamed it General Purpose Interface Bus (GPIB). Almost any instrument can be used with the IEEE-488 specification, because it says nothing about the function of the instrument itself, or about the form of the instrument’s data. Instead, the specification defines a separate component, the interface, which can be added to the instrument. Zhang_Ch03.indd 347 5/13/2008 5:41:32 PM 348 INDUSTRIAL CONTROL TECHNOLOGY The signals passing into the interface from the IEEE-488 bus and from the instrument are defined in the standard. The instrument does not have complete control over the interface. Often the bus controller tells the interface what to do. The active controller performs the bus control functions for all the bus instruments. (1) IEEE-488 standards. The IEEE-488.1 standard greatly simplified the interconnection of programmable instruments by clearly defining mechanical, hardware, and electrical protocol specifications. For the first time, instruments from different manufacturers were connected by a standard cable. This standard does not address data formats, status reporting, message exchange protocol, common configuration commands, or device specific commands. The IEEE-488.2 standard enhances and strengthens the IEEE488.1 standard by specifying data formats, status reporting, error handling, controller functionality, and common instrument commands. It focuses mainly on the software protocol issues and thus maintains compatibility with the hardware-oriented IEEE488.1 standard. IEEE-488.2 systems tend to be more compatible and reliable. The IEEE-488 standard allows up to 15 devices to be interconnected on one bus. Each device is assigned a unique primary address, ranging from 0 to 30, by setting the address switches on the device. A secondary address may also be specified, ranging from 0 to 30. See the device documentation for more information on how to set the device primary and optional secondary address. The IEEE-488 bus specifies a maximum total cable length of 20 m with no more than 20 devices connected to the bus and at least two-thirds of the devices powered on. A maximum separation of 4 m between devices and an average separation of 2 m over the full bus should be followed. Bus extenders and expanders are available to overcome these system limits. The standard IEEE-488 cable has both a plug and receptacle connector on both ends. Special adapters and nonstandard cables are available for special interconnect applications. (2) Interface signals and data lines. At power-up time, the IEEE488 interface that is programmed to be the System Controller becomes the Active Controller in charge. The System Controller has several unique capabilities including the ability to send Interface Clear (IFC) and Remote Enable (REN) commands. IFC clears all device interfaces and returns control to the System Controller. REN allows devices to respond to bus data once they are addressed to listen. The System Controller may optionally Zhang_Ch03.indd 348 5/13/2008 5:41:32 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 349 pass control to another controller, which then becomes Active Controller. There are three types of devices that can be connected to the IEEE-488 bus (listeners, talkers, and controllers). Some devices include more than one of these functions. The standard allows a maximum of 15 devices to be connected on the same bus. A minimum system consists of one controller and one talker or listener device (i.e., an HP 700 with an IEEE-488 interface and a voltmeter). It is possible to have several controllers on the bus but only one may be active at any given time. The Active Controller may pass control to another controller which in turn can pass it back or on to another controller. A listener is a device that can receive data from the bus when instructed by the controller and a talker transmits data on to the bus when instructed. The controller can set up a talker and a group of listeners so that it is possible to send data between groups of devices as well. The IEEE-488 interface system consists of 16 signal lines and 8 ground lines. The 16 signal lines are divided into 3 groups (8 data lines, 3 handshake lines, and 5 interface management lines). The lines DIO1 through DIO8 are used to transfer addresses, control information, and data. The formats for addresses and control bytes are defined by the IEEE 488 standard. Data formats are undefined and may be ASCII (with or without parity) or binary. DIO1 is the Least Significant Bit (note that this will correspond to bit 0 on most computers). (3) Handshake lines and handshaking. The three handshake lines (NRFD, NDAC, DAV) control the transfer of message bytes among the devices and form the method for acknowledging the transfer of data. This handshaking process guarantees that the bytes on the data lines are sent and received without any transmission errors and is one of the unique features of the IEEE488 bus. (a) The NRFD (Not Ready for Data) handshake line is identified by a listener to indicate it is not yet ready for the next data or control byte. Note that the controller will not see NRFD released (i.e., ready for data) until all devices have released it. (b) The NDAC (Not Data Accepted) handshake line is identified by a listener to indicate it has not yet accepted the data or control byte on the data lines. Note that the controller will not see NDAC released (i.e., data accepted) until all devices have released it. (c) The DAV (Data Valid) handshake line is identified by the talker to indicate that a data or control byte has been placed on Zhang_Ch03.indd 349 5/13/2008 5:41:32 PM 350 INDUSTRIAL CONTROL TECHNOLOGY the data lines and has had the minimum specified stabilizing time. The byte can now be safely accepted by the devices. The handshaking process is outlined as follows. When the controller or a talker wishes to transmit data on the bus, it sets the DAV line high (data not valid), and checks to see that the NRFD and NDAC lines are both low, and then it puts the data on the data lines. When all the devices that can receive the data are ready, each releases its NRFD (not ready for data) line. When the last receiver releases NRFD, and it goes high, the controller or talker takes DAV low indicating that valid data is now on the bus. In response each receiver takes NRFD low again to indicate it is busy and releases NDAC (not data accepted) when it has received the data. When the last receiver has accepted the data, NDAC will go high and the controller or talker can set DAV high again to transmit the next byte of data. Note that if after setting the DAV line high, the controller or talker senses that both NRFD and NDAC are high, an error will occur. Also if any device fails to perform its part of the handshake and releases either NDAC or NRFD, data cannot be transmitted over the bus. Eventually a timeout error will be generated. The speed of the data transfer is controlled by the response of the slowest device on the bus; for this reason it is difficult to estimate data transfer rates on the IEEE-488 bus as they are always device dependent. (4) Interface management lines. The five interface management lines (ATN, EOI, IFC, REN, and SRQ) manage the flow of control and data bytes across the interface. (a) The ATN (Attention) signal is chosen by the controller to indicate that it is placing an address or control byte on the data bus. ATN is released to allow the assigned talker to place status or data on the data bus. The controller regains control by reasserting ATN; this is normally done synchronously with the handshake to avoid confusion between control and data bytes. (b) The EOI (End or Identify) signal has two uses. A talker may assert EOI simultaneously with the last byte of data to indicate end-of-data. The controller may assert EOI along with ATN to initiate a parallel poll. Although many devices do not use parallel poll, all devices should use EOI to end transfers (many currently available ones do not). (c) The IFC (Interface Clear) signal is selected only by the System Controller in order to initialize all device interfaces to a known state. After releasing IFC, the System Controller is the Active Controller. Zhang_Ch03.indd 350 5/13/2008 5:41:32 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 351 (d) The REN (Remote Enable) signal is selection only by the System Controller. Its selection does not place devices into remote control mode; REN only enables a device to go into remote mode when addressed to listen. When in remote mode, a device should ignore its local front panel controls. (e) The SRQ (Service Request) line is like an interrupt: it may be used by any device to request the controller to take some action. The controller must determine which device is calling for the SRQ by conducting a serial poll. The requesting device releases SRQ when it is polled. 3.3 Human–Machine Interface in Industrial Control 3.3.1 Overview The term “user interface” refers to the methods and devices that are used to accommodate interaction between machines and the human beings who use them. The user interface of a mechanical system, a vehicle, or an industrial installation and so on is often referred to as the human–machine interface. In any industrial control system, the human–machine interface can be used to deliver information from machine to people, which allows people to control, monitor, and record the system through devices such as image, keyboard, Ethernet, screen, video, radio, software, etc. Actually, the human–machine interface can take many forms. Although there are many techniques and methods used in industry, the human–machine interface always accomplishes two fundamental tasks: communicating information from the machine to the user, and communicating information from the user to the machine. Two industrial applications of the human–machine interface are given below to demonstrate its importance in industry and industrial control. However, in view of the fact that the human–machine interface becomes more and more essential in industry, these two examples are far from representing its applications in industry. A robot control is a good example that requires working with the human– machine interface. This robot control is based on human speech and gestures instead of keyboard or joystick control. In turn, the robot can also respond to the human control orders by using speech and gestures. When both the operator and the robot understand the environment and the work objects, they can communicate easier and the work task can be completed collaboratively. In most robots, the human–machine interface is a key Zhang_Ch03.indd 351 5/13/2008 5:41:32 PM 352 INDUSTRIAL CONTROL TECHNOLOGY component in any work cell. The human–machine interface must allow operators to run the equipment and cell in an intuitive manner. It must be configurable to give each level of personnel appropriate access to various layers of functionality. An autonomous service robot operates in the user’s own environment, performing independent tasks to reach user goals. Applications include, for instance, delivery agents in hospitals and factories, and cleaning robots in the home or in supermarkets. The latest robot controllers now are beginning to offer built-in human–machine interface functionality, complete with touch-screen interfaces, status indicators, program selection switches, part counters, and various other functions, which can be seen in Fig. 3.27. Another example in this aspect is the SCADA system in which the human–machine interface is an essential component. In industry, the human–machine interface in SCADA was born out of a need for a userfriendly front-end to a control system containing PLC. While a PLC does provide automated, preprogrammed control over a process, they are usually distributed across a plant, making it difficult to gather data from them manually. Additionally, the PLC information is usually in a crude userunfriendly format. The SCADA of human–machine interface gathers information from the PLCs via some form of network, and combines and formats the information. A sophisticated human–machine interface may also be linked to a database, to provide instant trending, diagnostic data, Figure 3.27 A touch-screen shot of the human–machine interface for a robot (courtesy of Siemens). Zhang_Ch03.indd 352 5/13/2008 5:41:32 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 353 scheduled maintenance procedures, logistic information, detailed schematics for a particular sensor or machine, and expert-system troubleshooting guides. Since about 1998, many companies, especially all major PLC manufacturers, have offered integrated SCADA and human–machine interface systems for its comprehensive range of facilities for industrial automation and process control. These companies recognized the benefits of using the same reliable monitoring and control software throughout their business, from shop floor through to top management. Many of them used open and nonproprietary communications protocols. Numerous specialized third-party SCADA packages with the human–machine interface, offering built-in compatibility with most major PLCs, have also entered the market, allowing mechanical engineers, electrical engineers, and technicians to configure the human–machine interface by themselves, without the need for a custom-made program written by a software developer. Figure 3.28 is a diagram including an SCADA system and its control screen in Website. 3.3.2 Human–Machine Interactions Automated systems have penetrated virtually every area of our private life and our work environments. Development work on technical products is accelerating, and the products themselves are becoming increasingly complex and powerful. Human–machine interaction is already playing a vital role along the entire production process, from planning individual links in the production chain right through to designing the finished product. Innovative technology is made for humans, used and monitored by humans. The optimum form for this interaction depends on whether a technical innovation is reliable in operation, is safe, is accepted by personnel, and, last but not least, is cost-effective. This interplay between technology and user, known as human–machine interaction, is hence at the very heart of industrial automation, automated control, and industrial production. 3.3.2.1 The Models for Human–Machine Interactions Modeling the human–machine interaction is done simply to depict how human and machine interact in a system. The human–machine interaction model illustrates a typical information flow (or process context) between the “human” and “machine” components of a system. Figure 3.29 provides the components involved in each side of the human–machine interaction. The environment side has three components: Machine display component, Zhang_Ch03.indd 353 5/13/2008 5:41:33 PM 354 INDUSTRIAL CONTROL TECHNOLOGY Figure 3.28 A SCADA system and its Website-control screen (Courtesy of Siemens). Human musculoskeletal component Human cognitive component Human sensory component Machine I/O device component Machine CPU component Machine display component Environment Interaction Human Figure 3.29 The components involved in the human–machine interaction. Zhang_Ch03.indd 354 5/13/2008 5:41:33 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 355 Machine CPU component, and Machine I/O device component. The human side has another three components: Human sensory component, Human cognitive component, and Human musculoskeletal component. In modern control systems, a model is a common architecture for grouping several machine configurations under one label. The set of models in a control system corresponds to a set of unique machine behaviors. The operator interacts with the machine by switching among models manually, or monitoring the automatic switching triggered by the machine. However, our understanding of models and their potential contribution to confusion and error is still far from complete. For example, there is widespread disagreement among user interface designers and researchers about what models are, independent of how they affect users. This blurred vision, found not only in the human–machine interaction domain, impedes our ability to develop methods for representing and evaluating human interaction with control systems. This limitation is magnified in high-risk systems such as automated cockpits, for which there is an urgent need to develop methods that will allow designers to identify, early in the design phase, the potential for error. The errors arising from modeling the human–machine interaction are thus an important issue that cannot be ignored. (1) Definition and construct. The constructs of the human–machine interaction model that will be discussed below are measurable aspects of human interaction with machines. As such, they can be used to form the foundation of a systematic and quantitative analysis. (a) Models’ behaviors. One of the first treatments of models came in the early 1960s from the science of cybernetics, the comparative study of human control systems and complex machines. The first treatments set forth the construct of a machine with different behaviors. The following is a simplified description of the machine behaviors’ construct: A given machine may have several components (e.g., X1, X2, X3). For each component there is a finite set of states. On “Startup,” for example, the machine initializes itself so that the active state of component X1 is “a,” X2 is “f,” and X3 is “k” (see Table 3.8). The vector of states (a, f, k) thus defines the machine’s configuration on “Startup.” Once a built-in test is performed, the machine can move from “Startup” to “Ready.” The transition to “Ready” can be defined so that for component X1, state “a” undergoes a transition and becomes state “b”; for X2 state “f” transitions to “g”, and for X3, “k” Zhang_Ch03.indd 355 5/13/2008 5:41:34 PM 356 INDUSTRIAL CONTROL TECHNOLOGY changes to “l”. The new configuration (b, g, l) defines the “Ready” model of the machine. Now, there might be a third set of transitions, for example, to “Engaged” (c, h, m), and so on. The set of configurations labeled “Startup,” “Ready” and “Engaged,” if embedded in the same physical unit, corresponds to a machine with three different ways of behaving. A real machine whose behavior can be so represented is defined as a machine with “input.” The input triggers the machine to change its behavior. One source of input to the machine is manual; the user selects the model, for example, by turning a switch, and the corresponding transitions take place. But there can be another type of input: If some other machine selects the model, the input is “automatic.” More precisely, the output of the other machine becomes the input to our machine. For example, a separate machine performs a built-in test and outputs a signal that causes the machine in Table 3.8 to transition from “Standby” to “Ready,” automatically. Here in this book, we first define a model as a machine configuration that corresponds to a unique behavior. This is a very broad definition of the term. Later on, we constrain this definition from our special perspective: user interaction with control systems that employ models. (b) Model’s error and ambiguity. Model errors fall into a class of errors that involve forming and carrying out an intention. That is, when a situation is falsely classified, the resulting action may be one that was intended and appropriate for a perceived or expected situation, but inappropriate for the actual situation. However, there remains an open question as to what kind of situations lead to model error. This issue can be addressed by an example of a word processor. Specifically, we looked at situations in which the user’s input has different interpretations, depending on model. For example, in one Table 3.8 A Machine with Different Behaviors Startup Ready Engaged Zhang_Ch03.indd 356 X1 X2 X3 a b c f g h k l m 5/13/2008 5:41:34 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 357 word processing application, the keystroke d can be interpreted as either (1) the literal text “d,” or (2) as the command “delete.” The interpretation depends on the word processor’s active model: either Text or Command. Model error can be linked to model ambiguity with interjecting the notion of user expectations. In this view, “model ambiguity” will result in model error only when the user has a false expectation about the result of his or her actions. There are two types of ambiguity: one that leads to model error, and one that does not lead to model error. An example of model ambiguity that does lead to model error is timesharing operating systems in which keystrokes are buffered until a “Return” or “Enter” key is pressed. However, when the buffer gets full, all subsequent keystrokes are ignored accordingly. This feature leads to two possible outcomes; all or only a portion of the keystrokes will be processed. The two outcomes depend on the state of buffer which is either “not full” or “full.” Since the state of the buffer is unknown to the user, false expectations may occur. The user’s action: hitting the “Return” key and seeing only part of what was keyed on the screen is therefore a “model error” because the buffer has already filled up. An example of model ambiguity that does not lead to model error is a common end-of-line algorithm which determines the number of words in a line. An ambiguity is introduced because the criteria for including the last word on the current line, or wrapping to the next line, are known to the user. Nevertheless, as long as the algorithm works reasonably well, the user will not complain because he or she has not formed any expectation about which word will stay on the line or scroll down, and either outcome is usually acceptable. Therefore, model error will not take place, even though model ambiguity does indeed exist. (c) User factors: Task, knowledge, and ability. One important element that constrains user expectations is the task at hand. If discerning between two or more different machine configurations is not part of the user’s task, model error will not occur. Consider, for example, the radiator fan of your car. Do you know what configuration (OFF, ON) it is in? The answer, of course, is no. There is no such indication in most modern cars. The fan mechanism changes its mode automatically depending on the output of the water temperature sensor. Model Zhang_Ch03.indd 357 5/13/2008 5:41:34 PM 358 INDUSTRIAL CONTROL TECHNOLOGY ambiguity exists because at any point in time, the fan mechanism can change its model or stay in the current model. The configuration of the fan is completely ambiguous to the driver. But does such model ambiguity lead to model error? The answer is obvious; not at all because monitoring the fan configuration is not part of the driver’s task. Therefore, the user’s task is an important determinant of which machine configurations must be tracked by the user and which machine configurations need not be tracked. The second element that is part of the assessment of user expectations is user knowledge about the machine’s behaviors. By this, we mean that the user constructs some mental model of the machine’s “response map.” This mental model allows the user to track the machine’s configuration, and most importantly, to anticipate the next configuration of the machine. Specifically, our user must be able to predict what the new configuration will be following a manually triggered event or an automatically triggered event. The problem of reliably anticipating the next configuration of the machine becomes difficult when the number of transitions between configurations is large. Another factor in user knowledge is the number of conditions that must be evaluated as TRUE, before a transition from one model to another takes place. For example, the automated flight control systems of modern aircraft can execute a fully automatic (hands-off) landing. Several conditions (two engaged autopilots, two navigation receivers tuned to the correct frequency, identical course set, and more) must be TRUE before the aircraft will execute automatic landing. Therefore, in order to reliably anticipate the next model configuration of the machine, the user must have a complete and accurate model of the machine’s behavior, including its configurations, transitions, and associated conditions. This model, however, does not have to be complete in the sense that it describes every configuration and transition of the machine. Instead, as discussed earlier, the details of the user’s model must be merely sufficient for the user’s task, which is a much weaker requirement. The third element in the assessment of user expectations is the user ability to sense the conditions that trigger a transition. Specifically, the user must be able to first sense the events (e.g., a flight director is engaged; aircraft is more than 400 ft above the ground) and then evaluate whether or not the transition to a model (say, a vertical navigation) will take place. These events are usually made known to the user Zhang_Ch03.indd 358 5/13/2008 5:41:34 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 359 through an interface. Nevertheless, there are more than a few control systems in which the interface does not depict the necessary input events. Such interfaces are said to be incorrect. In large and complex control systems, the user may have to integrate information from several displays in order to evaluate whether the transition will take place or not. For example, one of the conditions for a fully automated landing in a two-engine jetliner is that two separate electrical sources must be online, each one supplying its respective autopilot among the two autopilots. This information is external to the automatic flight control system, in the sense that it involves another aircraft system. The user’s job of integrating events, some of which are located in different displays, is not trivial. One important requirement for an efficient design is for the interface to integrate these events and provide the user with a succinct cue. In summary, we have discussed three elements that help to determine whether a given model ambiguity will or will not lead to false expectations. First is the relationship between model ambiguity and the user’s task. If distinguishing between models (e.g., radiator fan is “ON” or “OFF”) is not part of the user’s task, no meaningful errors will occur. Second, in a case where model ambiguity is relevant to the user’s task, we assess the user’s knowledge. If the user has an inaccurate and or incomplete model of the machine’s response map, he or she will not be able to anticipate the next configuration and model confusion will occur. Third, we evaluate the user’s ability to sense input events that trigger transitions. The interface must provide the user with all the necessary input events. If it does not, no accurate and complete model will help; the user may know what to look for but will never find it. As a result, confusion and model error will occur. (2) Classifications and types. A classification of the human–machine interaction models is proposed here to encompass three types of models in automated control systems: (1) “Interface models” that specify the behavior of the interface, (2) “Functional models” that specify the behavior of the various functions of a machine, and (3) “Supervisory models” that specify the level of user and machine involvement in supervising the process. Before we proceed to discuss this classification, we shall briefly describe a modeling language, “State Charts,” that will allow us to represent these models. In Chapter 5 of this book, Finite State Machine Model is given as a natural medium for describing the behavior of a model-based Zhang_Ch03.indd 359 5/13/2008 5:41:34 PM 360 INDUSTRIAL CONTROL TECHNOLOGY system. A basic fragment of such a description is a state transition which captures the states, conditions or events, and transitions in a system. The State Chart language is a visual formalism for describing states and transitions in a modular fashion by extending the traditional Finite State Machine to include three unique features: “hierarchy,” “concurrency,” and “broadcast.” The “hierarchy” is represented by substates encapsulated within a super state. The “concurrency” is shown by means of two or more independent processes working in parallel. The “broadcast” mechanism allows for coupling of components, in the sense that an event in one end of the network can trigger transitions in another. These features of the State Chart are further explained in the following three examples. (a) Interface models. Figure 3.30 is a modeling structure of an interface model. It has three concurrently active processes (separated by a broken line): speed knob behavior, speed knob indicator, and speed window display. The behavior of the speed knob (middle process) is either “normal” or “pushed-in.” (These two states are depicted, in the State Chart language, by two rounded rectangles.) The initial state of the speed knob is normal (indicated by the small arrow above the state), but when momentarily pushed, the speed knob engages or disengages the Speed Intervene submode of the vertical navigation (VNAV, hereafter) model. The transition between normal and pushed-in is depicted by a solid arrow and the label “push” describes the triggering event. The transition back to normal occurs immediately as the pilot lifts his or her finger (the knob is spring loaded). Speed knob (behavior) Speed knob (indicator) Normal Speed window (display) Closed d1 [disengaging VNAV .or. (in VNAV and b)] Blank Push/b d2 [engaging VNAV .or. (in VNAV and b)] Pushed-in Open Figure 3.30 An interface model. Zhang_Ch03.indd 360 5/13/2008 5:41:34 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 361 The left-most process shown in Fig. 3.30 is the speed knob indicator. In contrast to many such knobs that have indicators, the Boeing-757 speed knob itself has no indicator and therefore is depicted as a single (blank) state. The right-most process is the speed window display that can be either closed or open. After VNAV is engaged, the speed window display is closed (implying that the source of the speed is from another component, the flight management computer). After VNAV is disengaged, and a semiautomatic model such as vertical speed is active, the speed window display is open, and the pilot can observe the current speed value and enter a new speed value. This logic is depicted in the speed knob indicator process in Fig. 3.30: transition d1 from closed to open is conditioned by the event “disengaging VNAV,” and d2 will take place when the pilot is “engaging VNAV.” When in vertical navigation model, the pilot can engage the Speed Intervene submodel by pushing the speed knob. This event, “push” (which can be seen in speed knob behavior process), triggers event b, which is then broadcast to other processes. Being in VNAV and sensing event b (“in VNAV and b”) is another (.OR.) condition on transition d1 from closed to open. Likewise, it is also the condition on transition d2 that takes us back to closed. To this end, the behavior of the speed knob is circular; the pilot can push the knob to close and push it again to open, ad infinitum. As explained above and seen in Fig. 3.30, there are two sets of conditions on the transitions between close and open. Of all these conditions, one, namely “disengaging VNAV,” is not always directly within the pilot’s control; it sometimes takes place automatically (e.g., during a transition from VNAV to the altitude hold model). Manual reengagement of VNAV will cause the speed parameter in the speed window to be replaced by economy speed computed by the flight management computer. If the speed value in the speed window was a restriction required by the American Transport Council, the aircraft will now accelerate/decelerate to the computed speed and the American Transport Council speed restriction will be ignored! (b) Functional models. When we survey the use of models in devices, an additional type of model emerges: the “functional model” which refers to the active function of the machine that produces a distinct behavior. An automatic gearshift mechanism of a car is one example of a machine with different models, each one defining different behaviors. Zhang_Ch03.indd 361 5/13/2008 5:41:35 PM 362 INDUSTRIAL CONTROL TECHNOLOGY As we move to discussion of functional models and their uses in machines that control a timed process, we encounter the concept of “dynamics.” In dynamic control systems, the configuration and resulting behavior of the machine are a combination of a model and its associated parameter (e.g., speed, time, etc.). Referring back to our car example, the active model is the engaged gear that is Drive, and the associated parameter is the speed that corresponds to the angle of the accelerator pedal (say, 65 miles/h). Both model (Drive) and parameter (65 miles/h) define the configuration of the mechanism. Figure 3.31 depicts the structure of a functional model in the dynamic automated control system of a modern airliner. Two concurrent processes are depicted in this modeling structure: (1) models, and (2) parameter sources. Three models are depicted in the vertical models superstate in Fig. 3.31: vertical navigation, altitude hold, and vertical speed (the default model). All are functional models related to the vertical aspect of flight. The speed parameter can be obtained from two different sources: the flight management computer or the model control panel. The default source of the speed parameter, indicated by the small arrow Vertical autopilot (models) Speed (parameter) Vertical navigation m2 / rv1 Altitude hold m1 Flight management computer rv1 Model control panel Vertical speed Figure 3.31 A functional model. Zhang_Ch03.indd 362 5/13/2008 5:41:35 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 363 in Fig. 3.31, is the model control panel. As mentioned in the discussion on interface models, engagement of vertical navigation via the model control panel will cause a transition to the flight management computer as the source of speed. This can be seen in Fig. 3.31 where transition m2 will trigger event rv1, which, in turn, triggers an automatic transition (depicted as a broken line) from “model control panel” to “flight management computer.” In many dynamic control mechanisms, some model transitions trigger a parameter source change while others do not. Such independence appears to be a source of confusion to operators. (c) Supervisory models. The third type of model we discuss here is “supervisory models” that sometimes are also referred to as “participatory” or “control” models. Modern automated control mechanisms usually allow the user flexibility in specifying the level of human and machine involvement in controlling the process. That is, the operator may decide to engage a manual model in which he or she is controlling the process; a semiautomatic model in which the operator specifies target values, in real time, and the machine attempts to maintain them; or fully automatic models in which the operator specifies in advance a sequence of target values, that is parameters, and the machine executes these automatically, one after the other. Figure 3.32 is an example of a supervisory model structure that can be found in many control mechanisms, such as the automated flight control system, cruise control of a car, and robots on assembly lines. The modeling structure consists of hierarchical layers of superstates, each with its own set of models. The supervisory models in the Automated Flight Control System are organized hierarchically. Three main levels are described in Fig. 3.32. The highest level of automation is the vertical navigation model (level 3), depicted as a superstate at the top of the models pyramid. Two submodels are encapsulated in the vertical navigation model; VNAV Speed and VNAV Path; each one exhibiting a somewhat different control behavior. One level below (level 2) are two semiautomatic models: vertical speed and altitude hold. One model in the Automated Flight Control System, altitude capture, can only be engaged automatically; no direct manual engagement is possible. This model engages automatically when the aircraft is beginning the level-off maneuver to capture the selected altitude. When the aircraft is Zhang_Ch03.indd 363 5/13/2008 5:41:35 PM 364 INDUSTRIAL CONTROL TECHNOLOGY Automated flight control system models Semiautomatic models Vertical navigation VNAV speed VNAV path 3 Vertical speed Altitude hold 2 m3 1 m4 Altitude capture Figure 3.32 A supervisory model. several hundred feet from the selected altitude, an automatic transition from any climb model to altitude capture takes place (m3). In this aspect, an example can be that a transition from vertical navigation or vertical speed to altitude capture takes place (m3). Finally, when the aircraft reaches the selected altitude, a transition back from altitude capture to altitude hold model also takes place automatically (m4). In summary, we have illustrated a modeling language, Start Charts, for representing human interaction with control systems, and proposed a classification of three different types of models that are employed in computers, devices, and supervisory control systems. The “Interface models” change display format. The “Functional models” allow for different functions and associated parameters. Last are “Supervisory models” that specify the level of supervision (manual, semiautomatic, and fully automatic) in the human–machine system. The three types of models described here are essentially similar, in that they all define the manner in which a certain component of the machine behaves. The component may be the interface Zhang_Ch03.indd 364 5/13/2008 5:41:35 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 365 only, a function of the machine, or the level of supervision. This commonality brings us back to our general working definition of the term “model,” a machine configuration that corresponds to unique behavior. 3.3.2.2 Systems of Human–Machine Interactions There are three architectures of human–machine systems that are currently popular in industrial control: (1) adaptive human–machine interface, (2) supervisory human–machine interface, (3) distributed human–machine interface. (1) Adaptive human–machine interface. In a complex control system, human–machine interface is attempted to give users the means to perceive and manipulate easily huge quantities of information under resource constraints such as time, cognitive workload, devices, etc. The intelligence in the human–machine interface makes the control system more flexible and more adaptable. One subset of intelligent user interface is adaptive interfaces. An adaptive interface modifies its behavior according to some defined constraints in order to best satisfy all of them, and varies in the ways and means that are used to achieve adaptation. In human–machine interface of an industrial control, operators, system, and context are continuously changing and are sometimes in contradiction with one another. Thus, this kind of interface can be viewed as the result of a balance between these three components and their changing relative importance and priority. An adaptive interface aims at assisting the operator in acquiring the most salient information in any context, in most appropriate form, and at the most opportune time. In any industrial control systems, two main factors are considered: the system that generates the information stream and the operator to which this stream is presented. The system and the operator share a common goal: to control the process and to solve any problems that may arise. This common objective makes them cooperate although they may both have their own goals. The role of the interface is to integrate these different goals with different levels of importance and the various constraints that come from the task, the environment, or the interface itself in order to produce an information presentation that best harmonizes the set of all these parameters. Specifically, an industrial process control should react consistently, in a timely fashion without disturbing the operator needlessly in his task. However the most salient pieces of information should be presented in the most appropriate way. Zhang_Ch03.indd 365 5/13/2008 5:41:35 PM 366 INDUSTRIAL CONTROL TECHNOLOGY The two main adaptation triggers used to modify the human– machine interface could be (a) The process. When the process moves from a normal state to a disturbed state, the streams of information may become denser and more numerous. To avoid any cognitive overload problems, the interface acts thus as a filter that channels the streams of information. To this end, it adapts the presentation of the pieces of information in order to help the operator identify and solve the problem more quickly, more easily, and more efficiently. (b) The operator. An operator is much more difficult and trickier to drive the adaptation on the user state. As a matter of fact, the interface has to infer whether the operator reacts incorrectly and needs help based on his actions. Then, it may decide to adapt itself to highlight the problem and suggest solutions to assist the user. The aim of the adaptation triggered by the process or the operator is to adapt the composition of the streams of information, that is, to adapt the organization and the presentation of the pieces of information on the interface in the best possible way, according to the state of the process and the inferred state of the operator. What is expected is to improve the communication between the system and the user. The means proposed in an adaptive human–machine interface to reach this are the following: (i) Highlight relevant pieces of information. The importance of a piece of information depends on its relevance according to the particular goals and constraints of each of the entities that participates in the communication between the system and the operator. (ii) Optimize space usage. According to the current usage of the resources, it may turn out that it is necessary to reorganize the display space to cope with new constraints and parameters. (iii) Select the best representation. According to the piece of information, its importance, the resources available, and the media currently in usage, the most appropriate media to communicate with the operator should be used. (iv) Timeliness of information. The display of a particular piece of information should be timely regarded the process and the operator. This adaptation should follow the evolution of the process over time, but it should also adapt the timing of the displayed information to the inferred needs of the operator. Zhang_Ch03.indd 366 5/13/2008 5:41:36 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 367 (v) Perspectives. In traditional interfaces, the operator has to decide what, where, when, and how the information should be presented. Thus, an operator can wonder whether he or she needs an adaptive interface to achieve their task or whether it will constitute more a bother than a help to him or her. This raises at least four questions: (1) From the client’s point of view, whether the cost of developing an adaptive human–machine interface is justifiable. (2) From the human–machine interface designer’s point of view, whether this kind of interface is usable and how to evaluate its usability. (3) From the developer’s point of view, what are the best technical solutions to implement an efficient system within the required time? (4) From the operators’ point of view, whether they consider such an adaptive interface as a collaborator or a competitor. (2) Supervisory human–machine interface. Supervisory human– machine interface can be used in such systems and similar ones where there is a considerable distance between the control room and the machine house in a plant. It is from this machine house that the controller such as SCADA or PLC controls the objects which are, for example, pumps, blowers and purification monitors, etc. To provide the data communication, the supervisory software of the human–machine interface is linked with the controllers over a network such as Ethernet, Control Area Network, and so on. The supervisory software is such that only one person is needed at any one time to monitor the whole plant from a single master device. The generated graphics show a clear representation on screen of the current status of any part of the system. A number of alarms are automatically activated directly on screen if parameters deviate from their tight tolerance band. This ensures extremely rapid updating of the control room screen contents. All the calculations for the controllers are calculated by the control software, using constant feedback from sensors throughout the production process. According to many applications, the supervisory human– machine interface is indeed an ideal software package for these cases above. Thanks to its interactive configuration and its setting assistants, supervisory human–machine interface is able to straightforwardly get the system up and running and tested out. Supervisory human–machine interface is an open architecture which offers all the functions and options necessary for data collection and graphical representation of data on the operator screen. The system provides comprehensive logging of all Zhang_Ch03.indd 367 5/13/2008 5:41:36 PM 368 INDUSTRIAL CONTROL TECHNOLOGY measured values with databases. By accessing this database and by using real-time measurements, a wide variety of reports and trend curves can be viewed on the screen or output to a printer. (3) Distributed human–machine interface. The distributed human– machine interface is a component-based approach. In a system of such an approach, the human–machine interface could directly access any controller component, which also means that each controller exposes the human–machine interface. Since all the system components are location transparent the human–machine interface can bind to a component anywhere, be it in-process, local-process, or remote process. The most likely case is remote binding because it would be assumed that the human–machine interface and the controller would reside on different platforms. In the distributed human–machine interface, the multiple servers are typically used to provide the systems with the flexibility and power of a peer-to-peer architecture. Each controller can have its own human–machine interface server. The assigned server to a controller or a proxy server of a controller is perfect for each controller to manage expansion, frequent system changes, maintenance, and replicated automation lines within or across plants. Instead of a single data server, each controller component provides its own data services through a proxy server. The primary drawback to decentralized components is the uncertainty of real-time controller performance generally resulting from poorly designed proxy agent use, for example, if the human– machine interface samples controller data at too high a frequency. However, the distributed human–machine interface is ideal for SCADA applications. Its distributed peer-to-peer architecture, reusable components, and remote deployment and maintenance capabilities make supporting SCADA applications remarkably efficient. The software’s network services have been optimized for use over slow and intermittent networks, which significantly enhance application deployment and communications. 3.3.2.3 Designs of Human–Machine Interactions The design for a human–machine interface is important, because the human–machine interface of an application will often make or break this application. Although the functionality that an application provides to users is important, the way in which it provides that functionality is of the same importance. An application that is difficult to use will not be used. So, the value of human–machine interface design should not be underestimated. Zhang_Ch03.indd 368 5/13/2008 5:41:36 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 369 (1) Design principles. The following describes a collection of principles for improving the quality of human–machine interface design. (a) The structure principle. The human–machine interface design should organize the interface purposefully, in meaningful and useful ways based on clear, consistent models that are apparent and recognizable to users, putting related things together and separating unrelated things, differentiating dissimilar things and making similar things resemble one another. The structure principle is concerned with overall interface architecture. (b) The simplicity principle. The human–machine interface design should make simple, common tasks simple to do, communicating clearly and simply in the user’s own language, and providing good shortcuts that are meaningfully related to longer procedures. (c) The visibility principle. The human–machine interface design should keep all needed options and materials for a given task visible without distracting the user with extraneous or redundant information. Good designs do not overwhelm users with too many alternatives or confuse them with unneeded information. (d) The feedback principle. The human–machine interface design should keep users informed of actions or interpretations, changes of state or condition, and errors or exceptions that are relevant and of interest to the user through clear, concise, and unambiguous language familiar to users. (e) The tolerance principle. The human–machine interface design should be flexible and tolerant, reducing the cost of mistakes and misuse by allowing undoing and redoing, while also preventing errors wherever possible by tolerating varied inputs and sequences and by interpreting all reasonable actions. (f) The reuse principle. The human–machine interface design should reuse internal and external components and behaviors, maintaining consistency with purpose rather than merely arbitrary consistency, thus reducing the need for users to rethink and remember. (2) Design process. (a) Phase one. The design process begins with a task analysis in which we identify all the stakeholders, examine existing control or production systems and control and production processes, whether they are paper-based or computerized, and identify ways and means to streamline and improve the control or production process. Tasks at this phase are to Zhang_Ch03.indd 369 5/13/2008 5:41:36 PM 370 INDUSTRIAL CONTROL TECHNOLOGY conduct background research, interview stakeholders, and observe people conducting tasks. (b) Phase two. Once having an agreed-upon objective and set of functional requirements, the next step should go through a design phase to generate a design that meets all the requirements. The goal of the design process is to develop a coherent, easy to understand software front-to-end that makes sense to the eventual users of the system. The design and review cycle should be iterated until we are satisfied with our design. (c) Phase three. The next phase is implementation and test. We are also developing and implementing any performance support aids as necessary, for example, on-line help, paper manuals, etc. (d) Phase four. Once a functional system is complete, we move into the final phase. What constitutes “success” is that people using our system, whether it be an intelligent tutoring system or online decision aid, are able to see solutions that they could not see before and/or better understand the constraints that are in place. We generally conduct formal experiments, comparing performance using our system with perhaps different features turned on and off to make contributions to the literature on decision support and human– machine interaction. (3) Design evaluation. An important aspect of human–machine interaction is the methodology for evaluation of user interface techniques. Precision and recall measures have been widely used for comparing the ranking results of noninteractive systems, but are less appropriate for assessing interactive systems. The standard evaluations emphasize high recall levels. However, in many interactive settings, users require only a few relevant documents and do not care about high recall to evaluate highly interactive information access systems. Useful metrics beyond precision and recall include: time required to learn the system, time required to achieve goals on benchmark tasks, error rates, and retention of the use of the interface over time. Empirical data involving human users is time consuming to gather and difficult to draw conclusions from. This is due in part to variation in users’ characteristics and motivations, and in part to the broad scope of information access activities. Formal psychological studies usually only uncover narrow conclusions within restricted contexts. For example, quantities such as the length of time it takes for a user to select an item from a fixed Zhang_Ch03.indd 370 5/13/2008 5:41:36 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 371 menu under various conditions have been characterized empirically, but variations in interaction behavior for complex tasks like information access are difficult to account for accurately. A more informal evaluation approach is called a heuristic evaluation in which user interface affordances are assessed in terms of more general properties and without concern about statistically significant results. 3.3.3 Interfaces For all industrial control systems, a high degree of user friendliness at the interface between human and machine is a decisive prerequisite for being accepted by the general public. Ambient Intelligence applications are characterized by multimodal interfaces as well as by the pro-active behavior of the controller system. Therefore, various interfaces must be sensibly combined with each other, and the interaction with humans must be perfectly adapted to the individual situation of the human. Specific challenges include, among others, the selection of suitable interfaces for specific applications, the dynamic changes of interfaces based on changes in the state of the human such as “experiences gained” or “accident,” as well as the experience-based optimization of such interfaces. Regarding selection, methods are currently being developed that can suggest suitable interfaces based on a comprehensive characterization of the requirements. This methodology is very comprehensive and complex, since the requirements involve human properties such as their desire for information or personal preferences. Further evaluation and optimization of the methodology are absolutely indispensable. This work urgently requires the collaboration of psychologists. With respect to the dynamic changing of interfaces, this must be supported at least by semiautomatic generation. Experience-based patterns may be a suitable approach for this. Concerning the optimization of interfaces, an increase of acceptance through experience-based optimization can be envisioned. Such assistance systems already exist in vehicles, where, for example, the type of acceleration can be adapted to the style of driving of the respective driver. 3.3.3.1 Devices (1) Operator interface terminals. These human–machine interfaces are operator interface terminals with which users interact in order to control other devices. Some human–machine interfaces include Zhang_Ch03.indd 371 5/13/2008 5:41:36 PM 372 INDUSTRIAL CONTROL TECHNOLOGY knobs, levers, and controls. Others provide programmable function keys or a full keypad. Devices that include a processor or interface to personal computers are also available. Many human– machine interfaces include alphanumeric or graphic displays. For ease of use, these displays are often backlit or use standard messages. When selecting human–machine interfaces, important considerations include devices supported and devices controlled. Device dimensions, operating temperature, operating humidity, and vibration and shock ratings are other important factors. Many human–machine interfaces include flat panel displays (FPD) that use liquid crystal display (LCD) or gas plasma technologies. In LCD, an electric current passes through a liquid crystal solution that is trapped between two sheets of polarizing material. The crystals align themselves so that light cannot pass, producing an image on the screen. LCD can be monochrome or color. Color displays can use a passive matrix or an active matrix. Passive matrix displays contain a grid of horizontal and vertical wires with an LCD element at each intersection. In active matrix displays, each pixel has a transistor that is switched directly on or off, improving response times. Unlike LCD, gas plasma displays consist of an array of pixels, each of which contains red, blue, and green subpixels. In the plasma state, gas reacts with the subpixels to display the appropriate color. These human–machine interfaces differ in terms of performance specifications and I/O ports. Performance specifications include processor type, random access memory (RAM), and hard drive capacity, and other drive options. I/O interfaces allow connections to peripherals such as mice, keyboards, and modems. Common I/O interfaces include Ethernet, Fast Ethernet, RS-232, RS-422, RS-485, small computer system interface (SCSI), and universal serial bus (USB). Ethernet is a local area network (LAN) protocol that uses a bus or star typology and supports data transfer rates of 10 Mbps. Fast Ethernet is a 100 Mbps specification. RS-232, RS-422, and RS-485 are balanced serial interfaces for the transmission of digital data. Small computer systems interface (SCSI) is an intelligent I/O parallel peripheral bus with a standard, device-independent protocol that allows many peripheral devices to be connected to the SCSI port. Universal serial bus (USB) is a four-wire, 12-Mbps serial bus for low-to-medium speed peripheral device connections. These human–machine interfaces are available with a variety of features. For example, some devices are web-enabled or networkable. Others include software drivers, a stylus, and support for a keyboard, mouse, and printer. Devices that provide real-time Zhang_Ch03.indd 372 5/13/2008 5:41:36 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 373 clock support use a special battery and are not connected to the power supply. Power-over-Ethernet (PoE) equipment eliminates the need for separate power supplies altogether. These human–machine interfaces that offer shielding against electromagnetic interference (EMI) and radio frequency interference (RFI) are commonly available. Devices that are designed for harsh environments include enclosures that meet standards from the National Electronics Manufacturers’ Association (NEMA). (2) Operator interface monitors. Machine controllers and monitors use electronic numeric control and a monitoring interface for programming and calibrating computerized machinery. This product area includes general-purpose machine controllers, embedded machine controllers, machine monitors, CNC stepper motors, and CNC router controllers. A machine controller is a programmable, automatic, and computer numerically controlled (CNC) device. An embedded machine controller is part of a larger system. A machine monitor is used to collect and display production data from production equipment such as presses. A CNC stepper motor is used to drive a machine tool with power and precision. A CNC router controller is used to cut tool paths. Many other types of machine controllers and monitors are also available. Machine controllers and monitors consist of many different components. A machine controller uses a microprocessor to perform predetermined control and logical operations. Memory is added to the processor in order to record data from the machine. Often, an input device is used to provide menus or options. Some embedded machine controllers provide 16-axis pulse motion control capabilities. Others include antivibration design mechanisms. Machine monitors track a machine’s uptime, downtime, and idle time. They also allow operators to enter a reason for downtime or nonproductive activities. In some cases, a machine monitor can be programmed to require the entry of a reason code after each downtime event. In this way, machine controllers and monitors can be configured to meet the needs of specific machinery and industries. Machine controllers and monitors are used in many different applications. Some machine control products are used to regulate medical equipment such as respirators. Others are used in aerospace, automotive, or military applications. An embedded machine controller can be used in a printing machine, pipe bending equipment, CNC stepper motor, or CNC router controller. Embedded machine controllers are also used in the manufacture of semiconductors and electronic devices. Machine controllers Zhang_Ch03.indd 373 5/13/2008 5:41:36 PM 374 INDUSTRIAL CONTROL TECHNOLOGY and monitors with integral software are used in industries where reliability, quality, and cost are important considerations. (3) Industrial control pendants. Industrial control pendants are sophisticated, hand-held terminals that are used to control robot or machine movements from point to point, within a determined space. They consist of a hanging control console furnished with joysticks, push buttons, or rotary cam switches. A type of industrial control pendant, teach pendants are the most popular robotics teaching method, and are used widely with all types of robots, in many industries. As the robot moves within this determined space, the various points are recorded into its memory banks, and can be located later on through subsequent playback. There are a number of teach pendant types available, depending on the type of application for which they will be used. If the goal is simply to monitor and control a robotics unit, then a simple control box style is suitable. If additional capabilities such as on the fly programming are required, more sophisticated boxes should be used. Industrial control pendants are equipped with switches, dials, and pushbuttons through which data is relayed to the robotics unit, and additional monitoring systems if necessary. The relationship between industrial control pendants and their subservient unit is generally established via an interconnected cabling system. However, more advanced wireless devices are also available. During use, the operator actuates the switches on manual pendants in a specific order. This, in turn, causes the robot, end effectors, or machine, to move to and from the desired points. As the end effector reaches the desired point, the operator uses the record pushbutton to enter the location into the robot, or robot controller’s memory banks. This is the most common programming method for playback robots. The usage of industrial control pendants is common; however it has a significant disadvantage in that the operator must divert his and her attention away from the movement of the machine during programming in order to locate the appropriate pushbutton to move the robot. The use of a joystick provides a solution to this problem as the movement of the stick in a certain direction propels the robot or machine in that direction. This option is available on more advanced industrial control pendant types. (4) SCADA HMI (human–machine interface) devices. Distributed control systems (DCS) and supervisory control and data acquisition (SCADA) systems are system architectures for process control applications. A distributed control system (DCS) consists of Zhang_Ch03.indd 374 5/13/2008 5:41:36 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 375 a programmable logic controller (PLC) that is networked both to other controllers and to field devices such as sensors, actuators, and terminals. A DCS may also interface to a workstation. A SCADA system is a process control application that collects data from sensors or other devices on a factory floor or in remote locations. The data is then sent to a central computer for management and process control. SCADA systems provide shop floor data collection and may allow manual input via bar codes and keyboards. Both distributed control systems (DCS) and supervisory control and data acquisition (SCADA) systems often include integral software for monitoring and reporting. There are several parts to a supervisory control and data acquisition system or SCADA system. To control SCADA, a SCADA system integrator, SCADA security, and SCADA HMI are required. A SCADA system integrator is used to interface a SCADA system to an external application. SCADA security uses one or more computers at a remote site to monitor and control sensors or shop floor devices. SCADA security includes remote terminal units (RTU), a communications infrastructure, and a central control room where monitoring devices such as workstations are housed. SCADA HMI is a human machine interface that accounts for human factors in engineering design. Distributed control systems (DCS) and supervisory control and data acquisition (SCADA) systems are used in a variety of industries. Distributed control systems or DCS systems are used to control traffic lights and manage chemical processing, pharmaceutical, and power generation facilities. Supervisory control and data acquisition systems or SCADA systems are used in warehouses, petrochemical processing, iron and steel production, food processing, and agricultural applications. Providers of distributed control systems and supervisory control and data acquisition systems are located across the United States and around the world. 3.3.3.2 Tools Operator interface mounts and arms are articulating components used to hold and position industrial computer monitors, keyboards, or other operator interfaces. Operator interface mounts and arms are designed to improve the physical and spatial relationships between machines and the humans that operate them. The science of these relationships, called ergonomics, is the study of human–machine interactions. Ergonomically compatible products are designed to maximize productivity and minimize Zhang_Ch03.indd 375 5/13/2008 5:41:36 PM 376 INDUSTRIAL CONTROL TECHNOLOGY operator fatigue, discomfort, and injury. The goal of using operator interface mounts and arms as part of an ergonomics program is to reduce injuries, illnesses, and musculoskeletal disorders in the workplace. Several of the most common types of ergonomic operator interface mount and arm products include computer accessories (e.g., keyboard drawer, mouse tray, glare screen, wrist rest, and monitor support arm) and workstation accessories (e.g., instrumentation booms, articulating supports, foot rests, chairs, document stands). A monitor support arm is a type of operator interface mount that is designed to support computer screens or monitors in work stations, control centers, and operating theaters. A support arm should combine stability and full adjustability to meet the operator’s needs. A support arm can be a desk, wall, ceiling, or mobile mounting arm. Articulating supports are movable support arms that a user can readjust for the height or location of monitors and equipment in relation to the user’s eyes or hands. Keyboard drawers are used to store unused keyboards. A monitor drawer mounts an LCD and keyboard within a rack frame or enclosure so that a monitor can be folded down and stored when not in use. Instrumentation booms are another type of operator interface mounts and arms. This type of operator interface mount is used to support various types of equipment, including computer or industrial monitors, video equipment, and manufacturing equipment. The U.S. Occupational Safety and Health Administration (OSHA) has a four-pronged, comprehensive approach to ergonomics, including operator interface mounts and arms, that is designed to quickly and effectively address musculoskeletal disorders in the workplace. The OSHA approach includes industry or task specific guidelines, enforcement actions, outreach and assistance activities, and a national advisory committee. 3.3.3.3 Software The human–machine interface (HMI) software enables operators to manage industrial and process control machinery via a computer-based graphical user interface (GUI). There are two basic types of HMI software: supervisory level and machine level. The supervisory level is designed for control room environment and used for system control and data acquisition (SCADA), a process control application which collects data from sensors on the shop floor and sends the information to a central computer for processing. The machine level uses embedded, machine-level devices within the production facility itself. Most human–machine interface software is designed for either supervisory level or machine level; however, Zhang_Ch03.indd 376 5/13/2008 5:41:36 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 377 applications that are suitable for both types of HMI are also available. These software applications are more expensive, but can eliminate redundancies and reduce long-term costs. Selecting human–machine interface software requires an analysis of product specifications and features. Important considerations include system architectures, standards and platforms; ease of implementation, administration, and use; performance, scalability, and integration; and total costs and pricing. Some human–machine interface software provides data logging, alarms, security, forecasting, operations planning and control (OPC), and ActiveX technologies. Others support data migration from legacy systems. Communication on multiple networks can support up to four channels. Supported networks include ControlNet and DeviceNet. ControlNet is a real-time, control-layer network that provides high-speed transport of both time-critical I/O data and messaging data. DeviceNet is designed to connect industrial devices such as limit switches, photoelectric cells, valve manifolds, motor starters, drives, and operator displays to programmable logic controllers (PLC) and personal computers (PC). Some human–machine interface software runs on Microsoft Windows CE, a version of the Windows operating system that is designed for hand-held devices. Microsoft and Windows are registered trademarks of Microsoft Corporation. Windows CE allows users to deploy the same human–machine interface software on distributed HMI servers, machinelevel embedded HMI, diskless open-HMI machines, and portable or pocketsized HMI devices. 3.4 Highway Addressable Remote Transducer (HART) Field Communications HART is an acronym for “Highway Addressable Remote Transducer” that represents a two-way digital communication simultaneously with the 4–20 mA analog signaling used by traditional instrumentation equipment in industrial process control. HART was developed in the early 1980s by a company named Rosemount Inc. for the host to perform the management of the field devices in industrial systems. In July 1993, the HART Communication Foundation was established to provide worldwide support for application of this technology. HART Specifications continue to be updated to broaden the range of HART applications. A recent HART development, the Device Description Language (DDL), provides a universal software interface to new and existing devices. Zhang_Ch03.indd 377 5/13/2008 5:41:36 PM 378 INDUSTRIAL CONTROL TECHNOLOGY 3.4.1 HART Communication Most industrial control systems include numerous field system functions. The host controller, therefore, should instantly communicate with all the field instruments and devices while control processes are running for (1) device configuration or reconfiguration, (2) device diagnostics, (3) device troubleshooting, (4) reading the values of additional measurements provided by the device, (5) device health and status, and other requirements. A host in the system can be a Distributed Control System, PLC, and Asset Management System, Safety System, or a hand-held device. By fully using HART communication, industrial control can be benefited in many aspects. Utilizing the full capabilities of HART-enabled devices and systems reduces costs by improving plant operations and increasing efficiency and helps to avoid the high cost of process disruptions and unplanned shutdowns. Properly utilized, the intelligent capabilities of HART-smart devices are a valuable resource for keeping plants operating at maximum efficiency. Real-time HART integration with plant control, safety, and asset management systems unlocks the value of connected devices and extends the capability of systems to detect any problems with the device, its connection to the process, or interference with accurate communication between the device and system. The world’s leading process automation control systems and instrumentation suppliers all support HART Communication in their field device and system products. Most automation system suppliers offer direct HARTenabled I/O and PC-based software applications to leverage the intelligence in HART-smart field devices for continuous device condition monitoring, real-time diagnostics, and multivariable process information. 3.4.1.1 HART networks (1) Wired HART networks. There are two kinds of wired HART networks available in the industrial control systems. Figure 3.33 displays the architectures of these two wired HART networks; the first (Fig. 3.33(a)) is a point-to-point HART network, and the second (Fig. 3.33(b)) is a multiple-dropped HART network. As shown in Fig. 3.33, wired HART networks include the Host Controller and some field devices that can be transmitters; between the Host and the field devices, this system has an I/O system that can be the system interface with the HART, and a hand-held terminal or hand-held communicator. The type of network with a single Field Instrument that does both HART network functions and analog signaling is probably Zhang_Ch03.indd 378 5/13/2008 5:41:36 PM 379 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL Analog HART interface Digital data (2–3 updates per second) Primary master: control system or other host application Power supply Transmitter Secondary master (a) Control system or other host application Handheld terminal Input/output (I/O) system Field devices (b) Figure 3.33 The architecture of HART networks: (a) the point-to-point HART network and (b) the multiple-dropped HART network. Note: Intrument power is provided by an internal or external power source that is not shown. the most common type of wired HART network and is called a point-to-point network. In some cases the point-to-point network might have a HART Field Instrument but no permanent HART Master. This might occur, for example, if the user intends primarily analog communication and Field Instrument parameters Zhang_Ch03.indd 379 5/13/2008 5:41:36 PM 380 INDUSTRIAL CONTROL TECHNOLOGY are set prior to installation. A HART user might also set up this type of network and then later communicate with the Field Instrument using a hand-held communicator (HART Secondary Master). This is a device that clips onto device terminals (or other points in the network) for temporary HART communication with the Field Instrument. A HART Field Instrument is sometimes configured so that it has no analog signal, only HART function. Several such Field Instruments can be connected together (electrically in parallel) on the same network, as in Fig. 3.34. These Field Instruments are said to be multiple-dropped. The Master is able to talk to and configure each one, in turn. When Field Instruments are multidropped there cannot be any analog signaling. The term “current loop” ceases to have any meaning. Multiple-dropped Field Instruments that are powered from the network draw a small, fixed current (usually 4 mA) so that the number of devices can be maximized. A Field Instrument that has been configured to draw a fixed analog current is said to be “parked.” Parking is accomplished by setting the short-form address of the Field Instrument to some number other than 0. A hand-held communicator might also be connected to the network of Fig. 3.34. There are few restrictions on building wired HART networks. The topology may be loosely described as a bus, with drop attachments forming secondary busses as desired, which are illustrated in Fig. 3.35. The whole collection is considered a single network. Except for the intervening lengths of cable, all of the devices are electrically in parallel. The Hand-Held Communicator (HHC) may also be connected virtually anywhere. As a practical matter, however, most of the cable is inaccessible and the HHC has to be connected at the Field Instrument, in junction boxes, or in controllers or marshalling panels. In Control area Field area HART Master Current loop (network) . . . Field instrument 1 and 2 and Nth Figure 3.34 HART network with multiple-dropped field instruments. Zhang_Ch03.indd 380 5/13/2008 5:41:38 PM 381 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL F1 F1 Control Field area area Single twisted pair Secondary bus F1 F1 Master Main bus F1 Field instrument HHC F1 Figure 3.35 HART network showing free arrangement of devices. intrinsically safe (IS) installations there will likely be an IS barrier separating the control and field areas. A Field Instrument may be added or removed or wiring changes made while the network is live (powered). This may interrupt an on-going transaction. However, if the network is inadvertently short-circuited, this could reset all devices. The network will recover from the loss of a transaction by retrying a previous communication. If Field Instruments are reset, they will eventually come back to the state they were in prior to the reset. No reprogramming of HART parameters is needed. Digital signaling brings with it a variety of other possible devices and modes of operation. For example, some Field Instruments are HART only and have no analog signaling. Others draw no power from the network. In still other cases the network may not be powered (no DC). There also exist other types of HART networks that depart from the conventional one described here. These are covered in another section. (2) Wireless HART networks. Wireless HART is the first open and interoperable wireless communication standard designed to address the critical needs of the process industry for reliable, robust, and secure wireless communication in real world industrial plant applications. A Wireless HART Network consists of Wireless HART field devices, at least one Wireless HART gateway, and a Wireless HART network manager. These components are connected into Zhang_Ch03.indd 381 5/13/2008 5:41:39 PM 382 INDUSTRIAL CONTROL TECHNOLOGY a wireless mesh network supporting bidirectional communication from the HART host to field device and back. Figure 3.36 gives the typical Wireless HART network architecture with the principal devices plotted: (a) Network manager. The Network Manager is an application that manages the mesh network and Network Devices. The Network Manager performs the following functions: (1) Forms the mesh network, (2) Allows new devices to connect to the network, (3) Sets the communication schedule of the devices, (4) Establishes the redundant data paths for all communications, (5) Monitors the network. (b) Gateway devices. The gateway device connects the mesh network with a plant automation network, allowing data to flow between the two network devices. The gateway device provides access to the Wireless HART devices by a system or other host application. (c) Network devices. A network device is a node in the mesh network. It can transmit and receive Wireless HART data and perform the basic functions necessary to support network formation and maintenance. Network devices include Plant automation network n m Host appllication (e.g., Asset management) l Gateway g l m Field devices Network manager e g c f Handheld Process automation controller Gateway Existing HART devices a Adapter Figure 3.36 Typical wireless HART architecture (courtesy of the HART Communication Foundation). Zhang_Ch03.indd 382 5/13/2008 5:41:39 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 383 field devices, router devices, gateway devices, and mesh hand-held devices. (d) Field devices. The field device may be a process connected instrument, a router, or hand-held device. The Wireless HART network connects these devices together. (e) Router device. A router device is used to improve network coverage (to extend a network) so that it is capable of forwarding messages from other network devices. (f) Process connected instrument. Typically a measuring or positioning device used for process monitoring and control, it is also capable of forwarding messages from other network devices. (g) Adapter. An adapter is a device that allows a HART instrument without wireless capability to be connected to a Wireless HART network. (h) Hand-held support device. Hand-held devices are used in the commissioning, monitoring, and maintenance of network devices; they are portable and operated by the plant personnel. Wireless HART networks can be configured in a number of different topologies to support various application requirements including the following: (a) Star network. Star networks have just one router device that communicates with several end devices. This is one of the simplest network topologies. A star network may be appropriate for small applications. (b) Mesh network. Mesh networks are formed by network devices that are all router devices. Mesh networks provide a robust network with redundant data paths which is able to adapt to changing RF environments. (c) Star mesh network. Star mesh networks are a combination of the star network and mesh network. 3.4.1.2 HART Mechanism HART communication occurs between two HART-enabled devices, typically a field device and a control or monitoring system. To perform the communication between the host and the field instruments, the analog measurement signal is used to transmit digital information. For this purpose, an additional signal is modulated to the measurement signal using the Frequency Shift Keying (FSK) process. The two frequencies of the additional signal, 1200 and 2200 Hz, represent the bit values 1 and 0. This makes it possible to transfer additional information without affecting the analog measurement signal. As indicated by Fig. 3.37, HART provides Zhang_Ch03.indd 383 5/13/2008 5:41:40 PM 384 INDUSTRIAL CONTROL TECHNOLOGY +0.5 mA HART signal 0 20 mA –0.5 mA 1200 2200 Hz Hz “1” “0” C Analog signal R C R R C C R C = Command R = Response 4 mA 0 1 Time (s) 2 Figure 3.37 HART signaling (digital and analog). two simultaneous communication channels: the 4–20 mA analog signal and a digital signal. The 4–20 mA signal communicates the primary measured value (in the case of a field instrument) using the 4–20 mA current loop, the fastest and most reliable industry standard. Additional device information is communicated using a digital signal that is superimposed on the analog signal. The digital signal contains information from the device including device status, diagnostics, additional measured or calculated values, etc. Together, the two communication channels provide a complete field communication solution that is easy to use and configure, is low cost and is very robust. The HART signal path from the microprocessor in a sending device to the microprocessor in a receiving device is displayed in Fig. 3.38. Amplifiers, filters, and the network between these two interfaces have been omitted for simplicity in Fig. 3.38. At this level the diagram is the same, regardless of whether a Master or Slave is transmitting. Notice that, if the signal starts out as a current, the FSK is a voltage. But if it starts out a voltage it stays a voltage. The transmitting device begins by turning on its carrier and loading the first byte to be transmitted into its interface circuits. It waits for the byte to be transmitted and then loads the next one. This is repeated until all the Zhang_Ch03.indd 384 5/13/2008 5:41:40 PM 385 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL FSK (current or voltage) Receiver’s interface (circuits and modem) Sender’s interface (circuits and modem) Sender’s microprocessor Receivers’ microprocessor Figure 3.38 HART signaling path. bytes of the message (these messages are always defined as commands that are of predefined format) are exhausted. The transmitter then waits for the last byte to be serialized and finally turns off its carrier. With minor exceptions, the transmitting device does not allow a gap to occur in the serial stream, the start and stop bits are used for synchronization, and the parity bit is part of the HART error detection. The serial character stream is applied to the modulator of the sending modem. The Modulator operates such that a logic 1 applied to the input produces a 1200 Hz periodic signal at the Modulator output. Logic 0 produces 2200 Hz. The type of modulation used is called Continuous Phase Frequency Shift Keying (CPFSK). “Continuous Phase” means that there is no discontinuity in the modulator output when the frequency changes. When the sender’s interface output (modulator input) switches from logic 1 to logic 0, the frequency changes from 1200 to 2200 Hz with just a change in slope of the transmitted waveform. A moment’s thought reveals that the phase does not change through this transition. Given the chosen shift frequencies and the bit rate, a transition can occur at any phase. At the receiving end, the demodulator section of a modem in its interface converts FSK back into a serial bit stream at 1200 bps. Each character is converted back into an 8-bit byte and parity is checked. The receiving microprocessor reads the incoming bytes from its interface and checks parity for each one until there are no more or until parsing of the data stream indicates that this is the last byte of the message. The receiving Zhang_Ch03.indd 385 5/13/2008 5:41:40 PM 386 INDUSTRIAL CONTROL TECHNOLOGY processor accepts the incoming message only if its amplitude is high enough to cause carrier detect to be asserted. In some cases, the receiving processor will have to test an I/O line to make this determination. In others, the carrier detect signal gates the receive data so that nothing (no transitions) reaches the receiving interface unless carrier detect is asserted. HART protocol puts most of the responsibility (such as timing and arbitration) into the Masters. This eases the Field Instrument software development and puts the complexity into the device that is more suited to deal with it. A Master typically sends a command and then expects a reply. A Slave waits for a command and then sends a reply. The command and associated reply are called a transaction. There are typically periods of silence (no device is allowed communicating) between transactions. A Slave accesses the network as quickly as possible in response to a Master. Network access by Masters requires arbitration. Masters arbitrate by observing who sent the last transmission (a Slave or the other Master) and by using timers to delay their own transmissions. Thus, a Master allows time for the other Master to start a transmission. The timers constitute dead time when no device is communicating and therefore contribute to “overhead” in HART communication. Each HART field instrument (in normal cases, a field instrument plays a role of Slave) must have a unique address. Each command sent by a Master contains the address of the desired Field Instrument. All Field Instruments examine the command. The one that recognizes its own address sends back a response. This address is incorporated into the command message sent by a Master and is echoed back in the reply by the Slave. Addresses are either 4 bits or 38 bits and are called short and long or “short frame” and “long frame” addresses, respectively. A Slave can also be addressed through its tag (an identifier assigned by the user). Each command or reply is a message that starts with the preamble and is ended with the checksum. The preamble is allowed to vary in length, depending on the requirements in the Slave end. Different Slaves can have different preamble length requirements, so that a Master might need to maintain a table of these values. A Master will use the longest possible preamble when talking to a Slave for the first time. Once the Master reads the Slave’s preamble, it first checks the length requirement (a stored HART parameter), then will subsequently use this new length when talking to that Slave. The checksum at the end of the message is used for error control. It is the exclusive-OR of all of the preceding bytes, starting with the start delimiter. The checksum, along with the parity bit in each character, creates a message matrix having so-called vertical and longitudinal parity. If a message is in error, this usually necessitates a retry. Zhang_Ch03.indd 386 5/13/2008 5:41:41 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 387 One more feature, available in some Field Instruments, is burst mode. A Field Instrument that is burst-mode capable can repeatedly send a HART reply without a repeated command. This is useful in getting the fastest possible updates (about 2–3 times per second) of process variables. If burst mode is to be used, there can be only one bursting Field Instrument on the network. A Field Instrument remembers its mode of operation during power down and returns to this mode on power up. Thus, a Field Instrument that has been parked will remain so through power down. Similarly, a Field Instrument in burst-mode will begin bursting again on power up. 3.4.2 HART System HART communication in industrial control comprises two folders: HART connection system and HART protocol. This section focuses on the HART system, and the next section will be on the HART protocol. HART system devices work to support the HART protocol by communicating their data over the transmission lines of the 4–20 mA connections. This enables the field devices to be parameterized and initialized in a flexible manner or to read measured and stored data (records). All these tasks require field devices based on microprocessor technology. These devices are frequently called smart devices. For building and maintaining a HART-enabled system, the technical kernel will be choosing the HART-compatible devices, installing the system’s devices, configuring the system’s devices, and calibrating the system’s devices. The key is to make sure that the engineers or designers are requesting or specifying devices or systems that are fully compliant with the HART protocol specification and are tested and registered with the HART Communication Foundation (the HCF). The engineers or designers are required to be assured of these aspects: interoperability with other HART-compatible devices and HART-enabled systems; getting a device that will provide the powerful features of HART technology; specifying a product that will fully integrate into your HART-enabled applications. 3.4.2.1 HART System Devices The devices constructing a HART connection system have several features that significantly reduce the time required to fully commission a HART-enabled network. When less time is required for commissioning, substantial cost savings are hence achieved. Devices which support the HART protocol are grouped into master (host) and slave (field) devices. Master devices include communicator or hand-held terminals as well as Zhang_Ch03.indd 387 5/13/2008 5:41:41 PM 388 INDUSTRIAL CONTROL TECHNOLOGY PC-based workplaces that stay in a control room. HART slave devices, on the other hand, include sensors, transmitters, and various actuators. The variety ranges from two-wire and four-wire devices to intrinsically safe versions for use in hazardous environments. Field devices and communicators as well as compact hand-held terminals have an integrated FSKmodem, whereas computers or workstations have a serial interface to connect the modem externally. HART communication is often used for such simple point-to-point connections (Fig. 3.33(a)). Nevertheless, many more connection variants are possible. In extended systems, the number of accessible devices can be increased by using a multiplexer. In addition to that, HART enables the networking of devices to suit special applications. Network variants include multiple-dropped (Fig. 3.39), FSK-bus, and networks for split-range operation. (1) HART Communicator. The HART Communicator is the most widely used communicator across the world in industrial control. The HART Communicators are portable devices; their weights have been evenly distributed for comfortable one-handed operation in the field. The result is the universal, user upgradeable, intrinsically safe, rugged and reliable Field Communicator. In HART-enabled systems, the HART Communicators are often PC host Modem Multiplexer HART field device Controller HART signals Address 0 4–20 mA Address 0 Address 0 Figure 3.39 An HART connecting system including the FSK-modem and HART-multiplexer, and HART-buses (courtesy of the SAMSON, Inc.). Zhang_Ch03.indd 388 5/13/2008 5:41:41 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 389 defined by engineers as the Second Master (Fig. 3.33(a)) or Hand-held Terminals (Fig. 3.33(b)). With a memory and a microprocessor or some applicationspecific integrated circuits, the HART Communicator provides a complete solution for configuring and monitoring all HART devices and all Fieldbus devices of an industrial system. It is comprised of three main components plus accessories. These parts consist of the hand-held; the HART interface hardware, and the application software Suite. The Communicator runs on a robust, real-time, operating system. This trio of hardware and software comprises a complete HART field communicator that can be powerful, multifaceted, and portable all in one. The hardware for the HART Communicators primarily includes the HART interface and the pinch connectors. The HART interface is designed to interface to the multiple connectors located on the bottom of the hand-held, allowing communication between the Palm and the HART network. The pinch connectors easily connect to any HART network for instant communication. Most of the HART interface requires no batteries, running solely off the hand-held’s internal power supply. Its compact size and low power consumption makes the interface an ideal solution for portability. The software suite for the HART Communicators includes some distinct applications. Each of these applications is preloaded onto the hand-held and designed for a particular function. The main application of the suite allows communication, monitoring, and configuration of HART-compatible devices. The software is based upon manufacturer device description files (DDL) and thus allows access to all menus and parameters as designed by the manufacturer. This software application allows for the logging of device variable values over time. A wide range of variables can be logged automatically at a user selectable sample time, or manually one by one. These logs can be saved and transferred to a PC for further analysis. This graphing application allows device variables to be trended over time in an easy to view graphical format. Device parameters can be simultaneously graphed in various colors for easy identification. The display makes it easy to read in both bright sunlight and in normal lighting. To make sure all conditions are covered, a multilevel backlight is added, allowing the display to be viewed in those areas of your plant with dim light. The touch sensitive display and large physical navigation buttons provide for efficient use both on the bench and in the field. User upgradeable HART and Fieldbus devices, as well as functional updates to existing devices are introduced continually Zhang_Ch03.indd 389 5/13/2008 5:41:41 PM 390 INDUSTRIAL CONTROL TECHNOLOGY by device vendors. Keeping up-to-date with the required Device Description (DD) drivers for all the devices in plant can be a real challenge. Nowadays, with the Easy Upgrade option, keeping communicators updated with the most current Device Descriptions (DDs) is an easy job. (2) FSK-Modem. There are often two kinds of modem required in the HART-enabled industrial control networks: USB (Universal Serial Bus) Modem and FSK (Frequency Shift Keying) Modem. These two kinds of modem are all connected with the host PC (Personal Computer) in the HART-enabled networks. This USBModem is just an ordinary PC modem used for computer networks, without special design for HART functions. However, the FSK-Modem should be particularly designed for HART functions. The following will focus on the FSK-Modem. The FSK-modem is designed to provide HART communication capabilities for the implementation of Frequency Shift Keying (FSK) techniques to transfer data. The FSK-modem is also required to conform to the HART network’s physical layer. For this purpose, most FSK-Modems operate at the Bell 202 standard and are made into a chipset containing some integrated circuits. As shown in Fig. 3.37, the FSK is the frequency modulation of a carrier of digital capability. For Simplex or Half Duplex operation, the FSK-modem uses a single carrier in which the communication can only be transmitted in one direction at a time. For Full Duplex, the FSK-modem uses multiple carriers so that data communication can be simultaneous in both directions. The basic block diagram for the FSK-modem chipset is depicted in Fig. 3.40, which illustrates the mechanism of a data modulation and demodulation. This chip is divided into three main parts: receive, transmit, and clock recovery. Both receive Audio signal input Low-pass filter Received digital data Descrambler Clock recovery Recovered clock signal TX clock Transmitted digital data Scrambler FIR Anti-imaging filter Audio signal output Figure 3.40 Block diagram of an FSK-modem chipset. Zhang_Ch03.indd 390 5/13/2008 5:41:41 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 391 and transmit blocks are separated and data can be processed in each direction independently. (a) Modulator for transmitting data. The data transmit part in this chipset performs modulation, in which the scrambler is to make a nearly flat spectrum of output signal. The output of the scrambler is connected to a long digital FIR filter. This FIR filter compensates distortion of transmission line and removes sharp edges rising from High-Low or Low-High logic transitions. The FIR filter makes the transmitted signal spectrum narrow to fit bandwidth and compensates the signal for the receiver’s side. The transmit wave’s shapes are stored in an EPROM (an electronic memory, see Chapter 2 of this book). In this way the transmitted waveform is synthesized not only from the present bit’s state, but also the four that preceded it and four to come. Data burnt into EPROM represents filter response for each of 256 combinations. (b) Demodulator for receiving data. At the receiving side, the audio signal going from the discriminator of the transceiver is passed through a low-pass filter to eliminate pertinent higher frequencies, and remove out of band spurious noise and residue. The signal is then limited and detected by sampling at the correct instant. At this point, the detected data, still randomized, are passed through a descrambler, where the original data are recovered and the result goes off to terminal. A descrambler, like a scrambler, is simply to provide the invert function of the scrambler and perforce requires some number of bits to synchronize. (c) Clock recovery. The heart of the receiver is a digital phase locked network (DPLL), which must extract a clock from the received audio stream. It is needed to time the receiver functions, including the all-important data detector. Each waveform has a phase shift of 360/256° from another and is made up of 16 samples. The received audio signal is limited, and a zero crossing detector circuit generates one cycle of 9600 Hz for each zero-crossing (a proto-clock). This is compared with a locally generated clock in a phase detector based on an up/down counter. The counter increments if one clock is early, decrements otherwise. This count then addresses an EPROM mentioned above. In this way, the local clock slips rapidly into phase with that of the incoming data. Local clock signal is derived from the output of EPROM. Output data are converted to sine voltage with maximum amplitude. Zhang_Ch03.indd 391 5/13/2008 5:41:41 PM 392 INDUSTRIAL CONTROL TECHNOLOGY Some FSK-modems have one more function block in their chipsets; that is Carrier Detect. The carrier detect function in the FSK-modem is responsible for checking whether or not the modulated or demodulated waves fall in some range of frequencies. The carrier detect output is active low whenever a valid carrier tone between some Hz (inclusive) is detected. Detection occurs when timed transitions remain within the band of these Hz periods for 10 nanoseconds to 1 bit time. Some of the FSK-modem manufacturers use CMOS technologies to make the chipset. The FSK-modem is chipset with pin-out specification. In a HART-enabled network, this FSK-modem should be connected with the host microprocessor or the CPU (Central Processing Unit). Figure 3.41 illustrates how this modem’s pins connect with the CPU in an FSK-modem. (3) HART Multiplexer. In the HART-enabled industrial networks, the HART Multiplexer acts as a gateway between the network management computer and the HART-compatible field devices. Many field devices are distributed over a wide area in industrial process systems, and must be monitored and adapted to the changes in the processing environment. The process system with the HART Multiplexer enables on-line communication between an asset management computer or workstation and those intelligent field devices that support the HART protocol so as to simultaneously fit into the changes in the process system. All actions on the field device are parallel to the transmission of the 4–20 mA MOD/DEMOD I/O Carrier detect CPU Bandpass filter INRTS OCD IRXA HT2012 RX TX TX data RX data Waveshape filter ITXD ORXD OTXA 1460K OLK 460.8 kHz M A U M e d i a n e t w o r k Figure 3.41 Typical hardware design of an FSK-modem. Zhang_Ch03.indd 392 5/13/2008 5:41:41 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 393 measurement signals and have no influence on the measurement value processing through the process system. Each HART Multiplexer, regardless of whether it is a slave or a master, provides a connection to a specified number of field instruments. Up to thousands of field units can communicate and exchange data with a computer or workstation. Working with a hand-held terminal (HART-communicator) is also possible since the HART protocol accepts two masters (computer and hand-held terminal) in one system. Systems can be easily expanded and the advantages of the HART communications can be exploited. At the present technical level, the system consists of a maximum of 31 HART Multiplexer masters which are linked to the computer with an RS485 interface. Each HART Multiplexer master controls up to 15 HART Multiplexer slaves. At present, the HART Multiplexers are specified as the following three types: (a) HART Multiplexer Master. This is a HART Multiplexer that can operate up to 256 analog field instruments. The built-in slave unit operates the first 16 loops. If more than 16 loops are required, additional slave units can be connected. The slave units are connected to the master with a 14-pin flat cable. The connector for the ribbon cable is found on the same housing side as the connectors for the interface and the power supply. The analog signals are separately linked to a termination board with a 26-pin cable for each unit. Sixteen leads are reserved for the HART signal of the analog measurement circuits. The remaining 10 leads are sent to ground. This unit is designed with removable terminals and can be connected to a Power Rail. (b) HART Multiplexer Slave. This is a HART Multiplexer that can operate up to 16 analog field instruments at the present. In this case, the slave can only be operated with the HART Multiplexer Master and is powered by the master across a 14-pin flat cable connection. Up to 15 slaves can be connected to the master. The slave address is set with a 16 position rotary switch (addresses 1–16). If only one slave is connected to the master, then the slave address should be 1. If multiple slaves are connected, slaves are to be assigned addresses in ascending order. The analog signals are fed into the slave by means of a 26-pin ribbon cable. Sixteen leads are reserved for the HART signal of the analog measurement circuits. The remaining 10 leads are assigned to ground. (c) HART flexible interface. This is a flexible interface board with a HART pick-up connector. This flexible interface Zhang_Ch03.indd 393 5/13/2008 5:41:42 PM 394 INDUSTRIAL CONTROL TECHNOLOGY board has 16 terminal blocks to connect up to 16 smart field devices. This board can be used for general purpose applications or in conjunction with intrinsic safety barriers for hazardous area applications. The specification of a HART Multiplexer should include these important technical data: (i) HART signal channels (1) Leakage current (µA at some temperature range), (2) Output termination External (measured by Ω), (3) Output voltage (mVpp), (4) Output impedance (measured by Ω, capacitively linked), (5) Input impedance per HART conventions, (6) Input voltage range (mV-Vpp), (7) Input voltage. (ii) Power supply (1) Nominal voltage (VDC), (2) Power consumption (less and equal to some W). (iii) Interface (1) Type is RS-xxx (Some number of wire multidrops), (2) Transmission speed 9600, 19200, 38400 baud, (3) Address selection (32) possible RS-xxx addresses, (4) The transmission speed (unit is “baud”) at the “ON” and “OFF” state for every switch. (iv) Mechanical data (1) Mounting some mm DIN rail or wall mounted, (2) Connection options some-pin ribbon cable for analog; some-pin ribbon cable for master–slave, (3) Removable terminals, maximum some AWG for interface and power supply. (4) HART connecting buses. In industrial process systems, the HART-enabled networks require several kinds of buses for connecting the HART-compatible devices and instruments. A brief description of two of these buses is given below. (a) Bus for split-range operation. In industrial process systems, there are special applications which require that several (usually two) actuators receive the same control signal. A typical example is the split-range operation of control valves. One valve operates in the nominal current range from 4 to 12 mA, while another valve uses the current range from 12 to 20 mA. The split-range operation technique is a solution for this case. In split-range operation, the control valves are connected in series in the current network. When both valves have a HART interface, the HART host device must be Zhang_Ch03.indd 394 5/13/2008 5:41:42 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 395 able to distinguish with which valve it must communicate. To achieve this, the HART protocol revision 6 (anticipated for autumn 1999) and later will be extended by one more network variant. As is the case for multiple-dropped mode, each device is assigned to an address from 1 to 15. The analog 4–20 mA signals preserve its device-specific function, which is, for control valves, the selection of the required travel. (b) FSK-bus. The HART protocol can be extended by the FSK-bus. Similar to a device bus, the FSK-bus can connect approximately 100 HART-compatible devices and address these devices with the technical level at the present. This requires special assembly-type isolating amplifiers (e.g., TET 128). The only reason for the limited number of participants is that each additional participant increases the signal noise. The signal quality is therefore no longer sufficient to properly evaluate the telegram. The HART devices are connected to their analog current signal and the common FSKbus line with the isolating amplifier (Fig. 3.42). From the FSK-bus viewpoint, the isolating amplifiers act as impedance converters. This enables devices with high load to be integrated in the communication network. To address these devices, a special, long form of addressing is used. During the configuration phase, the bus address and the tag number of each device are set with the point-to-point line. During operation, the devices operate with the long addresses. When using the HART command 11 (see the subsection below), the host can also address the device via its tag. In this way, the system configuration can be read and checked during the start-up phase. (5) HART system interface. HART communication between two or more devices can function properly only when all communication participants are able to interpret the HART sine-wave signals correctly. To ensure this, not only must the transmission lines fulfill certain requirements, but the devices in the current network which are not part of the HART communication can impede or even prevent the transmission of the data. The reason is that the inputs and outputs of these devices are specified only for the 4–20 mA technology. Because the input and output resistances change with the signal frequency, such devices are likely to shortcircuit the higher frequency HART signals (1200–2200 Hz). Where a HART communication system is connected with other kinds of communication systems, gateways could be the best interface devices to convert the HART protocol into the Zhang_Ch03.indd 395 5/13/2008 5:41:42 PM 396 INDUSTRIAL CONTROL TECHNOLOGY Host Safe area PC Hazardous area 3780-1 FSK isolating amplifier (Ex-i) Controller FSK bus 3780-1 3780-1 • • Up to max. • 100 control loops • Figure 3.42 The connection architecture of an HART network with the FSK-bus (courtesy of the SAMSON, Inc.). protocols of the networks to be coupled. In most cases, when complex communications must be performed, Fieldbus systems would be the preferred choice. Even though there is no complex protocol conversion, the HART-enabled system is capable of communicating over long distances. Furthermore, the HART data signals can be transmitted over telephone lines using HART/ CCITT converters, in which the Field devices directly connect to dedicated lines owned by the telephone company, being able to communicate with the centralized host located many kilometers away. However, as already mentioned, within a HART-enabled system, the HART-compatible field devices also require an appropriate communication interface that could be, for example, an integrated FSK-modem or a HART-Multiplexer. As mentioned earlier, the HART signals are imposed on the conventional analog current signal. Whether the devices in the networks are designed in four-wire technique including an Zhang_Ch03.indd 396 5/13/2008 5:41:42 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 397 additional power supply or in two-wire technique, HART communication can be used for both cases. However, it is important to note that the maximum permissible load of a HART device is fixed. The load of a HART device is limited by the HART specification. Another limitation is due to the process controller. The output of the process controller must be able to provide the power for the connected two-wire device. The higher the power consumption of a two-wire device is, the higher its load is. The additional functions of a HARTcommunicating device increase its power consumption, and hence the load, compared to non-HART devices. When retrofitting HART devices into an already existing installation, the process controller must be checked for its ability to provide the power required by the HART-compatible device. The process controller must be able to provide at least the load impedance of the HART device at 20 mA. 3.4.2.2 HART System Installation The first task before installing a HART-enabled system is checking to verify the HART-compatible devices. Manufacturers have different levels of HART technical implementation in their devices and systems. In fact the capabilities of the HART-compatible devices and HART-enabled system vary widely, which requires when that engineers, when specifying HART technology, consider such factors and parameters as the following: (1) Registered device at the HART Communication Foundation (the HCF). (2) Registered Device-Description at the HART Communication Foundation (the HCF). (3) What is the number of variables this device can measure? (4) Does this device comply with HART specification (in reference of the HCF)? (5) Does the device respond to HART Command 48 (in reference of the HCF’ specifications)? (6) What unique or special features does this device support? (7) What diagnostic features does the device contain? These questions below are for the suppliers of those I/O interface devices: (1) How much HART capability is embedded into the I/O and how smart is it? (2) Can the I/O validate and secure the 4–20 mA signal? Zhang_Ch03.indd 397 5/13/2008 5:41:42 PM 398 INDUSTRIAL CONTROL TECHNOLOGY (3) Is there one HART modem per channel, or is the I/O multiplexed? How fast can it update the HART digital values? (4) In what ways does the system support access to multivariable HART data from multivariable devices? (5) Can you merely “push a button” on the I/O to calibrate the network current or check the range? (6) Does the I/O support multiple-dropped networks? (7) Does the I/O automatically scan and monitor the HARTcompatible field devices or is the scanning only possible using “pass through”? These questions below should be asked of the control system suppliers: (1) Does your host use a “native” device description or does it require a different file type? (2) Does the system make it easy to use all HART capabilities? (3) How much training is required to learn how to get and use HART data? (4) Review the configuration of a HART-compatible device using the control system. (5) Can the system use secondary digital process variables? (6) Does it understand the HART-compatible device status change? (7) Can the system detect configuration changes? (8) Does the system do notification by exception? (9) How does the system detect changes in configuration and status? (10) How is the HART-compatible device status communicated to the operators? (11) How do you perform tests when there is an error in the device? (12) How open is the system to third party software? Before installation, it is also necessary to enter device tags and other identification and configuration data into each field instrument. After installation, the instrument identification (tag and descriptor) can be verified in the control room using a configuration tool such as hand-held communicator or computer. Some field devices provide information on their physical configuration (e.g., wetted materials). These and other configuration data can also be verified in the control room. The verification process is important for safety. Once a field instrument has been identified and its configuration data confirmed, the analog network integrity can be checked using the network test feature, which is supported by many HART-compatible devices. The network test feature enables the analog signal from a HART transmitter to be fixed at a specific value to verify network integrity and ensure proper Zhang_Ch03.indd 398 5/13/2008 5:41:42 PM 399 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL connection to support devices such as indicators, recorders, and DCS displays. Use the HART protocol network test feature to check analog network integrity and ensure a proper physical connection among all network devices. Additional integrity can be achieved if the analog value is compared to the digital value being reported in a device. For example, someone might have provided an offset to the 4–20 mA analog value that has not been accounted for in the control system. By comparing the digital value of the Primary Variable to the analog value, the network integrity can be verified. There are some ways to integrate HART data and leverage the intelligence in smart field devices. Several simple and cost-effective integration strategies are listed below in order to get more from currently installed HART-compatible devices and instruments (Fig. 3.43). (1) Point-to-point integration. This is the most common way to use HART. The communication capability of HART-compatible devices allows them to be configured and set up for specific applications, reducing costs and saving time in commissioning and maintenance. With connection to the 4–20 mA wires, a device can be integrated from remote locations by connecting anywhere on the current network to obtain device status and diagnostic information. (2) HART-to-analog integration. Signal extractors communicate with HART-compatible devices in real-time (simultaneously) to convert the intelligent information in these devices into 4–20 mA signals for input into an existing analog control system. Add this Operator’s computer H A R HART system/network controller T d HART I/O interface devices a t a Filed instruments Figure 3.43 The dataflow diagram for the integration of the HART data. Zhang_Ch03.indd 399 5/13/2008 5:41:43 PM 400 INDUSTRIAL CONTROL TECHNOLOGY capability one device at a time to get more from the intelligent HART-compatible devices. (3) HART-plus-analog integration. New HART-multiplexer packaging solutions make it easy to communicate with HART-compatible devices by replacing the existing I/O termination panels. The analog control signal continues on to the control system as it does today but the HART data is sent to a device asset management system providing valuable diagnostics information 24/7. Although the control system is not aware of the HART data, this solution provides better access to device diagnostics for asset management improvements. (4) Full HART integration. Upgrading a Field or Remote I/O system provides an integrated path to continuously put HART data directly into your control system. Most new control systems are HART-capable and many suppliers offer software and I/O solutions to make upgrades simple and cost-effective. Continuous communication between the field device and control system enables problems with the devices, its connection to the process, or inaccuracies in the 4–20 mA control signal to be detected automatically so that corrective action can be taken before there is negative impact to the process operation. 3.4.2.3 HART System Configuration The purpose of the Device Configuration is for accessing its HART Data. There are several methods of accessing the intelligent information in the HART-compatible device on a temporary or a permanent basis. The configuration of a HART-compatible device can be achieved by using the software and hardware tools. To configure a single device on a temporary basis, a universal hand-held configuration tool is needed, with a power supply, a load resister, and a HART-compatible device. Or, configuration can be achieved by using a computer which is capable of running a device configuration application and using a HART-modem. (1) Universal hand-held communicators. HART hand-held communicators are available from major instrumentation suppliers across the world and are supported by the member companies of the HCF. Using Device Description (DD) files, the communicator can fully configure any HART-compatible device for which it has a DD installed. If the communicator does not have the DD for a specific device, it will still communicate and configure the device using the HART Universal and Common Practice commands. Zhang_Ch03.indd 400 5/13/2008 5:41:43 PM 401 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL There are 35–40 standard data items in every registered HARTcompatible device. The data can be accessed by any approved configuration tool such as a communicator. These items do not require the use of a Device Description and typically include the basic functionality for all devices. These are the Universal and Common Practice commands required of every registered HART device. To access the device specific data, a current Device Description is required and provides the communicator with the information it needs to fully access all the device specific capabilities. A HART hand-held communicator, if equipped, can also facilitate record keeping of device configurations. After a device is installed, its configuration data can be stored in memory or on a disk for later archiving or printing. There are many types of hand-held communicators available today; their features and ability should be compared to find those that meet your specific requirements. (2) Computer-based device configuration and management tools. A HART-compatible device can be configured with a desktop or laptop computer (or other portable models) by using a computer-based software application and a HART interface modem (Fig. 3.44). The advantages of using a computer include an improved screen display and support for more Device Descriptions and Device Configurations due to additional computer-based memory storage capacity. Due to the critical nature of device configurations in the plant environment, these Handheld teminal PC/host application RS232 or USB HART interface 250 Ω resistor Power supply Field device Figure 3.44 The connection of a computer with an HART-compatible device for configuration (courtesy of the HCF). Zhang_Ch03.indd 401 5/13/2008 5:41:43 PM 402 INDUSTRIAL CONTROL TECHNOLOGY computers can also be used as backup storage for data from hand-held communicators. Software applications are available from many suppliers. It is important to review their features to determine ease of use, ability to add or download the Device Descriptions, and general functionality. 3.4.2.4 HART System Calibration In order to take advantage of the digital capabilities of HART-compatible devices and instruments, especially for precisely reporting the data values of process control, it is essential that these devices and instruments should be calibrated correctly. Like the calibration procedure of other devices, a calibration procedure for HART-compatible devices and instruments consists of a verification test, an adjustment to within acceptable tolerance if necessary, and a final verification test if an adjustment has been made. Furthermore, data from the calibration is collected and used to complete a report of calibration, documenting instrument performance over time. (1) Functional parts of HART devices. For a HART-compatible device, a multiple-point test between input and output does not provide an accurate representation of its operation. Just like a conventional device, the measurement process begins with a technology that converts a physical quantity into an electrical signal. However, the similarity to a conventional device ends here. Instead of a purely mechanical or electrical path between the input and the resulting 4–20 mA output signal, a HARTcompatible device has a microprocessor that manipulates the input data. As shown in Fig. 3.45, there are typically three calculation sections involved, and each of these sections may be individually tested and adjusted in the calibration procedure. Prior to the first box in Fig. 3.45, the microprocessor of this device measures some electrical property that is affected by the process variable of interest. The measured value may be voltage, capacitance, reluctance, inductance, frequency, or some other property. However, before it can be used by the microprocessor, it must be transformed to a digital count by an analog to digital (A/D) converter. In the first box, the microprocessor of this device must rely upon some form of equation or table to relate the raw count value of the electrical measurement to the actual property (PV) of interest such as temperature, pressure, or flow. The principal form of this table is usually established by the manufacturer, but Zhang_Ch03.indd 402 5/13/2008 5:41:44 PM 403 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL Counts Input section PV may be read digitally High and low output trim mA D/A counts Counts PV PV A/D counts Range and transfer function mA High and low sensor trim PV mA Conversion section Output section mA may be set and read digitally Figure 3.45 A functional block diagram of HART-compatible devices. most HART-compatible devices and instruments include commands to perform field adjustments. This is often referred to as a sensor trim. The output of the first box is a digital representation of the process variable. When engineers read the process variable using a communicator, this is the value that they can see. The second box in Fig. 3.45 is strictly a mathematical conversion from the process variable to the equivalent milliamp representation. The range values of the instrument (related to the zero and span values) are used in conjunction with the transfer function to calculate this value. Although a linear transfer function is the most common, pressure transmitters often have a square-root option. Other special instruments may implement common mathematical transformations or user defined break point tables. The output of the second block is a digital representation of the desired instrument output. When engineers read the network current using a HART-communicator, this is the value that they see. Many HART-compatible instruments support a command which puts the instrument into a fixed output test mode. This overrides the normal output of the second block and substitutes a specified output value. The third box in Fig. 3.45 is the output section where the calculated output value is converted to a count value that can be loaded into a digital to analog converter. This produces the actual analog electrical signal. Once again the microprocessor must rely on some internal calibration factors to get the output correct. Adjusting these factors is often referred to as a current loop trim or 4–20 mA trim. (2) Basic steps of HART calibration. This analysis in (1) above tells us why a proper calibration procedure for a HART-compatible Zhang_Ch03.indd 403 5/13/2008 5:41:44 PM 404 INDUSTRIAL CONTROL TECHNOLOGY instrument is significantly different from that for a conventional instrument. The specific calibration requirements depend upon the application. If the application uses the digital representation of the process variable for monitoring or control, then the sensor input section (the first box in Fig. 3.45) must be explicitly tested and adjusted. Please note that this reading is completely independent of the milliamp output, and has nothing to do with the zero or span settings. The PV as read with HART communication continues to be accurate even when it is outside the assigned output range. If the current network output is not used (i.e., the instrument is used as a digital only device), then the input section calibration is all that is required. If the application uses the milliamp output, then the output section must be explicitly tested and calibrated. Please note that this calibration is independent of the input section, and again, has nothing to do with the zero and span settings. The same basic multiple point test and adjust technique are employed, but with a new definition for output. To run a test, use a calibrator to measure the applied input, but read the associated output (PV) with a communicator. Error calculations are simpler because there is always a linear relationship between the input and output, and both are recorded in the same engineering units. In general, the desired accuracy for this test will be the manufacturer’s accuracy specification. If the test does not pass, then follow the procedure recommended by the manufacturer for trimming the input section. This may be called a sensor trim and typically involves one or two trim points. Pressure transmitters also often have a zero trim, where the input calculation is adjusted to read exactly zero (not low range). Do not confuse a trim with any form of reranging or any procedure that involves using zero and span buttons. The same basic multiple point test and adjust technique is employed again, but with a new definition for input. To run a test, use a communicator to put the transmitter into a fixed current output mode. The input value for the test is the mA value. The output value is obtained using a calibrator to measure the resulting current. This test also implies a linear relationship between the input and output, and both are recorded in the same engineering units (milliamps). The desired accuracy for this test should also reflect the manufacturer’s accuracy specification. If the test does not pass, then follow the procedure recommended by the manufacturer for trimming the output section. This may be called a 4–20 mA trim, a current loop trim, or a D/A trim. The trim procedure should require two trim points close to or just outside Zhang_Ch03.indd 404 5/13/2008 5:41:44 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 405 of 4 and 20 mA. Do not confuse this with any form of reranging or any procedure that involves using zero and span buttons. After calibrating both the Input and Output sections, a HARTcompatible device or instrument should operate correctly. The middle block in Fig. 3.45 only involves computations. That is why the range, units, and transfer function can be changed without necessarily affecting the calibration. Notice also that even if the instrument has an unusual transfer function, it only operates in the conversion of the input value to a milliamp output value, and therefore is not involved in the testing or calibration of either the input or output sections. (3) Performance verification of HART calibration. If the goal of this calibration is to validate the overall performance of a HARTcompatible device or instrument, it needs just to run a zero and span test like that applied to a conventional instrument. However, passing this test does not definitely indicate that the transmitter is operating correctly, which is due to the following reasons. Many HART-compatible instruments support a parameter called damping. If this is not set to zero, it can have an adverse effect on tests and adjustments. Damping induces a delay between a change in the instrument input and the detection of that change in the digital value for the instrument input reading and the corresponding instrument output value. This damping induced delay may exceed the settling time used in the test or calibration. The settling time is the amount of time the test or calibration waits between setting the input and reading the resulting output. It is advisable to adjust the instrument damping value to zero prior to performing tests or adjustments. After calibration, be sure the damping constant is returned to its required value. There is a common misconception that changing the range of a HART-compatible instrument by using a communicator somehow calibrates the instrument. Remember that a true calibration requires a reference standard, usually in the form of one or more pieces of calibration equipment to provide an input and measure the resulting output. Therefore, since a range change does not reference any external calibration standards, it is really a configuration change, not a calibration. Please note that in the block diagram of HART-compatible devices (Fig. 3.45), changing the range only affects the second box. It has no effect on the digital process variable as read by a communicator. Using only the zero and span adjustments to calibrate a HARTcompatible instrument (the standard practice associated with conventional instruments) often corrupts the internal digital readings. As shown in Fig. 3.45, there is more than one output to consider. Zhang_Ch03.indd 405 5/13/2008 5:41:44 PM 406 INDUSTRIAL CONTROL TECHNOLOGY The digital PV and milliamp values read by a communicator are also outputs, just like the analog current network. The proper way to correct a zero drift condition is to use a zero trim. This adjusts the instrument input block so that the digital PV agrees with the calibration standard. If intending to use the digital process values for trending, statistical calculations, or maintenance tracking, then it should disable the external zero and span buttons and avoid using them entirely. 3.4.3 HART Protocol HART protocol is widely recognized as the industry standard for digitally enhanced 4–20 mA field instrument communication in process control. In industrial process control, the HART protocol provides a uniquely backward compatible solution for filed instrument communication as both 4–20 mA analog and digital signals are transmitted simultaneously on the same wiring. 3.4.3.1 HART Protocol Model HART communication uses a master–slave protocol which means that a field device as slave speaks only when it is spoken to by a device as master. In every communication, a master device sends a “command” message first; while receiving this command message, the slave device processes it and then sends back a “response” message to that master device (Fig. 3.46). Both the “command” and “response” messages include the HART-data and must be formatted in accordance with the relevant HCF (HART Communication Foundation) specifications. Master Slave Command Indication Request Time out Response Response Confirmation Figure 3.46 The HART master–slave protocol model. Zhang_Ch03.indd 406 5/13/2008 5:41:44 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 407 The HART protocol can be used in various modes for communicating information to and from smart field instruments and central control or monitoring equipment, which includes analog plus digital signals, and digital only signals. Digital master–slave communication simultaneous with the 4–20 mA analog signals is the most common. This mode, depicted in Fig. 3.46, allows digital information from the slave device to be updated twice per second in the master. The 4–20 mA analog signals are continuous and can still carry the primary variable for control. Please note that when a communication between the master and the slave is engaging, “interrupt” is definitely not allowed. “Burst” is an optional communication mode (Fig. 3.46) which allows a single slave device to continuously broadcast a standard HART response message. This mode frees the master from having to send repeated command requests to get updated process variable information. The same HART response message (PV or other, see Fig. 3.45) is continuously broadcast by the slave until the master instructs the slave to do otherwise. Data update rates of 3–4 per second are typical with “burst” mode communication and will vary with the chosen command. Please note that the “Burst” mode should be used only in single slave device networks. Two masters (primary and secondary) can communicate with slave devices in a HART network. Secondary masters, such as hand-held communicators, can be connected almost anywhere on the network and communicate with field devices without disturbing communication with the primary master. A primary master is typically a PLC, or computer based central control or monitoring system. A typical installation with two masters is shown in Fig. 3.33 and Fig. 3.44. From an installation perspective, the same wiring used for conventional 4–20 mA analog instruments carries the HART communication signals. Allowable cable run lengths will vary with the type of cable and the devices connected, but in general up to 3000 m for a single twisted pair cable with shield and 1500 m for multiple twisted pair cables with a common shield. Unshielded cables can be used for short distances. Intrinsic safety barriers and isolators which pass the HART signals are readily available for use in hazardous areas. The HART protocol also has the capability to connect multiple field devices on the same pair of wires in a multiple-dropped network configuration as shown in Fig. 3.33(b). In multiple-dropped networks, communication is limited to master–slave digital only. The current through each slave device is fixed at a minimum value to power the device (typically 4 mA) and no longer has any meaning relative to the process. The HART protocol utilizes the OSI 7-layer reference model. As is the case for most of the communication systems on the field level, the HART Zhang_Ch03.indd 407 5/13/2008 5:41:44 PM 408 INDUSTRIAL CONTROL TECHNOLOGY protocol implements only the layers 1, 2, and 7 of the OSI model. The layers 3–6 remain empty since their services are either not required or provided by the Application Layer 7 (see Fig. 3.47). The Application Layer defines the commands, responses, data types, and status reporting supported by the protocol. In addition, there are certain conventions in HART (e.g., how to trim the network current) that are also considered part of the Application Layer. While the Command Summary, Common Tables, and Command Response Code Specifications all establish mandatory Application Layer practices (including data types, common definitions of data items, and procedures), the Universal Commands specify the minimum Application Layer content of all HARTcompatible devices. OSI layer Function HART layer Application layer Provides the user with network capable applications Command oriented. Predefined data types and application procedures Presentation layer Converts application data between network and local machine formats Connection management service for applications Session layer Transport layer Provides network Autosegmented transfer of large datasets, independent, transport reliable stream transport, negotiated message transfer segment sizes. Network layer End to end routing of packets. Resolving network addresses Data Link layer Establishes data packet structure, framing, error detection, bus arbitration. Mechanical/electrical connection. Transmits raw bit stream Physical layer A binary, byteoriented, token passing, master– slave protocol Simultaneous analog and digital signaling, normal 4–20 mA copper wiring. Wired HART Power-optimized, redundant path, selfhealing wireless mesh network Secure and reliable, time synched TDMA/CSMA, frequency agile with ARQ 2.4 Hz wireless, 802.15.4 based radios, 10 dBm T × power Wireless HART Figure 3.47 HART protocol implementing the OSI 7-layer model. Zhang_Ch03.indd 408 5/13/2008 5:41:44 PM 409 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 3.4.3.2 HART Protocol Commands In the communication routines of the application layer of the HART protocol, the master devices and operating programs are based on HART commands to give instructions or send messages plus data to a field device. Once receiving the command message, the field devices immediately process it and then respond by sending back a response message which can contain requested status reports and/or the data of the field device. Table 3.9 provides the classes of the HART commands, and Table 3.10 gives a summary of the HART commands. Figure 3.48 is the standard format of both the HART command and response messages. In accordance with the HART command specification, this format includes the following: (1) First, the preamble, of between 5 and 20 bytes of hex FF (all 1s), helps the receiver to synchronize to the character stream. Table 3.9 HART Commands Classes Universal Commands All devices using the HART protocol must recognize and support the universal commands. Universal commands provide access to information useful in normal operations. For example, read primary variable and units, read manufacturer and device type, read current output and percentage of range, and read sensor serial number and limits Zhang_Ch03.indd 409 Command Practice Commands Device-Specific Commands Common practice commands provide functions implemented by many, but not necessarily all, HART communication devices. The HART specifications recommend devices to support these commands when applicable. Examples of common practice commands are read a selection of up to four dynamic variables, write damping time constant, write transmitter range, set fixed output current and perform self-test Device-specific commands represent functions that are unique to each field device. These commands access setup and calibration information as well as information about the construction of the device. Information on device-specific commands is available from device manufacturers or in the Field Device Specification document. Examples of devicespecific commands are read or write sensor type; start, stop, or clear totalizer; read or write alarm relay set point; etc. 5/13/2008 5:41:45 PM 410 INDUSTRIAL CONTROL TECHNOLOGY Table 3.10 HART Commands Summary Universal Commands Command Practice Commands Device-Specific Commands (Example) Read manufacturer and device type Read primary variable (PV) and units Read current output and percentage of range Read up to four predefined dynamic variables Read or write 8-character tag, 16-character descriptor, date Read or write 32character message Read device range values, units, and damping time constant Read or write final assembly number Write polling address Read selection of up to four dynamic variables Write damping time constant Write device range values Calibrate (set zero, set span) Set fixed output current Perform self-test Perform master reset Trim PV zero Write PV unit Trim DAC zero and gain Write transfer function (square root/linear) Write sensor serial number Read or write dynamic variable assignments Read or write lowflow cut-off Start, stop, or clear totalizer Read or write density calibration factor Choose PV (mass, flow, or density) Read or write materials or construction information Trim sensor calibration PID enable Write PID set point Valve characterization Valve set point Travel limits User units Local display information PREAMBLE START ADDR COMM BCNT [STATUS] [DATA] CHK Preamble: 5 to 20 bytes, hex FF Start character: 1 byte Addresses: source and destination, 1 or 5 bytes Command: 1 byte Byte count (of status and data): 1 byte Status: 2 bytes, only in slave response Data: 0 to 25 bytes* Checksum: 1 byte *25 bytes is a recommended maximum data length The maximum number of data bytes is not defined by the protocol specifications. Figure 3.48 The standard format of the HART protocol command and response frames. Zhang_Ch03.indd 410 5/13/2008 5:41:45 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 411 (2) The start character may have one of several values, indicating the type of message: master to slave, slave to master, or burst message from slave; also the address format: short frame or long frame. (3) The address field includes both the master address (a single bit: 1 for a primary master, 0 for a secondary master) and the slave address. In the short frame format, the slave address is 4 bits containing the “polling address” (0–15). In the long frame format, it is 38 bits containing a “unique identifier” for that particular device. (One bit is also used to indicate if a slave is in burst mode.) (4) The command byte contains the HART command for this message. Universal commands are in the range 0–30; commonpractice commands are in the range 32–126; device-specific commands are in the range from 128 to 253. (5) The byte count byte contains the number of bytes to follow in the status and data bytes. The receiver uses this to know when the message is complete. (There is no special “end of message” character.) (6) The status field (also known as the “response code”) is two bytes, only present in the response message from a slave. It contains information about communication errors in the outgoing message, the status of the received command, and the status of the device itself. (7) The data field may or may not be present, depending on the particular command. A maximum length of 25 bytes is recommended, to keep the overall message duration reasonable. (But some devices have device-specific commands using longer data fields.) See also the HART data field. (8) Finally, the checksum byte contains an “exclusive-OR” or “longitudinal parity” of all previous bytes (from the start character onward). Together with the parity bit attached to each byte, this is used to detect communication errors. 3.4.3.3 HART Protocol Data (1) HART data. There are several types of data or information that can be communicated from a HART-compatible device. This includes: (a) Device data (b) Supplier data (c) Measurement data (d) Calibration data. Zhang_Ch03.indd 411 5/13/2008 5:41:45 PM 412 INDUSTRIAL CONTROL TECHNOLOGY The following is a summary of these data items available for communication between HART-compatible devices and a Host. (a) Process variable values. (i) Primary process variable (analog): 4–20 mA current signals continuously transmitted to host. (ii) Primary process variable (digital): Digital value in engineering units, IEEE floating point, up to 24-bit resolution. (iii) Percent range: Primary process variable expressed as percent of calibrated range. (iv) Loop current: Loop current value in milliamps. (v) Secondary process variable 1: Digital value in engineering units available from multivariable devices. (vi) Secondary process variable 2: Digital value in engineering units available from multivariable devices (vii) Secondary process variable 3: Digital value in engineering units available from multivariable devices (b) Commands from host to device. (i) Set primary variable units (ii) Set upper range (iii) Set lower range (iv) Set damping value (v) Set message (vi) Set tag (vii) Set date (viii) Set descriptor (ix) Perform loop test: Force loop current to specific value (x) Initiate self-test: Start device self-test (xi) Get more status available information. (c) Status and diagnostic alerts. (i) Device malfunction: Indicates device self-diagnostic has detected a problem in device operation. (ii) Configuration changed: Indicates device configuration has been changed. (iii) Cold start: Indicates device has gone through power cycle. (iv) More status available: Indicates additional device status data available. (v) Primary variable analog output fixed: Indicates device in fixed current mode. (vi) Primary variable analog output saturated: Indicates 4–20 mA signal is saturated. (vii) Secondary variable out of limits: Indicates secondary variable value outside the sensor limits. Zhang_Ch03.indd 412 5/13/2008 5:41:45 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 413 (viii) Primary variable out of limits: Indicates primary variable value outside the sensor limits. (d) Device identification. (i) Instrument tag: User defined, up to 8 characters. (ii) Descriptor: User defined, up to 16 characters. (iii) Manufacturer name (code): Code established by HCF and set by manufacturer. (iv) Device type and revision: Set by manufacturer. (v) Device serial number: Set by manufacturer. (vi) Sensor serial number: Set by manufacturer. (e) Calibration information for 4–20 mA transmission of primary process variable. (i) Date: Date of last calibration, set by user. (ii) Upper range value: Primary variable value in engineering units for 20 mA point that is set by user. (iii) Lower range value: Primary variable value in engineering units for 4 mA point that is set by user. (iv) Upper sensor limit: Set by manufacturer. (v) Lower sensor limit: Set by manufacturer. (vi) Sensor minimum span: Set by manufacturer. (vii) PV damping: Primary process variable damping factor, set by user. (viii) Message: Scratch pad message area (32 characters), set by user. (ix) Loop current transfer function: Relationship between primary variable digital value and 4–20 mA current signal. (x) Loop current alarm action: Loop current action on device failure (upscale/downscale). (xi) Write protect status: Device write-protect indicator. (2) DDL device description. The HART commands in the application layer are based on the services of the lower layers and enable an open communication between the master and the field devices. All the HART-compatible devices, no matter their manufacturers, are capable for this openness and intercommunications as long as the field devices operate exclusively with the universal and common-practice commands. In a HART-enabled system, the user does not need more than the simple HART standard notation for the status and fault messages. When the user wants the message to contain further devicerelated information or that special properties of a field device are also used, the common-practice and universal commands are not sufficient. Using and interpreting the data requires that the user know their meaning. However, this knowledge is not available in Zhang_Ch03.indd 413 5/13/2008 5:41:45 PM 414 INDUSTRIAL CONTROL TECHNOLOGY further extending systems which can integrate new components with additional options. To eliminate the adaptation of the master device’s software whenever an additional status message is included or a new component is installed, the device description language (DDL) was accordingly developed. The DDL is not limited to the HART applications. It was developed and specified for all the Fieldbus, independent of the HART protocol, by the Human–Machine Interface workshop of the International Fieldbus Group (IFG). The developers of the device description language (DDL) aimed at achieving versatile usability. The DDL also finds use in field networks. The required flexibility is ensured insofar as the DDL does not itself determine the number and functions of the device interfaces and their representation in the control stations. The DDL is simply a language, similar to a programming language, which enables the device manufacturers to describe all communication options in an exact and complete manner. The DDL allows the manufacturer to describe (a) attributes and additional information on communication data elements, (b) all operating states of the device, (c) all device commands and parameters, (d) the menu structure, thus providing a clear representation of all operating and functional features of the device. Having the device description of a field device and being able to interpret it, a master device is equipped with all necessary information to make use of the complete performance features of the field device. Device-specific and manufacturer-specific commands can also be executed and the user is provided with a universally applicable and uniform user interface, enabling him or her to clearly represent and perform all device functions. Thanks to this additional information, clear, exact and, hence, safer operation and monitoring of a process is made possible. The master device does not read the device description as readable text in DDL syntax, but as short, binary-coded Device Description data record specially generated by the DDL encoder (or DDL compiler). For devices with sufficient storage capacity, this short form opens up the possibility of storing the device description already in the firmware of the field device. During the parameterization phase, it can be read by the corresponding master device. Zhang_Ch03.indd 414 5/13/2008 5:41:45 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 415 3.4.4 HART Integration 3.4.4.1 Basic Industrial Field Networks There are many different field networks available in industrial control for instrument engineers today. Understanding these networks’ classifications should allow us to choose the right tools for the control applications. Some common industrial communication protocols will be introduced below by focusing on the native applications and placing them in three basic categories: (1) Sensor networks are those protocols initially designed to support discrete I/O. (2) Device networks are those protocols originally focused on process instrumentation. (3) Control networks are those protocols typically used to connect controllers and I/O systems. (1) Sensor networks. Sensor level protocols, with a principal focus on supporting the digital communications for those discrete sensors and actuators. Sensor level protocols tend to have very fast cycle times and, since they are often promoted as an alternative to PLC discrete I/O, the cost of a network node should be relatively low. These protocols listed below are the simplest forms of sensor networks available today. (a) AS-i. AS-i acts as a network-based replacement for a discrete I/O card. Consequently, AS-i offers perhaps the simplest network around consisting of up to 31 slave devices with 248 I/O bits and the following functionality: (1) the master polls each slave, (2) the master message contains four output bits, (3) the slave answers immediately with four input bits, 4) diagnostics are included in each message, (5) a worst-case scan time of less than 5 ms. (b) CAN. The Controller Area Network (CAN) defines only basic, low level signaling and medium access specifications which are both simple and unique. Even though CAN medium access is technically CSMA/CD, this classification can provide simple, highly reliable, prioritized communication between intelligent devices, sensors, and actuators in automotive applications. Of these advantages, reliability is paramount. Network errors while driving a car on a busy interstate highway are unacceptable. Today, CAN is used in a vast number of vehicles and in a variety of other applications. Zhang_Ch03.indd 415 5/13/2008 5:41:45 PM 416 INDUSTRIAL CONTROL TECHNOLOGY As a result: (1) a large number of different chips and vendors support CAN, 2) the total chip volume is huge, 3) the parts cost is small. (c) DeviceNet. DeviceNet is a well-established machine and manufacturing automation network supported by a substantial number of products and vendors in the semiconductor industry. DeviceNet specifies physical (connectors, network terminators, power distribution, and wiring) and application layer operation based on the CAN standard. While all the popular application layer hierarchies are supported (client and server, master and slave, peer-to-peer, publisher and subscriber), in practice most devices support only master– slave operation which results in significantly lower costs. In comparison with the CAN, DeviceNet provides configurable structure to the operation of the network, allowing for the selection of polled, cyclic, or event driven network operation. (d) Interbus. Interbus is a popular industrial network that uses a ring topology in which each slave has an input and an output connector. Interbus is one of the few protocols that are full duplex-data transmitted and received at the same time. Interbus communication is cyclical, efficient, fast, and deterministic (e.g., 4096 digital inputs and outputs scanned in 14 ms). Of the ring topology, Interbus commissioning offers us these advantages: (1) Node addresses are not required because the master can automatically identify the nodes on the network. (2) Slaves provide identification information that allows the master to determine the quantity of the data provided by the slave. (3) Using this data, the master explicitly maps the data to and from the slave into the bit stream as it shifts through the network. Interbus works as a large network-based shift register in which a bus cycle begins with the network master transmitting a bit stream. As the first slave receives the bits, they are echoed passing the data on to the next slave in the ring. This process is simultaneous with the data being shifted from the master to the first slave. In turn, the data from the first slave is then being shifted into the master. (2) Device networks. Device network protocols support process automation that is fundamentally continuous and analog, more complex transmitters, and valve-actuators. Transmitters typically include pressure, level, flow, and temperature. The valve-actuators can include those intelligent controllers, motorized valves, and pneumatic positioners. Three device networks are prevalent in Zhang_Ch03.indd 416 5/13/2008 5:41:45 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 417 the process automation industry: Foundation Fieldbus H1, HART, and PROFIBUS-PA. (a) Foundation Fieldbus H1. In August 1996, the Foundation Fieldbus released its H1 Specifications that focus on “the network is the control system.” Of the fundamental differences from the controller and I/O approach used in traditional systems, Foundation Fieldbus specifies not only a communication network but also control functions. As a result, the purpose of the communications is to pass data to facilitate proper operation of the distributed control application. Its success relies on synchronized cyclical communication and on a well-defined applications layer. In the Foundation Fieldbus H1, communications occur within framed intervals of fixed time duration (a fixed repetition rate) and are divided into two phases and scheduled cyclical data exchange and acyclic (e.g., configuration and diagnostics) communication. The communication is controlled by polling the network and thereby prompting the process data to be placed on the bus. This is done by passing a special token to grant the bus to the appropriate device, resulting in the cyclic data being generated at regular intervals. In the Foundation Fieldbus H1 networks, the application layer defines function blocks, which include analog in, analog out, transducer, and the blocks. The data on the network is the transfer from one function block to another in the network-based control system. The data is complex and includes the digital value, engineering units, and status on the data (to indicate the PID is manual or the measured value is suspect). (b) HART. HART is unique among device networks because it is fundamentally an analog communications protocol. All the other protocols use digital signaling, while HART uses modulated communications because the “HART digital communications” modulate analog signals centered in a frequency band separated from the 4–20 mA signaling. HART enhances smart 4–20 mA field devices by providing two-way communication that is backward compatible with existing installations, which allows HART to support two communications channels simultaneously: a one-way channel carrying a single process value (the 4–20 mA signal) and a bidirectional channel to communicate digital process values, status, and diagnostics. Consequently, the HART protocol can be used in traditional 4–20 mA applications, and allows the benefits of digital communication to be realized in existing plant installations. Zhang_Ch03.indd 417 5/13/2008 5:41:45 PM 418 INDUSTRIAL CONTROL TECHNOLOGY HART is a simple, easy-to-use protocol because of these facts: (1) Two masters are supported using token passing to provide bus arbitration. (2) Allows a field device to publish process data (“burst mode”). (3) Cyclical process data includes floating-point digital value, engineering units, and status. (4) Operating procedures standardized (for current loop reranging, loop test, and transducer calibration). (5) Standardized identification and diagnostics provided. (c) PROFIBUS-PA. PROFIBUS-PA (process automation) was introduced to extend PROFIBUS-DP (decentralized peripherals) in order to support process automation. PROFIBUS-PA, which operates over the same H1 physical layer as Foundation Fieldbus H1, is essentially an LAN for communication with process instruments. PROFIBUS-PA networks are fundamentally master–slave model, so sophisticated bus arbitration is not necessary. PROFIBUS-PA also defines profiles for common process instruments, including both mandatory and optional propertied (data items). When a field device supports a profile some configuration of the device should be possible without being device-specific. (3) Control networks. Control networks are focused on providing a communication backbone that allows integration of controllers, I/O, and subnetworks. Control networks stand at the crossroads between the growing capabilities of industrial networks and the penetration of enterprise networks into the control system. As such, the control networks are able to move huge chunks of heterogeneous data and operate at high data rates. A brief overview of these four control networks is given below; they are ControlNet, Industrial Ethernet, Ethernet/IP, and PROFIBUS-DP. (a) ControlNet. ControlNet was developed as a high performance network suitable for both manufacturing and process automation. ControlNet uses Time Division Multiple Access (TDMA) to control the access to the network, which means a network cycle is assigned a fixed repetition rate. Within the bus cycle, data items are assigned a fixed time division for transmission by the corresponding device. Data objects are placed on ControlNet within a designated time slot and at precise levels. Once the data to be published is identified along with its time slot, any device on the network can be configured to use the data. In the second half of a bus cycle, acyclic communications occur. ControlNet is more efficient than polled or token passing protocols because its data transmission is very deterministic. Zhang_Ch03.indd 418 5/13/2008 5:41:45 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 419 (b) Industrial Ethernet. Many industrial communication protocols specify mechanisms to embed their protocols in Ethernet. Ethernet addresses only the lower layers of communications networks, but does not address the meaning of the data it transports. Even though Ethernet effectively communicates many protocols simultaneously over the same wire, it provides no guarantees that the data can be exchanged between different protocols. In Industrial Ethernet, the protocol being adopted is TCP/ IP and not Ethernet at all. TCP/IP is using two approaches to support the session, presentation, and application layers of the corresponding industrial protocol. First, the industrial protocol is simply encapsulated in the TCP/IP, allowing the shortest development time for defining industrial protocol transportation over TCP/IP. The second approach actually maps the industrial protocol to TCP and UDP services. While this strategy takes more time and effort to develop, it results in a more complete implementation of the industrial protocol on top of the TCP/IP. UDP is a connectionless, unreliable communication service that works well for broadcasts to multiple recipients and fast, low-level signaling. UDP is used by several industrial protocols (for time synchronization). TCP is a connection oriented data stream that can be mapped to the data and I/O functions in some industrial protocols. (c) Ethernet/IP. Ethernet/IP is a mapping of the “Control and Information Protocol (CIP)” used in both ControlNet and DeviceNet to TCP/IP (not Ethernet). While all the basic functionality of ControlNet is supported, the hard real-time determinism that ControlNet offers is not present. CIP is being promoted as a common, object-oriented mechanism for supporting both manufacturing and process automation functions. Ethernet/IP is a good contribution to the growing discussion of Industrial Ethernet. However, Ethernet/IP is a recent development and is basically the application of an existing industrial network’s application layer to the TCP/IP. (d) PROFIBUS-DP. PROFIBUS-DP (Decentralized Peripherals) is a master–slave protocol used primarily to access remote I/O. Each node is polled cyclically updating the status and data associated with the node. Operation is relatively simple and fast. PROFIBUS-DP also supports Fieldbus Message Specification (FMS), which is a more complex protocol for demanding applications that includes support for multiple masters and peer-to-peer communication. Zhang_Ch03.indd 419 5/13/2008 5:41:46 PM 420 3.4.4.2 INDUSTRIAL CONTROL TECHNOLOGY Choosing the Right Field Networks Before choosing the best suitable network for an industrial control application, it is necessary to review all the open network types available today. By carefully reviewing each of these types of open communication networks, their respective strengths and weaknesses, in particular some important technical factors, ought to be understood. Please note that the specified application will be far more than the technology used. The specific, measurable benefits must drive this selection process. The first factor that should be considered is the cost of each network. The second is the network connectivity in which the bottom line is that you want your data. It is very important to remember that all communications networks cause changes. Although the actual changes can be very difficult to foretell accurately, the effect of these changes must be realistically considered. In some instances, we have to make a decision on choosing between the HART and other types of field networks. Before making such a decision, it is important to understand the differences between the HART and other field networks. For example, if all the choices are constrained between the HART and the Foundation Fieldbus, comparisons of these two types in every category are necessary. Table 3.11 is a list of the differences in elemental technical features between the HART and the Foundation Fieldbus, which should be a help in choosing between the HART and the Foundation Fieldbus. 3.4.4.3 Integrating the HART with Other Field Networks The integration of the HART network with the Foundation Fieldbus network is taken as an example here to demonstrate the strategies and techniques of integrating HART with other field networks. As mentioned above, one fundamental difference between HART and Fieldbus devices is that with Fieldbus devices, you can implement control strategies inside the field devices themselves; however, even if you can implement the same control strategies with HART devices, the execution of actual control algorithms would go on in the control system computer or PLC. A welldesigned control system will allow an integrated control strategy to use devices independent of communication protocol. HART and Fieldbus devices have the capability of providing a wide range of diagnostics data about the device’s safety. In fact, the diagnostic capabilities of HART and Fieldbus devices are nearly the same. The types of device diagnostics change widely, depending on the type of device. Measurement transmitters will have diagnostics related to the status of the Zhang_Ch03.indd 420 5/13/2008 5:41:46 PM 421 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL Table 3.11 A Comparison between HART and Foundation Fieldbus Feature Technology acceptance Power limitation Advances in silicon power consumption same for HART/FF; thus FF will always have capability for more functionality Communication performance Transmitter diagnostics Advanced diagnostics HART Foundation Fieldbus (FF) Well proven as Large Installed base Will continue to be sold as a replacement unit Simple for technicians’ competence 35 mW to 4 mA available for the HART signal Cannot “mirror” Fieldbus, however may provide an 80% solution Proven as Growing Installed base Training required New investment to occur increasingly in the FF 100 bits/s Additional burden on host Device only Includes predictive No knowledge of other devices Does not have the processing power Push or poll Polled for HART status periodically Status can be missed Two-way communication to other devices Multiple-dropped No Use in safety instrumented systems Very limited Theory 15 devices: real around 3 slow series loop All devices wired individually FF minimum power requirement of 8 mA No spec limit; Ultimate FF segment power budget FF devices order of more magnitude than that powering an Event for IS FF H1 communicates at 31250 bits/s Device + other devices For example, Statistical Process Monitoring and Machinery Health monitoring Events are latched/time stamped in the device Sent by the device There is no chance of missing field problems with FF Yes True multiple-dropped: physically 32 devices realistically 12−16 Devices 2007 offers the holding back technology (Continued) Zhang_Ch03.indd 421 5/13/2008 5:41:46 PM 422 INDUSTRIAL CONTROL TECHNOLOGY Table 3.11 (Continued) Feature HART Foundation Fieldbus (FF) Control in the field and advanced applications Does not support the function block model Multiple variables In digital mode only It is limited No Function block model supports interoperable control in the field where blocks can reside in the field device Yes Footprint and hardware reduction Future proof devices—typical upgrade capability In the field No Full specifications in the devices No Commissioning speed Hours for individually wired devices Renders obsolete all separate signal conditioners, isolation amplifier cards, output cards, CPU cards, I/P converters, etc. Ability to download new version of firmware over H1 link None disconnected device from the H1 segment Communicate with this devices conformant with Fieldbus specification Embedded at the factory Travels with the instrument Upload directly to “Smart Instrument” software Reduces commissioning time Reduces time to perform diagnostics The networking capability of FF allows the user to commission a device in 10 s of seconds transducer and measurement logic in the device. Control devices such as valves will provide a lot of information about the mechanical condition of the device. Both transmitters and valves will provide diagnostic information about the communication electronics in their respective devices. Zhang_Ch03.indd 422 5/13/2008 5:41:46 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 423 Although the diagnostic data provided by HART and Fieldbus is very similar, the way they get to the control system and the way they get to the operator or technician to see it can be quite different. This has to do with the speed and characteristics of the communication technology used by these two protocols. Fieldbus basically uses point-to-point communication technology. This means when a Fieldbus device detects a diagnostics condition it wants to report, it can send an event out on the bus with the related information. The control system picks up the event and immediately displays or annunciates it on the console. HART devices, on the other hand, have to continually undergo polling to see if there is anything to report. Because the polling occurs at 1200 bps with HART, there are limitations on how many devices it can poll for alters in a specific time frame. An operator can poll a small number of critical devices for alters within seconds or a large number of devices within minutes. However, it is possible to implement an effective diagnostic alert system with HART as long as you understand the restrictions on response and device count. Once the operator or maintenance engineer is aware of a problem in a filed device either through an alert or some other means, the actual display of the status information from HART and Fieldbus devices is very similar. Usually, a record of this status event will automatically log into the control system. The logging of HART and Fieldbus device problems should normally look the same on a well-integrated system. The type of portable maintenance tools required in systems of HART and Fieldbus devices is also an important factor for consideration. Portable tools currently fall into two general categories. The first is intrinsically safe hand-held devices. Several are available for HART only devices. A combined HART and Fieldbus intrinsically hand-held device has become available, too. This integrated tool allows the user to configure and diagnose HART and Fieldbus devices while in the field. The laptop computer is the second type of portable tool. However, these types of computers cannot go in hazardous areas of a plant. As far as small hand-held computers go, how practical these will be in a plant environment remains an open question. Bibliography Alan R. Dewey in EMERSON. 2005. HART, Fieldbus Work Together in Integrated Environment. http://www.emersonprocess.com/home/library/articles/protocol/ protocol0507_teamwork.pdf. Accessed date: October 2007. Analog Services, Inc. (http://www.analogservices.com). 2006. HART Book. http:// www.analogservices.com/about_part0.htm. Accessed date: October 2007. Zhang_Ch03.indd 423 5/13/2008 5:41:46 PM 424 INDUSTRIAL CONTROL TECHNOLOGY AS-INTERFACE (http://www.as-interface.net). 2007a. AS-Interface System. http://www.as-interface.net/System/. Accessed date: May. AS-INTERFACE (http://www.as-interface.net). 2007b. AS-Interface Products. http://www.as-interface.net/Products/. Accessed date: May. CiA (http://www.can-cia.org). 2005a. Registered Free Download; CAN Physical Layer Specification Version 2.0. http://www.can-cia.org/downloads/ ciaspecifications/?557. Accessed date: July. CiA (http://www.can-cia.org). 2005b. Registered Free Download; CAN Application Layer Specification Version 1.1. http://www.can-cia.org/ downloads/ciaspecifications/?1169. Accessed date: July. CiA (http://www.can-cia.org). 2005c. Registered Free Download; CANopen Specification Version 1.3. http://www.can-cia.org/downloads/ciaspeci fications/?1136. Accessed date: July. Commfront (http://www.commfront.com). 2007. RS232, 485,422,530 Buses. http://www.commfront.com/CommFront-Home.htm. Accessed date: July. Cyber (http://cyber.felk.cvut.cz). 2006. Supervisory Human Operation. http:// cyber.felk.cvut.cz/gerstner/biolab/bio_web/projects/iga2002/index.html. Accessed date: October. David Belohrad and Miroslav Kasal. 1999. FSK Modem with GALs. http:// www.isibrno.cz/~belohrad/radioelektronika99-fskmodem.pdf. Accessed date: October 2007. Degani, Asaf, Shafto, Michael, Kirlik, Alex. 2006. Modes in Human–Machine Systems: Review, Classification, and Application. http://ic-www.arc.nasa .gov/people/asaf/interface_design/pdf/Modes%20in%20Human-Machine %20Systems.pdf. Accessed date: October. Degani, Asaf. 2006. Modeling Human–Machine Systems: On Modes, Error, and Patterns of Interaction. http://ase.arc.nasa.gov/people/asaf/hai/pdf/Degani_ Thesis.pdf. Accessed date: October. ESD-Electronics (http://www.esd-electronics.com). 2005. Controller Area Network. http://www.esd-electronics.com/german/PDF-file/CAN/Englisch/intro-e .pdf. Accessed date: July. Fieldbus (http://www.fieldbus.org). 2005a. FOUNDATION Technology. http:// www.fieldbus.org/index.php?option=com_content&task=view&id=45&Ite mid=195. Accessed date: July. Fieldbus (http://www.fieldbus.org). 2005b. Profibus Technology. http://www .pepperl-fuchs.com/pa/interbtob/profibus/default_e.html. Accessed date: July. Fieldbus Centre (http://www.knowthebus.org). 2005a. FOUNDATION Fieldbus. http://www.knowthebus.org/fieldbus/foundation.asp. Accessed date: July. Fuji Electric (http://web1.fujielectric.co.jp). 2007. Fuji AS-I Technologies. http://www.fujielectric.co.jp/fcs/eng/as-interface/as_i/index.html. Accessed date: May. Grid Connect (http://www.industrialethernet.com). 2005. Industrial Ethernet. http://www.industrialethernet.com/etad.html. Accessed date: July. Groover, Mikell P. 2001. Automation, Production Systems, and ComputerIntegrated Manufacturing. Second Edition. New Jersey: Prentice Hall. H. Kirrmann in ABB Research Center of Switzerland. 2006. The HART Protocol. AI_411_HART.ppt. Accessed date: October 2007. Zhang_Ch03.indd 424 5/13/2008 5:41:46 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 425 Hardware Secrets (http://www.hardwaresecrets.com). 2007a. PCI Bus Tutorial. http://www.hardwaresecrets.com/article/190. Accessed date: May. Hardware Secrets (http://www.hardwaresecrets.com). 2007b. AGP Bus Tutorial. http://www.hardwaresecrets.com/article/155. Accessed date: July. Harris, Don. 2006. Human–Machine Interaction. http://www.cranfield.ac.uk/soe/ postgraduate/hf_module9.htm. Accessed date: October. HCF (HART Communication Foundation). 2007. HCF—Main Pages. http://www .hartcomm2.org/index.html. Accessed date: October. HIT (http://www.hit.bme.hu). 2007. GPIB Tutorial. http://www.hit.bme.hu/~papay/ edu/GPIB/tutor.htm. Accessed date: July. HMS Industrial Networking (http://www.anybus.com). 2005a. AS-Interface Technologies. http://www.anybus.com/technologies/asi.shtml. Accessed date: July. HMS Industrial Networking (http://www.anybus.com). 2005b. AS-Interface Products. http://www.anybus.com/products/asinterface.shtml. Accessed date: July. HMS Industrial Networking (http://www.anybus.com). 2005c. Interbus Connectivity: http://www.anybus.com/products/interbus.shtml?gclid=CLXtoK7UjY wCFT4GQgod3T_GBw. Accessed date: July. Honey Well (http://hpsweb.honeywell.com). 2005a. http://hpsweb.honeywell.com/ Cultures/en-US/Products/Systems/ExperionPKS/FoundationFieldbus Integration/default.htm. Accessed date: July. Honey Well (http://hpsweb.honeywell.com). 2007. Wireless HART. http://hpsweb .honeywell.com/Cultures/en-US/Products/wireless/SecondGeneration Wireless/default.htm. Accessed date: October. IBM (http://www.ibm.com/us). 2005. IDE Subsystem. http://publib.boulder.ibm .com/infocenter/pseries/v5r3/index.jsp?topic=/com.ibm.aix.kernelext/doc/ kernextc/ide_subsys.htm. Accessed date: May. Interbus Club (http://www.interbusclub.com). 2005a. Interbus Technology. http:// www.interbusclub.com/en/index.html. Accessed date: July. Interbus Training in Web (http://pl.et.fh-duesseldorf.de/prak/prake/index.asp). 2007. Interbus Basic. http://pl.et.fh-duesseldorf.de/prak/prake/download/IBS_ grundlagen.pdf. Accessed date: May. Interface Bus (http://www.interfacebus.com). 2005a. PCI Bus Pins. http://www .interfacebus.com/Design_PCI_Pinout.html. Accessed date: May. Interface Bus (http://www.interfacebus.com). 2005b. PCMCIA 16 bits Bus. http:// www.interfacebus.com/Design_Connector_PCMCIA.html. Accessed date: May. Interface Bus (http://www.interfacebus.com). 2005c. RS-485 Bus. http://www .interfacebus.com/Design_Connector_RS485.html. Accessed date: May. IO Tech (http://www.iotech.com). 2007. IEEE-488 Standard. http://www.iotech .com/an06.html. Accessed date: July. Israel, Johann Habakuk and Anja Naumann. 2006. http://useworld.net/ausgaben/ 4-2007/01-Israel_Naumann.pdf. Accessed date: October. IXXAT (http://www.ixxat.com). 2005. CAN Application Layer. http://www.ixxat .com/can_application_layer_introduction_en,7524,5873.html. Accessed date: July. Zhang_Ch03.indd 425 5/13/2008 5:41:46 PM 426 INDUSTRIAL CONTROL TECHNOLOGY Jaffe, David. 2006. Enhancing Human–Machine Interaction. http://ability.stanford .edu/Press/rehabman.pdf. Accessed date: October. Jim Russell. 2007. HART v Foundation Fieldbus. http://www.iceweb.com.au/ Instrument/FieldbusPapers/HART%20v%20FF%20PAPERfinal.pdf . Accessed date: October. Kenneth L. Holladay, P. E. in Southwest Research Institute of the USA. 1991. Calibrating HART Transmitters. http://www.transcat.com/PDF/Hart_ Transmitter_Calibration.pdf. Accessed date: October 2007. Kvaser (http://www.kvaser.com). 2005. Controller Area Network. http://www .kvaser.com/can/. Accessed date: July. Microchip (http://ww1.microchip.com). 2005a. CAN Basics. http://ww1 .microchip.com/downloads/en/AppNotes/00713a.pdf. Accessed date: July. Microchip (http://ww1.microchip.com). 2005b. CAN Physical Layer. http://ww1 .microchip.com/downloads/en/AppNotes/00228a.pdf. Accessed date: July. MOXA (http://www.moxa.com). 2005a. Industrial Ethernet Technologies. http:// www.moxa.com/Zones/Industrial_Ethernet/Tutorial.htm. Accessed date: July. MOXA (http://www.moxa.com). 2005b. Industrial Ethernet Products. http://www .moxa.com/product/Industrial_Ethernet_Switches.htm. Accessed date: July. Murray, Steven A. 2006. Human–Machine Interaction with Multiple Autonomous Sensors. http://www.spawar.navy.mil/robots/research/hmi/ifac.html. Accessed date: October. PC Guide (http://www.pcguide.com). 2005a. IDE Guide. http://www.pcguide .com/ref/hdd/if/ide/unstdIDE-c.html. Accessed date: May. PC Guide (http://www.pcguide.com). 2005b. SCSI Guide. http://www.pcguide .com/ref/hdd/if/scsi/. Accessed date: May. PEPPERL + FUCHS (http://www.am.pepperl-fuchs.com). 2007. HART Multiplexers. http://www.am.pepperl-fuchs.com/products/productsubfamily .jsp?division=PA&productsubfamily_id=1343. Accessed date: October. PEPPERL+FUCHS (http://www.am.pepperl-fuchs.com). 2005a. AS-Interface. http://www.pepperl-fuchs.com/cgi-bin/site_search.pl. Accessed date: July. PEPPERL+FUCHS (http://www.am.pepperl-fuchs.com). 2005b. Fieldbus Technology; Foundation Fieldbus: AS-Interface. http://www.pepperl-fuchs .com/pa/interbtob/communication/default_e.html. Accessed date: July. PHM (http://www.phm.lu). 2007. IDE Pins Out. http://www.phm.lu/Documenta tion/Connectors/IDE.asp. Accessed date: May. PROFIBUS (http://www.profibus.com). 2005a. Profibus Technical Description. http://www.profibus.com/pb/technology/description/. Accessed date: July. PROFIBUS (http://www.profibus.com). 2005b. Profibus Specification. http://www .profibus.com/pall/meta/downloads/. Accessed date: July. QSI (http://www.qsicorp.com). 2006. Human–Machine Interface Devices. http:// www.qsicorp.com/product/industrial/?gclid=CK-apKS1l4wCFSQHE god6iqP5w. Accessed date: October. Quatech (http://www.quatech.com). 2005. ISA Bus Overviews. http://www.quatech .com/support/comm-over-isa.php. Accessed date: July. Samson (http://www.samson.de). 2005. FOUNDATION Fieldbus Technical Information. http://www.samson.de/pdf_en/l454en.pdf. Accessed date: July. SAMSON. 2005. SAMSON Technical Information—HART Communications. http://www.samson.de/pdf_en/l452en.pdf. Accessed date: October 2007. Zhang_Ch03.indd 426 5/13/2008 5:41:46 PM 3: SYSTEM INTERFACES FOR INDUSTRIAL CONTROL 427 Schneider-Electric (http://www.automation.schneider-electric.com). 2006. Human– Machine Interface. http://www.automation.schneider-electric.com/as-guide/ EN/pdf_files/asg-8-human-machine-interface.pdf. Accessed date: October. SCSI Library (http://www.scsilibrary.com). 2005. SCSI. http://www.scsilibrary .com. Accessed date: May. Semiconductors (http://www.semiconductors.bosch.de). 2005. CAN Specifications. http://www.semiconductors.bosch.de/pdf/can2spec.pdf. Accessed date: July. SIEMENS (http://www.automation.siemens.com). 2005a. Siemens AS-Interface Technologies. http://www.automation.siemens.com/cd/as-interface/html_76/ asisafe.htm. Accessed date: July. SIEMENS (http://www.automation.siemens.com). 2005b. Siemens AS-Interface Products. http://www.automation.siemens.com/infocenter/order_form.aspx? tab=3&nodekey=key_1994569&lang=en. Accessed date: July. SIEMENS (http://www.automation.siemens.com). 2005c. Siemens Profibus: http://www.automation.siemens.com/net/html_76/produkte/020_produkte.htm. Accessed date: July. SIEMENS (http://www.automation.siemens.com). 2005d. Industrial Ethernet Technologies and Products. http://www.automation.siemens.com/net/html_76/ produkte/040_produkte.htm. Accessed date: July. Simons, C. L. and Parmee, L. C. 2006. Human–Machine Interaction Software Design. http://www.ip-cc.org.uk/INTREP-COINT-SIMONS-2006.pdf. Accessed date: October. SMAR International Corporation (http://www.smar.com). 2006. HART Tutorial. http://www.smar.com/PDFs/Catalogues/Hart_Tutorial.pdf. Accessed date: October 2007. Softing (http://www.softing.com). 2005a. FOUNDATION Fieldbus. http://www .softing.com/home/en/industrial-automation/products/foundation-fieldbus/ index.php. Accessed date: July. Softing (http://www.softing.com). 2005b. Profibus. http://www.softing.com/home/ en/industrial-automation/products/profibus-dp/index.php?navanchor= 3010004. Accessed date: July. Tech Soft (http://www.techsoft.de). 2007. IEEEE-488 Tutorial. http://www .techsoft.de/htbasic/tutgpibm.htm?tutgpib.htm. Accessed date: July. Techfest (http://www.techfest.com). 2005. ISA Bus Technology. http://www .techfest.com/hardware/bus/isa.htm. Accessed date: July. Texas Instruments (http://sparc.feri.uni-mb.si). 2005. CAN Introduction. http:// sparc.feri.uni-mb.si/Sistemidaljvodenja/Vaje/pdf/Inroduction%20to%20 CAN.pdf. Accessed date: July. The UK AS-i Expert Alliance (http://www.as-interface.com). 2007a. AS-Interface Technologies. http://www.as-interface.com/asitech.asp. Accessed date: May. The UK AS-i Expert Alliance (http://www.as-interface.com). 2007b. AS-Interface Products. http://www.as-interface.com/asi_literature.asp. Accessed date: May. Vector Germany (http://www.can-solutions.com). 2005. CAN Mechanism. http:// www.can-solutions.com/?gclid=CLWxnai6jIwCFQrlQgodnx3gBg.Accessed date: July. YOKOGAWA (http://www.yokogawa.com). 2007. HART Communicator. http:// www.yokogawa.com/us/mi/MetersandInstruments/us-ykgw-yhcypc.htm. Accessed date: October. Zhang_Ch03.indd 427 5/13/2008 5:41:46 PM Zhang_Ch03.indd 428 5/13/2008 5:41:46 PM 4 Digital Controllers for Industrial Control 4.1 Industrial Intelligent Controllers 4.1.1 Programmable Logic Control (PLC) Controllers The development of Programmable Logic Controllers (PLCs) was driven primarily by the requirements of automobile manufacturers who constantly changed their production line control systems to accommodate their new car models. In the past, this required extensive rewiring of banks of relays—a very expensive procedure. In the 1970s, with the emergence of solid-state electronic logic devices, several auto companies challenged control manufacturers to develop a means of changing control logic without the need to rewire the system totally. The PLC evolved from this requirement. The PLCs are designed to be relatively “user-friendly” so that electricians can easily make the transition from all-relay control to electronic systems. They give users the capability of displaying and troubleshooting ladder logic that shows the logic in real time. The logic can be “rewired” (programmed) and tested, without the need to assemble and rewire banks of relays. A PLC is a computer with a single mission. It usually lacks a monitor, a keyboard, and a mouse, as it is programmed normally to operate a machine or a system using but one program. The machine or system user rarely, if ever, interacts directly with the PLC’s program. When it is necessary to either edit or create the PLC program, a personal computer is usually (but not always) connected to it. The information from the PLCs can be accessed by supervisory control and data acquisition (SCADA) systems and Human–Machine Interfaces (HMIs), to provide a graphical representation of the status of the plant. Figure 4.1 is a schematic of the PLC’s control network resident in industrial systems. 4.1.1.1 Components and Architectures PLC is actually an industrial microcontroller system (in more recent years we meet microprocessors instead of microcontrollers) where you have hardware and software specifically adapted to industrial environment. Block schema with typical components that a PLC consists of is found in Fig. 4.2. Special attention needs to be given to input and output, because 429 Zhang_Ch04.indd 429 5/13/2008 5:50:42 PM 430 INDUSTRIAL CONTROL TECHNOLOGY SCADA system Industrial network (High level) Other part of factory Industrial network (Middle level) Local PC Visual and sound signals Central PLC controller Local PLC controller Input sensing devices Output load devices Local process control system Figure 4.1 Schematic of the PLC control network. Screw terminals for input lines PLC controller Input port interface Power supply Communi cation PC for programming Extension interface Memories CPU Internal buses Output port interface Screw terminals for output lines Figure 4.2 Basic elements of a PLC controller. Zhang_Ch04.indd 430 5/13/2008 5:50:42 PM 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL 431 most PLC models feature a vast assortment of interchangeable I/O modules that allow for convenient interfacing with virtually any kind of industrial or laboratory equipment. Program unit is usually a computer used for writing a program (often in ladder diagram). (1) Central Processing Unit (CPU). This unit contains the “brains” of the PLC. It is often referred to as a microprocessor or sequencer. The basic instruction set is a high-level program, installed in Read-Only Memory (ROM). The programmed logic is usually stored in Electrically Erasable Permanent Read-Only Memory (EEPROM). The CPU will save everything in memory, even after a power loss. Since it is “electrically erasable,” the logic can be edited or changed as the need arises. The programming device is connected to the CPU whenever the operator needs to monitor, troubleshoot, edit, or program the system, but it is not required during the normal running operations. (2) Memory. System memory (today mostly implemented in FLASH technology) is used by a PLC for a process control system. Aside from this operating system, it also contains a user program translated from a ladder diagram to a binary form. FLASH memory contents can be changed only in a case where the user program is being changed. PLC controllers were used earlier instead of FLASH memory and have had EPROM memory instead of FLASH memory that had to be erased with UV lamp and programmed on programmers. With the use of FLASH technology this process was greatly shortened. Reprogramming a program memory is done through a serial cable in a program for application development. User memory is divided into blocks having special functions. Some parts of a memory are used for storing input and output status. The real status of an input is stored either as “1” or as “0” in a specific memory bit. Each input or output has one corresponding bit in memory. Other parts of the memory are used to store variable contents for variables used in user programs. For example, timer value, or counter value would be stored in this part of the memory. PLC controller memory consists of several areas given in Table 4.1, some of these having predefined functions. (3) Communication board. Every brand of PLC has its own programming hardware. Sometimes it is a small hand-held device, which resembles an oversized calculator with a liquid crystal display (LCD). However, most of the times it is the computerbased programmers. Computer-based programmers typically use a special communication board, installed in an industrial terminal Zhang_Ch04.indd 431 5/13/2008 5:50:44 PM Zhang_Ch04.indd 432 Working area Output area Input area Timer/counter area LR area AR area HR area TR area SR area IR area Data Area IR 01000–IR 01915 (160 bits) IR 20000–IR 23115 (512 bits) SR23200–SR25515 (384 bits) TR 0–TR 7 (8 bits) IR 00000–IR 00915 (160 bits) Bit(s) HR 00–HR 19 HR0000–HR1915 (20 words) (320 bits) AR 00–AR 15 AR0000–AR1515 (16 words) (256 bits) LR 00–LR 15 LR0000–LR1515 (16 words) (256 bits) TC 000–TC 127 (timer/counter numbers) IR 010–IR 019 (10 words) IR 200–IR 231 (32 words) SR 232–SR 255 (24 words) – IR 000–IR 009 (10 words) Word(s) Table 4.1 Memory Structure of PLC Same numbers are used for both timers and counters 1:1 connection with another PC Temporary storage of ON/OFF states when jump takes place Data storage; these keep their states when power is off Special functions, such as flags and control bits Working bits that can be used freely in the program. They are commonly used as swap bits Special functions, such as flags and control bits These bits may be assigned to an external I/O connection. Some of these have direct output on screw terminal (e.g., IR000.00–IR000.05 and IR010.00–IR010.03 with CPM1A model) Function 432 INDUSTRIAL CONTROL TECHNOLOGY 5/13/2008 5:50:44 PM Zhang_Ch04.indd 433 PC setup Read only DM 6144–DM 6599 (456 words) DM 6600–DM 6655 (56 words) DM 0000–DM 0999 and DM 1022–DM 1023 (1002 words) DM 1000–DM 1021 (22 words) – – – – Storing various parameters for controlling the PC Data of DM area may be accessed only in word form. Words keep their contents after the power is off Part of the memory for storing the time and code of error that occurred. When not used for this purpose, they can be used as regular DM words for reading and writing. They cannot be changed from within the program Notes: 1. IR and LR bits, when not used to their purpose, may be used as working bits. 2. Contents of HR area, LR area, counter, and DM area for reading/writing are stored within backup condenser. On 25C, condenser keeps the memory contents for up to 20 days. 3. When accessing the current value of PV, TC numbers used for data have the form of word. When accessing the Completing flags, they are used as data bits. 4. Data from DM6144 to DM6655 must not be changed from within the program, but can be changed by a peripheral device. DM area Error writing Read/write 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL 433 5/13/2008 5:50:44 PM 434 INDUSTRIAL CONTROL TECHNOLOGY or personal computer, with the appropriate software program installed. Computer-based programming allows “offline” programming, where the programmers develop their logic, store it on a disk, and then “down-load” the program to the CPU at their convenience. In fact, it allows more than one programmer to develop different modules of the program. Programming can be done directly into the CPU if desired. When connected to the CPU the programmer can test the system, and watch the logic operate as each element is intensified in sequence on a cathode ray tube (CRT) when the system is running. Since a PLC can operate without having the programming device attached, one device can be used to service many separate PLC systems. (4) PLC controller inputs. Intelligence of an automated system depends largely on the ability of a PLC controller to read signals from different types of sensors and input devices. Keys, keyboards, and functional switches are a basis for human versus machine relationship. On the other hand, to detect a working piece, view a mechanism in motion, check pressure, or fluid level you need specific automatic devices such as proximity sensors, marginal switches, photoelectric sensors, level sensors, and so on. Thus, input signals can be logical (ON/OFF) or analog. Smaller PLC controllers usually only have digital input lines while larger ones also accept analog inputs through special units attached to a PLC controller. One of the most frequent analog signals is a current signal of 4–20 mA and millivolt voltage signal generated by various sensors. Sensors are usually used as inputs for PLCs. You can obtain sensors for different purposes. They can sense presence of some parts, measure temperature, pressure, or some other physical dimension, and so on (for instance, inductive sensors can register metal objects). Other devices also can serve as inputs to the PLC controller. Intelligent devices such as robots, video systems, and so forth often are capable of sending signals to PLC controller input modules (robot, for instance, can send a signal to PLC controller input as information when it has finished moving an object from one place to the other.) (5) PLC controller output. An industrial control system is incomplete if it is not connected with some output devices. Some of the most frequently used devices are motors, solenoids, relays, indicators, sound signalization, and so forth. By starting a motor, or a relay, PLC can manage or control a simple system such as a system for sorting products all the way up to complex systems such as a service system for positioning the head of a robotic machine. Zhang_Ch04.indd 434 5/13/2008 5:50:44 PM 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL 435 Output can be of analog or digital type. A digital output signal works as a switch; it connects and disconnects lines. Analog output is used to generate the analog signal (for instance, a motor whose speed is controlled by a voltage that corresponds to a desired speed). (6) Extension lines. Every PLC controller has a limited number of input/output lines. If needed, this number can be increased through certain additional modules by system extension through extension lines. Each module can contain extension both of input and output lines. Also, extension modules can have inputs and outputs of a different nature from those on the PLC controller (for instance, in case relay outputs are on a controller, transistor outputs can be on an extension module). PLC has input and output lines through which it is connected to a system it directs. This is a very important part of the story about PLC controllers because it directly influences what can be connected and how it can be connected to controller inputs or outputs. Two terms most frequently mentioned when discussing connections to inputs or outputs are “sinking” and “sourcing.” These two concepts are very important in connecting a PLC correctly with the external environment. The briefest definition of these two concepts would be Sinking = Common GND line (–) Sourcing = Common VCC line (+), The first thing that catches one’s eye is “+” and “–” supply DC supply. Inputs and outputs that are either sinking or sourcing can conduct electricity only in one direction, so they are only supplied with direct current. According to what we have discussed so far, each input or output has its own return line, so 5 inputs would need 10 screw terminals on a PLC controller housing. Instead, we use a system of connecting several inputs to one return line as in the following picture. These common lines are usually marked “COMM” on the PLC controller housing. (7) Power supply. Electrical supply is used in bringing electrical energy to a CPU. Most PLC controllers work either at 24 VDC or 220 VAC. On some PLC controllers, you will find electrical supply as a separate module. Those are usually bigger PLC controllers, while small and medium series already contain the supply module. The user has to determine how much current to take from the I/O module to ensure that the electrical supply provides the appropriate amount of current. Different types of modules use different amounts of electrical current. This electrical supply is usually not used to start external inputs or outputs. The user has to provide separate supplies in Zhang_Ch04.indd 435 5/13/2008 5:50:44 PM 436 INDUSTRIAL CONTROL TECHNOLOGY starting PLC controller inputs or outputs to ensure so called pure supply for the PLC controller. With pure supply we mean supply where industrial environment cannot affect it damagingly. Some of the smaller PLC controllers supply their inputs with voltage from a small supply source already incorporated into a PLC. The internal logic and communication circuitry usually operates on 5 and 15 V DC power. The power supply provides filtering and isolation of the low voltage power from the AC power line. Power supply assemblies may be separate modules, or in some cases, plug-in modules in the I/O racks. Separate control transformers are often used to isolate inputs and CPU from output devices. The purpose is to isolate this sensitive circuitry from transient disturbances produced by any highly inductive output devices. (8) Timers and counters. Timers and counters are indispensable in PLC programming. Industry has to number its products, determine a needed action in time, and so on. Timing functions are very important, and cycle periods are critical in many processes. There are two types of timers: delay-off and delay-on. First is late with turn off and another runs late in turning on in relation to a signal that activated timers. Example of a delay-off timer would be staircase lighting. Following its activation, it simply turns off after a few minutes. Each timer has a time basis, or more precisely has several time bases. Typical values are 1, 0.1, and 0.01 s. If the programmer has entered 0.1 as time basis and 50 as a number for delay increase, the timer will have a delay of 5 s (50 × 0.1 s = 5 s). Timers also have to have the value SV set in advance. Value set in advance or ahead of time is a number of increments that the timer has to calculate before it changes the output status. Values set in advance can be constants or variables. If a variable is used, the timer will use a real time value of the variable to determine a delay. This enables delays to vary depending on the conditions during function. An example is a system that has produced two different products, each requiring different timing during process itself. Product A requires a period of 10 s, so number 10 would be assigned to the variable. When product B appears, a variable can change value to what is required by product B. Typically, timers have two inputs. First is timer enable, or conditional input (when this input is activated, timer will start counting). The second input is a reset input. This input has to be in OFF status in order for a timer to be active, or the whole function would be repeated over again. Some PLC models require this input to be low for a timer to be active; other makers require Zhang_Ch04.indd 436 5/13/2008 5:50:45 PM 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL 437 high status (all of them function in the same way basically). However, if a reset line changes status, the timer erases accumulated value. 4.1.1.2 Control Mechanism A programmable logic controller is a digital electronic device that uses a programmable memory to store instructions and uses a CPU to implement specific functions such as logic, sequence, timing, counting, and arithmetic to control machines and processes. Figure 4.2 shows a simple schematic of a typical programmable logic controller. When running, the CPU scans the memory continuously from top to bottom, and left to right, checking every input, output, and instruction in sequence. The scan time depends upon the size and complexity of the program, and the number and type of I/O. The scan may be as short as a few milliseconds or less. A few milliseconds per scan would produce tens of scans per second. This short time makes the operation appear as instantaneous, but one must consider the scan sequence when handling critically timed operations and sealing circuits. Complex systems may use interlocked multiple CPUs to minimize total scan time. The parts of the PLC that are quite different from the typical desktop computer are the input and output modules. These modules allow the PLC to communicate with the machine. The inputs may come from limit switches, proximity sensors, temperature sensors, and so on. On the basis of the software program and the combination of inputs, the CPU of the PLC will set the outputs. These outputs may control motor speed and direction, actuate valves, open or close gates, and control all the motions and activities of the machine. (1) System address. The key to getting comfortable with any PLC is to understand the total addressing system. We have to connect our discrete inputs, pushbuttons, limit-switches, and so on, to our controller, interface those points with “electronic ladder diagram” (program), and then bring the results out through another interface to operate motor starters, solenoids, lights, and so forth. Inputs and outputs are wired to interface modules, installed in an I/O rack. Each rack has a two-digit address, each slot has its own address, and each terminal point is numbered. Figure 4.3 shows a PLC product in which all of these addresses are octal. We combine the addresses to form a number that identifies each input and output. Zhang_Ch04.indd 437 5/13/2008 5:50:45 PM 438 INDUSTRIAL CONTROL TECHNOLOGY I/O Rack Rack no. 00 Output module 7 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 6 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 5 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 4 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 3 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 2 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 Input module I:000/04 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 Closed input Slot numbers 1 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 0 Energized output 0:007/15 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 0 0 1 0 0 0 0 0 0 0 0 0 0 0 0 0 Output image table Word 0:007 17 16 15 14 13 12 11 10 07 06 05 04 03 02 01 00 0 0 0 0 0 0 0 0 0 0 0 1 0 0 0 0 Input image table Word 1:000 1:000 ] [ 04 User’s logic rung Input, rack 00, slot 0, terminal 04 0:007 ( ) 15 Output, rack 00, slot 7, terminal 15 Figure 4.3 Solution of one line of logic. Some manufacturers use decimal addresses. Some older systems are based on 8-bit words, rather than 16. There are a number of proprietary programmable controllers applied to special industries, such as elevator controls, or energy management, which may not follow the expected pattern, but they will use either 8- or 16-bit word structures. It is very important to identify the addressing system before you attempt to work on any system that uses a programmable controller, because one must know the purpose of each I/O bit before manipulating them in memory. Zhang_Ch04.indd 438 5/13/2008 5:50:45 PM 439 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL If you know the address of the input or output, you can immediately check the status of its bit by calling up the equivalent address on a cathode ray tube (CRT) screen for most of PLC products. (2) I/O addresses. Figure 4.4 gives an I/O address scheme, which shows us that the I/O modules are closely linked with the Input and Output image tables, respectively. Figure 4.3 shows a very simple line of logic, where a pushbutton is used to turn on a lamp. The pushbutton and lamp “hardwiring” terminates at I/O terminals, and the logic is carried out in software. We have a pushbutton, wired to an input module (I), installed in rack 00, slot 0, and terminal 04. The address becomes I:000/04. An indicating lamp is wired to an output module (O), installed in rack 00, slot 7, and terminal 15. The address becomes O:007/15. Our input address, I:000/04, becomes memory address Word # 0 1 2 3 4 5 6 7 0 1 2 3 4 5 6 7 Output image table I/O group designation An I/O chassis containing 16-point modules Note: Modules can also be installed like this: I O O I Input/output designation I O I O I O IO IO IO IO IO Input image table Word 0 1 2 3 4 5 6 7 Figure 4.4 I/O addressing scheme. Zhang_Ch04.indd 439 5/13/2008 5:50:45 PM 440 INDUSTRIAL CONTROL TECHNOLOGY I:000/04, and the output address 0:007/15 becomes memory address 0:007/15. In other words, the type of module, the rack address, and the slot position identifies the word address in memory. The terminal number identifies the bit number. (3) Image table addresses. An output image table is reserved in its IR area of the memory (see Table 4.1) as File format, and an input image table is reserved in the same way. A File in memory contains any number of words. Files are separated by type, according to their functions. In the same way, an input image table is also reserved in its IR area of the memory (See Table 4.1) as File format. Figure 4.4 illustrates the respective mapping relationship of the I/O modules to both Output and Input image tables. (4) Scanning. As the scan reads the input image table, it notes the condition of every input, and then scans the logic diagram, updating all references to the inputs. After the logic is updated, the scanner resets the output image table, to activate the required outputs. Figure 4.4 shows some optional I/O arrangements and addressing. In Fig. 4.3, we show how one line of logic would perform when the input at I:000/04 is energized, it immediately sets input image table bit I:000/04 true (ON). The scanner senses this change of state, and makes the element I:000/04 true in our logic diagram. Bit 0:007/15 is turned on by the logic. The scanner sets 0:007/15 true in the output image table, and then updates the output 0:007/15 to turn the lamp on. 4.1.1.3 PLC Programming Programmable logic controllers use a variety of software programming languages for control. These include sequential function chart (SFC), function block diagram (FBD), ladder diagram (LD), structured text (ST), instruction list (IL), relay ladder logic (RLL), flow chart, C, C++, and Basic. Among these languages, ladder diagram is the most popular. Almost every program for programming a PLC controller possesses various useful options such as: forced switching on and off of the system inputs/outputs (I/O lines), program follow up in real time as well as documenting a diagram. This documenting is necessary to understand and to define failures and malfunctions. The programmer can add remarks, names of input or output devices, and comments that can be useful when finding errors, or with system maintenance. Adding comments and remarks enables any technician (and not just a person who developed the system) to understand a ladder diagram right away. Comments and remarks can even quote Zhang_Ch04.indd 440 5/13/2008 5:50:47 PM 441 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL precisely part numbers if replacements would be needed. This would speed up repair of any problems that come up due to bad parts. The old way was such that a person who developed a system had protection on the program, so nobody aside from this person could understand how it was done. A correctly documented ladder diagram allows any technician to understand thoroughly how the system functions. (1) Relay ladder logic. Ladder logic is the main programming method used for PLCs. As mentioned before, ladder logic has been developed to mimic relay logic. Relays are used to let one power source close a switch for another (often-high current) power source, while keeping them isolated. An example of a relay in a simple control application is shown in Fig. 4.5. In this system, the first relay on the left is used as normally closed and will allow current to flow until a voltage is applied to input A. The second relay is normally open and will not allow current to flow until a voltage is applied to input B. If current is flowing through the first two relays, then current will flow through the coil in the third relay, and close the switch for output C. This circuit would normally be drawn in the ladder logic form. This can be read logically as C will be on if A is off and B is on. 115 VAC wall plug Relay logic Input A (Normally closed) A Input B (Normally open) B Output C (Normally open) C Ladder logic Figure 4.5 A simple relay controller. Zhang_Ch04.indd 441 5/13/2008 5:50:47 PM 442 INDUSTRIAL CONTROL TECHNOLOGY The example in Fig. 4.5 does not show the entire control system, but only the logic. When we consider a PLC there are inputs, outputs, and the logic. Figure 4.6 shows a more complete representation of the PLC. Here there are two inputs from pushbuttons. We can imagine the inputs as activating 24 VDC relay coils in the PLC. This in turn drives an output relay that switches 115 VAC, which will turn on a light. Note, in actual PLCs inputs are never relays, but outputs are often relays. The ladder logic in the PLC is actually a computer program that the user can enter and change. Note that both of the input pushbuttons are normally open, but the ladder logic inside the PLC has one normally open contact and one normally closed. Do not think that the ladder logic in the PLC needs to match the inputs or outputs. Many beginners will get caught trying to make the ladder logic match the input types. Many relays also have multiple outputs (throws) and this allows an output relay to also be an input simultaneously. The circuit shown in Fig. 4.7(a) is an example of this; it is called a seal in circuit. In this circuit, the current can flow through either branch of the circuit, through the contacts labeled A or B. Power supply +24 V Push buttons PLC Inputs C A B Ladder logic Outputs Light 115 VAC power Figure 4.6 A PLC illustrated with relays. Zhang_Ch04.indd 442 5/13/2008 5:50:47 PM 443 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL A B B X Normally open X Normally closed Normal output Normally on output IIT X Immediate inputs One Shot Relay OSR X Latch L U IOT (a) (b) X Unlatch X Immediate Output T (c) Figure 4.7 Relay Ladder logic representations: (a) a seal-in circuit; (b) Ladder logic inputs; and (c) Ladder logic outputs. The input B will only be on when the output B is on. If B is off, and A is energized, then B will turn on. If B turns on then the input B will turn on and keep output B on even if input A goes off. After B is turned on the output, B will not turn off. PLC inputs are easily represented in ladder logic. Figure 4.7(b) shows there are three types of inputs. The first two are normally open and closed inputs, discussed previously. Normally open: an active input x will close the contact and allow power to flow. Normally closed: power flows when the input x is not open. The IIT (Immediate InpuT) function allows inputs to be read after the input scan, while the ladder logic is being scanned. This allows ladder logic to examine input values more often than once every cycle. Immediate inputs will take current values, but not those from the previous input scan. In ladder logic, there are multiple types of outputs, but these are not consistently available on all PLCs. Some of the outputs will be externally connected to devices outside the PLC, but it is also possible to use internal memory locations in the PLC. Six types of outputs are shown in Fig. 4.7(c). The first is a normal output; when energized the output will turn on and energize an output. The circle with a diagonal line through is a normally on output. When it is energized, the output will turn off. This type of output is not available on all PLC types. When initially energized, the OSR (one shot relay) instruction will turn on for Zhang_Ch04.indd 443 5/13/2008 5:50:47 PM 444 INDUSTRIAL CONTROL TECHNOLOGY one scan, but then be off for all scans after, until it is turned off. The L (latch) and U (unlatch) instructions can be used to lock outputs on. When an L output is energized the output will turn on indefinitely, even when the output coil is deenergized. The output can only be turned off using a U output. The last instruction is the IOT (Immediate OutpuT) that will allow outputs to be updated without having to wait for the ladder logic scan to be completed. When power is applied (ON) the output x is activated for the left output, but turned off for the output on the right. An input transition on will cause the output x to go on for one scan (this is also known as a one shot relay). When the L is energized, x will be toggled on, and will stay on until the U coil is energized. This is like a flip-flop and stays set even when the PLC is turned off. In some PLCs, all immediate outputs do not wait for the program scan to end before setting an output. For example, to develop (without looking at the solution) a relay based controller that will allow three switches in a room to control a single light, there are two possible approaches. The first assumes that any one of the switches on will turn on the light, but all three switches must be off for the light to be off. Figure 4.8(a) displays the ladder logic of the first solution. The second solution assumes that each switch can turn the light on or off, regardless of the states of the other switches. This method is more complex and involves thinking through all of the possible combinations of switch positions. You can recognize this problem as an exclusive or problem from Fig. 4.8(b). (2) Programming. An example of ladder logic can be seen in Fig. 4.9. To interpret this diagram, imagine that the power is on the vertical line on the left-hand side; we call this the hot rail. On the Switches Switch 1 Light Light Switch 2 Switch 3 (a) (b) Figure 4.8 A case study: (a) solution 1 and (b) solution 2. Zhang_Ch04.indd 444 5/13/2008 5:50:48 PM 445 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL Neutral Hot A B X C D G E F H Inputs Y Outputs Figure 4.9 A simple Ladder Logic diagram. right-hand side is the neutral rail. In this figure there are two rungs, and on each rung there are combinations of inputs (two vertical lines) and outputs (circles). If the inputs are opened or closed in the right combination the power can flow from the hot rail, through the inputs, to power the outputs, and finally to the neutral rail. An input can come from a sensor, switch, or any other type of sensor. An output will be some device outside the PLC that is switched ON or OFF, such as lights or motors. In the top rung the contacts are normally open and normally closed, which means if input A is ON and input B is OFF, then power will flow through the output and activate it. Any other combination of input values will result in the output X being off. The second rung of Fig. 4.9 is more complex; there are actually multiple combinations of inputs that will result in the output Y turning on. On the left-most part of the rung, power could flow through the top if C is OFF and D is ON. Power could also (and simultaneously) flow through the bottom if both E and F are true. This would get power half way across the rung, and then if G or H is true the power will be delivered to output Y. There are other methods for programming PLCs. One of the earliest techniques involved mnemonic instructions. These instructions can be derived directly from the ladder logic diagrams and entered into the PLC through a simple programming terminal. An example of mnemonics is shown in Fig. 4.10. In this example, the instructions are read one line at a time from top to bottom. The first line 00000 has the instruction LDN (input load and not) for input 00001. This will examine the input to the PLC, and if it is OFF it will remember a 1 (or true); if it is ON it will remember a 0 (or false). The next line uses an LD (input load) statement to look at the input. If the input is OFF it remembers a 0; if the input is ON it remembers a 1 (note: this is the Zhang_Ch04.indd 445 5/13/2008 5:50:48 PM 446 INDUSTRIAL CONTROL TECHNOLOGY 00000 00001 00002 00003 00004 00005 00006 00007 00008 LDN LD AND LD LD AND OR ST END 00001 00002 00003 00004 00107 The mnemonic code is equivalent to the ladder logic below 00001 00002 00107 00003 00004 END Figure 4.10 A mnemonic program and equivalent Ladder Logic. reverse of the LD). The AND statement recalls the last two numbers remembered and if they are both true the result is a 1; otherwise the result is a 0. This result now replaces the two numbers that were recalled, and there is only one number remembered. The process is repeated for lines 00003 and 00004, but when these are done there are now three numbers remembered. The oldest number is from the AND; the newer numbers are from the two LD instructions. The AND in line 00005 combines the results from the last LD instructions and now there are two numbers remembered. The OR instruction takes the two numbers now remaining and if either one is a 1 the result is a 1, otherwise the result is a 0. This result replaces the two numbers, and there is now a single number there. The last instruction is the ST (store output) that will look at the last value stored and if it is 1, the output will be turned on; if it is 0 the output will be turned off. The ladder logic program in Fig. 4.10 is equivalent to the mnemonic program. Even if you have programmed a PLC with ladder logic, it will be converted to mnemonic form before being used by the PLC. In the past, mnemonic programming was the most common, but now it is uncommon for users to even see mnemonic programs. Sequential Function Charts have been developed to accommodate the programming of more advanced systems. These are similar to flowcharts, but are much more powerful. The example Zhang_Ch04.indd 446 5/13/2008 5:50:49 PM 447 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL seen in Fig. 4.11 is doing two different things. To read the chart, start at the top where is says start. Below this there is the double horizontal line that says follow both paths. As a result, the PLC will start to follow the branch on the left- and right-hand sides separately and simultaneously. On the left there are two functions; the first one is the power-up function. This function will run until it decides it is done, and the power-down function will come after. On the right-hand side is the flash function; this will run until it is done. These functions look unexplained, but each function, such as power-up will be a small ladder logic program. This method is much different from flowcharts because it does not have to follow a single path through the flowchart. (3) Ladder diagram instructions. Ladder logic input contacts and output coils allow simple logical decisions. Instructions extend basic ladder logic to allow other types of control. Most of the instructions will use PLC memory locations to get values, store values, and track instruction status. Most instructions will normally become active when the input is true. But, some instructions, such as TOF timers, can remain active when the input is off. Other instructions will only operate when the input goes from false to true; this is known as positive edge triggered. Consider a counter that only counts when the input goes from false to true; the length of time the input is true does not change the instruction behavior. A negative edge-triggered instruction would be triggered when the input goes from true to false. Most instructions are not edge-triggered: unless stated, assume instructions are not edge-triggered. Instructions may be divided into several basic groups according to their operation. Each of these instruction groups is introduced with a brief description in Table 4.2. Start Power up Flash Multiple path execution flow Power down End Figure 4.11 A sequential function chart. Zhang_Ch04.indd 447 5/13/2008 5:50:49 PM 448 INDUSTRIAL CONTROL TECHNOLOGY Table 4.2 Ladder Diagram Instructions Group Sequence Input Instructions Instruction LOAD LOAD NOT AND AND NOT OR OR NOT AND LOAD OR LOAD Sequence Output Instructions OUTPUT OUT NOT SET RESET KEEP DIFFERENTIATE UP DIFFERENTIATE DOWN Sequence Control Instructions NO OPERATION END INTERLOCK Function Connects an NO condition to the left bus bar Connects an NC condition to the left bus bar Connects an NO condition in series with the previous condition Connects an NC condition in series with the previous condition Connects an NO condition in parallel with the previous condition Connects an NC condition in parallel with the previous condition Connects two instruction blocks in series Connects two instruction blocks in parallel Outputs the result of logic to a bit Reverses and outputs the result of logic to a bit Force sets (ON) a bit Force resets (OFF) a bit Maintains the status of the designated bit Turns ON a bit for one cycle when the execution condition goes from OFF to ON Turns ON a bit for one cycle when the execution condition goes from ON to OFF — Required at the end of the program It the execution condition for IL(02) is OFF, all outputs are turned OFF and all timer PVs reset between IL(02) and the next ILC(03) (Continued) Zhang_Ch04.indd 448 5/13/2008 5:50:49 PM 449 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL Table 4.2 Ladder Diagram Instructions (Continued) Group Instruction INTERLOCK CLEAR JUMP JUMP END Timer/Counter Instructions Data Comparison Instructions TIMER COUNTER REVERSIBLE COUNTER HIGH-SPEED TIMER COMPARE DOUBLE COMPARE BLOCK COMPARE TABLE COMPARE Data Movement Instructions MOVE MOVE NOT BLOCK TRANSFER BLOCK SET DATA EXCHAGE SINGLE WORD DISTRIBUTE Function ILC(03) indicates the end of an interlock (beginning at IL(02)) If the execution condition for JMP(04) is ON, all instructions between JMP(04) and JME(05) are treated as NOP(OO) JME(05) indicates the end of a jump (beginning at JMP(04)) An ON-delay (decrementing) timer A decrementing counter Increases or decreases PV by one A high-speed, ON-delay (decrementing) timer Compares two four-digit hexadecimal values Compares two eight-digit hexadecimal values Judges whether the value of a word is within 16 ranges (defined by lower and upper limits) Compares the value of a word to 16 consecutive words Copies a constant or the content of a word to a word Copies the complement of a constant or the content of a word to a word. Copies the content of a block of up to 1000 consecutive words to a block of consecutive words Copies the content of a word to a block of consecutive words Exchanges the content of two words Copies the content of a word to a word (whose address is determined by adding an offset to a word address) (Continued) Zhang_Ch04.indd 449 5/13/2008 5:50:49 PM 450 INDUSTRIAL CONTROL TECHNOLOGY Table 4.2 Ladder Diagram Instructions (Continued) Group Instruction Function DATA COLLECT Copies the content of a word (whose address is determined by adding an offset to a word address) to a word Copies the specified bit from one word to the specified bit of a word Copies the specified digits (4-bit units) from a word to the specified digits of a word Copies the specified bit (0 or 1) into the rightmost bit of a shift register and shifts the other bits one bit to the left Creates a multiple-word shift register that shifts data to the left in one-word units Creates a shift register that exchanges the contents of adjacent words when one is zero and the other is not Shifts a 0 into bit 00 of the specified word and shifts the other bits one bit to the left Shifts a 0 into bit 15 of the specified word and shifts the other bits one bit to the right Moves the content of CY into bit 00 of the specified word, shifts the other bits one bit to the left, and moves bit 15 to CY Moves the content of CY into bit 15 of the specified word, shifts the other bits one bit to the left, and moves bit 00 to CY Shifts a 0 into the rightmost digit (4-bit unit) of the shift register and shifts the other digits one digit to the left MOVE BIT MOVE DIGIT Shift Instructions SHIFT REGISTER WORD SHIFT ASYNCHRONOUS SHIFT REGISTER ARITHMETIC SHIFT LEFT ARITHMETIC SHIFT RIGHT ROTATE LEFT ROTATE RIGHT ONE DIGIT SHIFT LEFT (Continued) Zhang_Ch04.indd 450 5/13/2008 5:50:49 PM 451 4: DIGITAL CONTROLLERS FOR INDUSTRIAL CONTROL Table 4.2 Ladder Diagram Instructions (Continued) Group
0
You can add this document to your study collection(s)
Sign in Available only to authorized usersYou can add this document to your saved list
Sign in Available only to authorized users(For complaints, use another form )