1、REAL-TIME EXECUTION FOR IEC 61499REAL-TIME EXECUTION FORIEC 61499Alois ZoitlVienna University of Technology, AustriaCopyright c2009 by ISAInstrumentation, Systems, and Automation Society67 Alexander DriveP.O. Box 12277Research Triangle Park, NC 27709All rights reserved.Printed in the United States o
2、f America.10 9 8 7 6 5 4 3 2ISBN: 978-1-934394-27-4No part of this work may be reproduced, stored in a retrieval system, or transmitted inany form or by any means, electronic, mechanical, photocopying, recording or otherwise,without the prior written permission of the publisher.NoticeThe information
3、 presented in this publication is for the general education of the reader. Be-cause neither the author nor the publisher has any control over the use of the informationby the reader, both the author and the publisher disclaim any and all liability of any kindarising out of such use. The reader is ex
4、pected to exercise sound professional judgmentin using any of the information presented in a particular application. Additionally, neitherthe author nor the publisher have investigated or considered the affect of any patents on theability of the reader to use any of the information in a particular a
5、pplication. The readeris responsible for reviewing any possible patents that may effect any particular use of theinformation presented.Any references to commercial products in the work are cited as examples only. Neitherthe author nor the publisher endorses any referenced commercial product. Any tra
6、demarksor tradenames referenced belong to the respective owner of the mark or name. Neitherthe author nor the publisher makes any representation regarding the availability of any ref-erenced commercial product at any time. The manufacturers instructions on use of anycommercial product must be follow
7、ed at all times, even if in conflict with the informationin this publication.Library of Congress Cataloging-in-Publication is in ProgressThe O3neida PublicationsSeriesThis book is one of a series of books to be produced within O3neidaon various subjects related to distributed automation.O3neida is a
8、 Canadian not-for-profit corporation. O3neidaEuropeisanot-for-profitassociationheadquarteredinBrussels, Bel-gium. Together they form the hub of the O3neida networks. Theirjoint mission is to operate as a network of networks fostering the de-velopmentanddeploymentofdistributedindustrialautomationtech
9、-nologies based on open standards. These standards include, amongothers, the Foundation for Intelligent Physical Agents (FIPA), theDevice Profile for Web Services (DPWS), Web Crawler (WC), andInternational Electrotechnical Commission (IEC) 61131 and 61499.This book describes case studies of IEC 6149
10、9 implemen-tation supporting real-time execution. For sophisticated and experi-enced practitioners and graduate level course work, it also providesmore detailed treatment of other important issues surrounding thisstandards implementation in industrial applications. Apart from thereal-timeexecutionof
11、IEC61499modelsthebooktargetstheimpor-tant issue of dynamic reconfiguration of control applications duringexecution time. Supporting dynamic reconfiguration at the lowerlevels of industrial control systems is a major enabler for flexibleadaptive production systems, as demanded by manufacturing indus-
12、tries.Future volumes will address other equally pressing issuessuch as Ethernet Safety Devices along with a Compendium of se-lected papers from the 50th ANIPLA Conference. O3neida will alsopublish materials on automation objects as part of this series.Finally, this book is the result of a concerted
13、effort by manyO3neida members. I thank them all for their dedication and com-mitment to O3neida as volunteers. I particularly thank Alois Zoitlof the Technical University of Vienna, Austria for leading this effortand Allan Martel, O3neida Chief Operating Officer, for coordinatingvReal-Time Execution
14、 for IEC 61499and managing the development of the O3neida series of books ondistributed automation.I also thank ISA for their interest and support in making thepublication and distribution of this important book possible.Antonio ValentiniChief Executive OfficerO3neidaviAcknowledgmentsFirst of all I
15、want to thank O3neida, an international network ofnetworks focused on new technologies for distributed industrial au-tomation based upon open standards. They made this book possibleand supported me extensively through improving the quality of thewritten text.This book is based on my PhD thesis; ther
16、efore, I would liketo thank Professor Bernard Favre for his invaluable help and encour-agement during the years of my research. As my first supervisor heprovided me with feedback and support at any time, regardless ofthe difficult circumstances.I gratefully acknowledge the help of Professor Robert W
17、.Brennan from the University of Calgary for co-supervising my PhDthesis. I would like to thank my colleagues at the Automation andControl Institute for their inspiring discussions, suggestions, moti-vation, and advice. Especially I would like to express my thanks toChristoph Sunder, Rene Smodic, Ing
18、o Hegny, and Oliver Hummer.Furthermore, I would like to express my gratitude to Dr.Thomas Strasser from PROFACTOR and to Dr. Franz Auinger andGunnar Grabmair from the University of Applied Sciences in Wels,for the interesting discussions we had in our collaborative projectsand hopefully will have in
19、 our future projects.I would like to acknowledge the financial support from theAustrian Science Fund (FWF), Project No. FWFP19644-N13.Finally and above all, I would like to thank my wonderfulgirlfriend Andrea for her support and unceasing patience in the mo-ments when this book was at the forefront
20、of my thoughts.ALOIS ZOITLviiContents1 Introduction 1Goal . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3Conceptual Approach . . . . . . . . . . . . . . . . . . . . 3Task Definition . . . . . . . . . . . . . . . . . . . . . . . 42 IEC 61499 a Base Model for Reconfigurable ControlSystems
21、7Overview of the IEC 61499 Family of Standards . . . . . . 7Short Introduction to IEC 61499 . . . . . . . . . . . . . . 8Existing Execution Approaches for IEC 61499 . . . . . . . 12Reconfiguring IEC 61499 Control Applications . . . . . . 17Summary . . . . . . . . . . . . . . . . . . . . . . . . . .
22、183 Reconfiguration of Embedded Control Software 21Basic Definitions . . . . . . . . . . . . . . . . . . . . . . 21Existing Work on Reconfigurable Software Infrastructures 22Requirements for Dynamic Reconfiguration Support . . . . 26Reconfiguration Aptitude of Industrial Control Systems . . 28IEC 61
23、131-3 . . . . . . . . . . . . . . . . . . . . . . 28IEC 61499 . . . . . . . . . . . . . . . . . . . . . . . 30Summary . . . . . . . . . . . . . . . . . . . . . . . . . . 334 Real-Time Execution of Embedded Control Software 35Basic Definitions . . . . . . . . . . . . . . . . . . . . . . 35Real-Time S
24、ystem Constraints . . . . . . . . . . . . . . . 39Absolute Timing Constraints . . . . . . . . . . . . . 39Relative Timing Constraints . . . . . . . . . . . . . 40Resource Constraints . . . . . . . . . . . . . . . . . 41Process Models . . . . . . . . . . . . . . . . . . . . . . . 41Periodic Occurrenc
25、e Model . . . . . . . . . . . . . . 42Aperiodic Occurrence Models . . . . . . . . . . . . 42Overview of Real-Time Scheduling Algorithms . . . . . . 44Task Activation Models . . . . . . . . . . . . . . . . 45ixReal-Time Execution for IEC 61499Classification of Scheduling Algorithms . . . . . . . 45Ba
26、sic Scheduling Algorithms . . . . . . . . . . . . . 46Derived Scheduling Algorithms . . . . . . . . . . . 47Summary . . . . . . . . . . . . . . . . . . . . . . . . . . 485 Reconfiguration Approach 51Introduction . . . . . . . . . . . . . . . . . . . . . . . . . 51Reconfiguration Model . . . . . . .
27、. . . . . . . . . . . . 52Identification of Reconfiguration Services . . . . . . . . . 55Derivation of Reconfiguration Services . . . . . . . . 56Compilation of Basic Reconfiguration Services . . . 59Necessary Extensions to the Basic Reconfiguration Sup-port of IEC 61499 . . . . . . . . . . . . . .
28、. . . . . 63Handling Vendor-Independent Function Block TypeDefinitions . . . . . . . . . . . . . . . . . . 63Derived Data Types . . . . . . . . . . . . . . . . . . 75Interacting with Function Block Internals . . . . . . 75Execution Environment Support for Reconfiguration Ap-plications . . . . . . .
29、. . . . . . . . . . . . . . . . 77Language for Programming Reconfiguration Appli-cations . . . . . . . . . . . . . . . . . . . . 77InteractionBetweenReconfigurationApplicationandControl Application . . . . . . . . . . . . . 78Provision of Basic Reconfiguration Services . . . . . 79Management Model .
30、 . . . . . . . . . . . . . . . . . 83Execution of Reconfiguration Applications . . . . . . . . . 86Summary . . . . . . . . . . . . . . . . . . . . . . . . . . 886 A New IEC 61499 Real-Time Execution Model 91Execution Requirements for Reconfigurable Control Models 91Deriving a new Execution Approach
31、for IEC 61499 . . . . 93Analysis of the IEC 61499 Execution Model . . . . . 93Mapping the IEC 61499 Modeling Elements toExisting Real-Time Scheduling Theory . . . 98The Event Chain Concept . . . . . . . . . . . . . . . 102Structural and Behavioral Attributes of Event Chains 103AnIEC61499ExecutionEnv
32、ironmentBasedontheEventChain Concept . . . . . . . . . . . . . . . . . . . . 108ExecutionofFunctionBlockNetworkswithinEventChains . . . . . . . . . . . . . . . . . . . . 110xContentsExecution of Event Chains . . . . . . . . . . . . . . 118Resulting Task-set . . . . . . . . . . . . . . . . . . . 122D
33、erived Scheduling and Execution Parameters . . . . . . . 123Worst-Case Execution Time of Event Chains . . . . . 124Arrival Times for Event Chain Branches . . . . . . . 127Providing the Scheduling and Execution Parametersto the Execution Environment . . . . . . . . 134Managing External Events . . . .
34、 . . . . . . . . . . . . . 135Guaranteeing Real-Time Execution . . . . . . . . . . . . . 139General Execution Properties of the Resulting Task-set139Worst-Case Active Task-Set . . . . . . . . . . . . . 142Static Priority Scheduling of General Task-sets . . . 143Dynamic Priority Scheduling of General
35、 Task-sets . . 146Considerations on Task Blocking . . . . . . . . . . . 147Guidelines for Real-Time Constrained Control Applica-tion Design . . . . . . . . . . . . . . . . . . . . . . 148Considerations on Executing Reconfiguration Applications 149Setup Phase of Reconfiguration Applications . . . . 1
36、51Execution Phase of Reconfiguration Applications . . 151Shutdown Phase of Reconfiguration Applications . . 152Resulting Execution Environment Design . . . . . . . . . 1537 Tests and Measurements 157Test Environment . . . . . . . . . . . . . . . . . . . . . . 157IEC 61499 Execution Environment . . .
37、 . . . . . . . 158Control Devices . . . . . . . . . . . . . . . . . . . . 158Measurement Setup . . . . . . . . . . . . . . . . . . 161Test Event Chain . . . . . . . . . . . . . . . . . . . 163Real-Time Execution Experiments . . . . . . . . . . . . . 165Independent Real-Time Constrained Event Chains
38、. . 166Decoupled Event Chain Branches . . . . . . . . . . 172Discussion of Real-Time Execution Experiments . . 176Real-Time Reconfiguration Experiments . . . . . . . . . . 178Disturbances Resulting from the External Reconfig-uration Interface . . . . . . . . . . . . . . . 179Disturbances Resulting f
39、rom the Internal Reconfig-uration Interface . . . . . . . . . . . . . . . 181DiscussionofReal-TimeReconfigurationExperiments186Summary . . . . . . . . . . . . . . . . . . . . . . . . . . 187xiReal-Time Execution for IEC 614998 Real-World Control Application 191Experimental Setup . . . . . . . . . .
40、. . . . . . . . . . . 191Parameter Normalization . . . . . . . . . . . . . . . 192Closed Loop Control Experiments . . . . . . . . . . . . . 194Improved Position Control of the Inverted Pendulum 195Results . . . . . . . . . . . . . . . . . . . . . . . . . 196Reconfiguration Experiment . . . . . . . .
41、 . . . . . . . . 198Setup Phase . . . . . . . . . . . . . . . . . . . . . . 198Execution Phase . . . . . . . . . . . . . . . . . . . . 200Shutdown Phase . . . . . . . . . . . . . . . . . . . . 202Results . . . . . . . . . . . . . . . . . . . . . . . . . 203Discussion of Real-World Control Applicatio
42、nExperiments . . . . . . . . . . . . . . . . . 205Summary . . . . . . . . . . . . . . . . . . . . . . . . . . 2079 Future Steps Toward Adaptive Production Systems 209Summarization of the Achieved Results . . . . . . . . . . 209Next Steps . . . . . . . . . . . . . . . . . . . . . . . . . . 213Real-Ti
43、me Execution of IEC 61499 . . . . . . . . . 213Dynamic Reconfiguration Support . . . . . . . . . . 216Long-Term Vision . . . . . . . . . . . . . . . . . . . . . . 219A Description of the Basic Reconfiguration Services 221General Structure of the External Reconfiguration Interface 222Structural Servi
44、ces . . . . . . . . . . . . . . . . . . . . . 225Library Services . . . . . . . . . . . . . . . . . . . . . . . 229Execution Control Services . . . . . . . . . . . . . . . . . 230State Interaction Services . . . . . . . . . . . . . . . . . . 232Query Services . . . . . . . . . . . . . . . . . . . .
45、. . . 233B Compact XML-Encoding for IEC 61499 Types 237C Real-Time Event Function Blocks 239Terms and Abbreviations Used 253Bibliography 259Webiography 268Index 271xii1IntroductionTodays fast-changing global markets and decreasing product life-cycles are forcing a philosophical shift in manufacturin
46、g industries.The approach to manufacturing is quickly moving away from puremass production to mass customization. In order to rise to the chal-lenge of these emerging trends, new plant structures and productionfacility operation methods are necessary. Future production facili-ties need to be flexibl
47、e, adaptable and allow fast, changes all at littlecost. Todays flexible production systems already provide the mech-anisms for producing different products in the same plant. Howeverthis flexibility comes with high cost. First of all such plants havehigher initial costs compared to standard plants.
48、But what is evenmore important, they incorporate a high operational cost becauseof down-times needed for adapting to new products or because ofbreakdowns in the plant (e.g., continuous processes with long ramp-up times). Therefore, means are necessary that provide flexibilitywithout the need to stop
49、 the production.As early as 1991, a visionary study by the Iacocca Institute(1991) demanded the overall support for reconfiguration of manu-facturing plants with their Agile Manufacturing concept. The con-cept included reconfiguration on all plant levels, even the physicalreconfiguration of production resources (e.g., adding a new machineor changing a machines structure). In order to support this concept,the control software needs to be dynamically reconfigurable to bothbring about and adapt to the physical changes. Whatever the solu-tion, it must be simple, flexible and have limited s