an automated test framework for hard real-time kth.diva- 619211/ آ  2013-05-02آ  an automated

Download An Automated Test Framework for Hard Real-Time kth.diva- 619211/ آ  2013-05-02آ  An Automated

Post on 13-Jul-2020

3 views

Category:

Documents

0 download

Embed Size (px)

TRANSCRIPT

  • An Automated Test Framework for Hard Real-Time Communication Systems

    MITHUN HANUMANAHALLI NAGAIAH

    Master of Science Thesis Stockholm, Sweden 2012

    TRITA-ICT-EX-2012:234

  • ತಂ ೆ ಾ ೆ ಸಮ ೆ

    Till mina kära föräldrar

    ii

  • An Automated Test Framework for Hard Real-Time Communication

    Systems Master thesis project carried out at ABB Corporate Research Center

    Västerås, Sweden

    MITHUN HANUMANAHALLI NAGAIAH mithun[at]kth.se

    Stockholm 2012

    Supervisors: Morgan E. Johansson Mattias Rehnman

    Examiner: Prof. Axel Jantsch

    TRITA-ICT-EX-2012:234

  • Acknowledgements I would like to thank my supervisor Morgan E. Johansson at ABB Corporate Research for his valuable guidance during this thesis. I am grateful to my examiner Prof. Axel Jantsch. I would like to thank my project partner Nian Tang for his help and understanding during the thesis work. It was a nice experience working with him. I would like to thank Mattias Rehnman and Pradyumna Sampath for giving me an opportunity to do this project at ABB Corporate Research Center, Västerås, Sweden. I would also like to thank my fellow thesis workers at ABB, my friends Anand Nagarajan, Arul Jesu Praveen John, Paulus Alexander Breijder, Rafet Oğul Türkel, Shivashankar Periaswamy, Sriram Yagnaraman, Tuton Chandra Mallick, Vinay Kumar Nagaraj and Vishwanath Rao for all the fun times and interesting conversations during my Master studies in Sweden. I am grateful for the opportunity to study in Sweden, it has taught me some valuable life lessons. I would like to take this opportunity to thank all my teachers who have steered me in the right direction. I am deeply thankful for my parents, my sister and her family for their constant encouragement and motivation.

  • Abstract In the field of Industrial automation there is a huge demand for real time communication networks [1] and there are several different protocols[2] like EtherCAT[3], PROFINET IO, SERCOS competing each other in the market[5]. Many of the products in this industry are subjected to hard real-time communication require- ments. The purpose of this thesis is in introducing tools to automatically test the various requirements that are helpful in deciding the performance of Real time communication systems. Developing a well-defined test framework is one of the important tasks in this thesis project. The end users of the test framework can focus more on managing and analyzing the results from the framework instead of the design process.

    The thesis work presents the test requirements, design of test system and automating the measurement process by selecting appropriate hardware. The report also explains the design of commands, method used for communication between different systems and also discusses the different methods that could be applied for measuring the performance, the limitations of some of these methods when applied to the framework. The architecture and the working of the framework is covered in later chapters. The framework uses EtherCAT master communication stack developed in-house at ABB[4]. EtherCAT is just used as a pilot test case, but in general the framework could be applied to other Ethernet based industrial communication protocols with suitable hardware or software modifications.

    v

  • CONTENTS

    Contents 1 Introduction 1

    2 Purpose of document 1

    3 Motivation 1

    4 Requirements 3 4.1 Requirements on test specification . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 4.2 Requirements on test framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 3 4.3 General structure of Ethernet based Real Time communication systems . . . . . . . . . 3

    5 Design of the test framework 5 5.1 Definition of the test framework architecture . . . . . . . . . . . . . . . . . . . . . . . . 5 5.2 Architecture Design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5

    5.2.1 Globally synchronized clock with PTP . . . . . . . . . . . . . . . . . . . . . . . 6 5.2.2 Round Trip Latency Measurement . . . . . . . . . . . . . . . . . . . . . . . . . 7 5.2.3 Absolute Latency Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . 8

    5.3 Command . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 5.4 Types of slaves . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5.5 Data transfer . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10

    5.5.1 Communication pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 10 5.5.2 Design of Datagram . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11 5.5.3 Packet design . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 11

    6 The I/O Controller or Counter 14 6.1 Function of I/O Controller during different test case execution . . . . . . . . . . . . . . 14

    6.1.1 Round Trip Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 14 6.1.2 Jitter of latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 6.1.3 Cycle time measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 6.1.4 Jitter of cycle times . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17

    6.2 TestManager and I/O Controller . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 18

    7 Software Implementation 20 7.1 The Programming language . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 7.2 Automated execution . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20 7.3 Test procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 20

    8 Test Case Design 22 8.1 Test case: External network latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 8.2 Test case: Jitter for external network latency . . . . . . . . . . . . . . . . . . . . . . . . 22 8.3 Test case: Startup time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 22 8.4 Test Case: Deviation of cycle time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 23 8.5 Test Case: Jitter of cycle time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 24 8.6 Test Case: Internal network fault tolerance . . . . . . . . . . . . . . . . . . . . . . . . . 24 8.7 Test Case: Slave node time synchronization . . . . . . . . . . . . . . . . . . . . . . . . . 26

    9 Pilot test case on EtherCAT 28 9.1 Introduction to EtherCAT . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 28 9.2 Implementation of Commands . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 29 9.3 Test Results . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30

    9.3.1 Test cycle time . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 30 9.3.2 Latency . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 32

    vi

  • CONTENTS

    10 Conclusion 34

    11 Future work 34

    A Appendix 35 A.1 Design for command in the framework . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 35 A.2 Instructions for compiling the Test Manager with Boost.Python library . . . . . . . . . . . . 39 A.3 Driver for NI-PCI 6624 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 39 A.4 Electrical Connections for NI PCI - 6624 . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40

    A.4.1 Specifications of the Counter: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 A.4.2 Accessories of the counter: . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 40 A.4.3 Pin Assignments of NI 6624 . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 41 A.4.4 Circuit connections for round Trip Latency Measurement . . . . . . . . . . . . . . . 44 A.4.5 Circuit Connections for Cycle Time Measurement . . . . . . . . . . . . . . . . . . 45

    vii

  • LIST OF FIGURES

    List of Figures 1 Figure 1: Structure of real time communication systems . . . . . . . . . . . . . . . . . . . 4 2 Figure 2: Test framework blocks . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 5 3 Figure 3: Measuring latency using a Global clock . . . . . . . . . . . . . . . . . . . . . . . 6 4 Figure 4: Global synchronized clock with PTP . . . . . . . . . . . . . . . . . . . . . . . . 7 5 Figure 5: Round Trip Latency Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . 8 6 Figure 6: Absolute Latency Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . 9 7 Figure 7: Datagram Structure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 12 8 Figure 8: Communication pattern . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 13 9 Figure 9:Round trip latency measurement using two edge separation method . . . . . . . . 15 10 Figure 10:Two Edge Separation Method . . . . . . . . . . . . . . . . . . . . . . . . . . . . 16 11 Figure 11:Pulse Width Measurement . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 17 12 Figure 12:Pulse Width Measurement Method . . . . . . . . . . . . . . . . . . . . . . . . . 18 13 Figure 13:Test Manager and I/O controller . . . . . . . . . . . . . . . . . . . . . . . . . . 19 14 Figure 14:Test Procedure . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . . 21 15 Figure 15:External network latency sequence . . . . . . . . . . . . . . . . . . . . . . . . . 22 16 Figure 16:Startup Time Sequence . . . . . . . . . . . . . . . . . . . . . . . . . . . . . .