Implementation of a Wirelesshart Simulator and Its Use in Studying Packet Loss Compensation in Networked Control
Total Page:16
File Type:pdf, Size:1020Kb
Implementation of a wirelessHART simulator and its use in studying packet loss compensation in networked control MAURO DE BIASI Masters' Degree Project Stockholm, Sweden February 2008 XR-EE-RT 2008:010 Acknowledgement First of all, I would like to thank my parents and my girlfriend that have been always beside me in all this years of studies and have been a great source of strength in these months away from home. I am deeply grateful to Alf Isaksson, my supervisor at ABB, that always followed me with patience and new motivations. He o®ered me his everyday support and permitted me to grow up and develop this project. I can not go on without express my gratefulness to my university supervisors Alberto Bemporad (University of Siena) and Mikael Johansson (KTH). I would like to say thank you to them who gave me the opportunity to join this project and shared with me their knowledge with technical suggestions and interesting ideas. They gave me their full support when I applyied for my thesis and provided helpful information. This work would not be as it is without the kind assistance and support of Tiberiu Seceleanu and Krister Landernas, who shared their valuable knowledge and inspired me in de¯ning my research topic. A special thanks is needed to all the persons involved in the SOCRADES project, who collaborated with me in this period. A huge thank you to the whole ABB Corporate Research that permitted me to live this amazing experience. I'm honored to have been part of this incredible group of people. I feel to mention also all the guys who did their thesis with me at ABB, who made me feel less far from home and were such good friends. Thanks to Eva Stenqvist, who gave me the possibility to concentrate only on my work, solving every kind of external problem. I am deeply indebted to Giuseppe and Marisa, who treated me like a son, helping me in all these years of studies. Last but not least I would like to thank Carlo that has been more than a colleague, but a real friend. Thank you All i No matter how long the winter, spring is sure to follow. ii Abstract This thesis is part of the SOCRADES project, a European research and advanced develop- ment project with the primary objective to develop a design, execution and management platform for next-generation industrial automation systems. In the speci¯c case of work it concerns the networked control systems. These are becoming more important in the industrial automation ¯eld thanks to the many advantages introduced by the networks. In fact, the use of a network to connect the devices permits to eliminate unnecessary wirings, reducing the complexity and the overall cost in designing and implementing the control systems. In the last years the fast spread of the wireless technologies has opened new scenarios for the communication in the automation ¯eld. The bene¯ts introduced by the use of wireless communication in the networked control system are many. First of all the simplicity and the convenience of the sensors placement. The price to be paid is a lower reliability due to the interference that can easily a®ect the medium (radio frequencies) with the consequent possible loss of communication. This work is focused on the study of the problem of losing packets (the information in a wireless network is formed by packets of bits) in a WirelessHART networked control system and on the possible solutions to avoid the problem. WirelessHART is a wireless protocol that provides a low cost, relatively low speed (e.g., compared to IEEE 802.11g) wireless connection. The aims of the thesis are multiple, ¯rst of all the implementation of a tool that permits to simulate a wirelessHART network. In fact, since it is a quite new protocol, the most used network simulators do not give the possibility to simulate WirelessHART networks. This simulator has been im- plemented modifying the original version of the TrueTime network simulator, adding this new protocol and some other functions to make the simulator as close as possible to the reality. Another objective of the thesis is to study the e®ects, and the possible solutions, of the loss of communication in a wirelessHART network. The last part of the thesis deals with a level control problem in a mineral flotation plant and with the possibility to use a wirelessHART network for that plant. iii Contents 1 Introduction 1 1.1 Outline of the thesis . 2 1.1.1 Chapter 2 : The WirelessHART protocol . 2 1.1.2 Chapter 3 : Introduction to TrueTime . 2 1.1.3 Chapter 4 : New functions in the wireless network block . 2 1.1.4 Chapter 5 : Study of Packet Loss . 3 1.1.5 Conclusions and future work . 3 2 Network theory 4 2.1 The Open System Interconnection model (OSI) . 4 2.1.1 The OSI basic structure . 4 2.2 The Medium Access Control (MAC) protocol . 7 2.2.1 ALOHA . 7 2.2.2 Carrier Sense Multiple Access Protocols (CSMA) . 8 2.2.3 Time Division Multiple Access (TDMA) . 9 2.2.4 Token Bus . 9 2.2.5 Token Ring . 10 2.3 The IEEE 802 standards . 11 2.3.1 Bluetooth/IEEE 802.15.1 . 11 2.3.2 IEEE 802.11 . 12 2.3.3 IEEE 802.15.4 . 13 2.3.4 ZigBee . 15 2.3.5 WirelessHART . 15 3 WirelessHART 18 3.1 Introduction . 18 i CONTENTS 3.2 A brief view of WirelessHART . 18 3.3 MAC Protocol Description . 20 3.3.1 Data-Link packets(DLPDUs) . 21 3.3.2 Time Division Multiple Access (TDMA) . 21 3.3.3 Shared Slot . 23 3.3.4 Communication Tables . 24 3.4 Implementation . 25 3.4.1 MAC Protocol . 25 3.4.2 Devices Tables . 26 3.4.3 Synchronization of the devices tasks . 27 4 Introduction to TrueTime 29 4.1 Description of the tool . 29 4.1.1 The TrueTime Kernel . 30 4.1.2 The TrueTime Network . 31 4.1.3 The TrueTime Wireless Network . 33 4.1.4 The TrueTime Standalone Network Blocks . 35 4.1.5 The TrueTime Battery . 36 4.2 Wireless Network Block behaviour . 36 4.2.1 802.11b/g ( WLAN) . 37 4.2.2 802.15.4 (ZigBee) . 38 4.2.3 Calculation of Error Probabilities . 39 5 New functions in the wireless network block 42 5.1 Introduction . 42 5.2 Nodes in the 3D space . 42 5.3 External noise port . 43 5.4 Noise and time correlation . 44 5.5 Packets lost signal . 46 5.6 Fixed packet loss functionality . 47 5.7 Wireless Network Mask modi¯cation . 48 5.8 Moving the MAC into each device . 49 5.8.1 The WirelessHART MAC sub-layer in each device . 50 ii CONTENTS 6 Study of Packet Loss 51 6.1 Introduction . 51 6.1.1 Main causes of packet loss . 52 6.1.2 The problem of packet loss in the networked controlled systems . 54 6.2 Comparison of di®erent protocols with respect to packet loss . 55 6.2.1 The compared protocols . 56 6.2.2 Simulation Setup . 57 6.2.3 Network parameter settings . 59 6.2.4 Simulation results . 60 6.3 A brief description of the AC800M . 63 6.4 Di®erent approaches to the problem of packet loss . 64 6.4.1 Possible methods . 65 6.4.2 An improved PID . 69 6.4.3 Results . 71 6.4.4 Multi-Hop . 75 6.5 Boliden Plant: a case study . 77 6.5.1 Description of the flotation process . 77 6.5.2 The pulp level control problem . 78 6.5.3 Boliden Plant: simulation . 81 7 Conclusions and Future Work 85 7.1 Conclusions . 85 7.2 Future work . 86 A How to install the tool 88 A.1 Software Requirements . 88 A.2 Installation . 88 A.3 Compilation . 89 B How to use the Simulator 90 B.1 Introduction . 90 B.2 Writing Code Functions . 90 B.2.1 Writing a Matlab Code Function . 91 B.2.2 Writing a C++ Code Function . 92 iii CONTENTS B.2.3 Calling Simulink Block Diagrams . 92 B.3 Initialization . 94 B.3.1 Writing a Matlab Initialization Script . 94 B.3.2 Writing a C++ Initialization Script . 95 B.4 Compilation . 96 C Examples 98 C.1 Introduction . 98 C.2 Control of a loop with three nodes . 99 C.3 5 nodes with multi-hop . 102 C.4 5 nodes with a shared slot . 104 D TrueTime Command Reference 107 E Lambda Tuning rule 110 E.1 Stable ¯rst order system . 110 E.2 Integrative process . 112 F Linearization 114 Bibliography 115 iv List of Figures 2.1 The Open System Interconnection (OSI) model . 5 2.2 The amount of data in the Open System Interconnection (OSI) model . 6.