Implementation of EtherCAT Master Middleware Component for Distributed Robot Control Architecture Yongseon Moon*, Tuan Anh Vo Trong*, Nak Yong Ko**, Kwangjin Kim**, Youngchul Bae*** *School of Information Communication, Sunchon National University, Sunchon, Korea, (e-mail: moon@ sunchon.ac.kr). **Dept. Electronics and Information Engineering, Chosun University, Gwangju,Korea,(e-mail:
[email protected]) *** Division of Electrical Electronic Communication, Chonnam National University, Yeosu, Korea, (e-mail:
[email protected]) Abstract: This paper describes a middleware for robot applications. The middleware is developed as a library based on the protocol EtherCAT. It’s module communicates with robot hardware element. It can be used for distributed control of a robot or multiple robot system. The middleware component is used with RTM which is developed at AIST Japan. Also, the component can be incorporated with MSRDS(Microsoft Robotic Development Studio). The use of middleware component enhances compatibility, coherency and reusability of robotic component and modules. Moreover, It is crucial to use the component for development of a robotic system which tends to be more and more complicated recently and for the future. Keywords: RTM, CORBA, MSRDS, UPnP, EtherCAT, Middleware. 1. INTRODUCTION The custom-made robotic design based on the integration of various standardized robotic components becomes more prevalent. To realize a new robot architecture, the robot middleware technology plays a key role. This paper proposes a middleware component for integration of robot modules and components. The proposed middleware component uses EtherCAR for interconnection. EtherCAT is a set of new performance standards. EtherCAT Slave System has flexible topology and simple configuration. EtherCAT protocol is optimized for processing data and transported directly within the Ethernet frame based on a special ethertype.[1] The middleware described in the paper suits for three layered robotic architecture. The top layer is robot application, in which all business requirements are implemented. This first layer controls primitive actuators, sensors, and EtherCAT devices via the second layer. The second layer is EtherCAT master middleware (named as RM_ECAT). RM_ECAT connects robot application to a robot which is regarded as a slave application. Slave application is designed to work in the third layer. The third layer receives commands from RM_ECAT and controls robot directly. A robot system consists of many complicated components such as operating system, network protocol, programming environment, and hardware components. Therefore, implementing robot application on a distributed system is a good choice. The distributed system executes a collection of protocols to coordinate the actions of multiple processes on a network or enables to components cooperate together to perform a small set of related tasks. In this paper, we introduce about the integration RM_ECAT into RTM, MSRDS and UPnP.
The rest of the paper consists of 5 sections. Section 2 introduces about the RM_ECAT. The integration RM_ECAT into RTM is presented in section 3. Section 4 details the integration of RM_ECAT into MSRDS. Using RM_ECAT for UPnP system is given in section 5. Section 6 is compares RTM, MSRDS and UPnP. Section 7 concludes the paper. 2. REDONE ETHERCAT MASTER RM_ECAT is designed and developed to aim to modularize robotic functional elements. It enables the system to be extended and integrated easier for a new system or new application. In additional, it enables programmers develop system in some programming languages (C/C++, C#, Visual Basic). RM_ECAT is also focused on reusability, an important characteristic of a high quality software component. RM_ECAT is designed and implemented so that it can be reused in many different programs. RM_ECAT is studied and developed based on EtherCAT technology and communicates with hardware devices through RJ45 port. It is a library of software for data connection that encapsulates a set of functions. It connects robot applications to robots or other network services (internet, CANopen), resides between application layer and physical data layer in multi-layer model. The implementation of an EtherCAT robot system is shown in Figure 1. RM_ECAT is configured with help of a XML configuration file. All information about EtherCAT slave is described in this file. RM_ECAT provides a simple C/C++ interface or an object interface to help programmers control their robots. The interfaces are as the followings. ① “startDevices” for creating virtual objects and initializin g the input information for these objects.
② “addCommand” for adding a command to a queue. ③ “execute” for executing all commands in a queue.
units that are called RT Component (RTC). The architecture of RTM is shown in Figure 2.
④ “read” for getting information from robot or slave such as sensors and actuators. ⑤ “write” for sending raw data to slave.
Fig. 2. The architecture of RTM RTM has been developed based on CORBA. CORBA uses ORB (Object Request Broker) as a middleware, which establishes a client-server relationship between objects. The advantage of this issue was any distributed object could be implemented in any programming language and could communicate with one another. Therefore, applications could work in heterogeneous hardware, networks, operating systems, and programming languages. CORBA is more and more popular and developed. It's a very good solution for developing distributed system. So, the integration RM_ECAT into CORBA is necessary. Fig. 1. The implementation of EtherCAT robot system The first step to use RM_ECAT for control an EtherCAT robot is calling “startDevices” which wakes a robot ready for control. The code below shows the sample to start a device. RM_ECAT engine = new RM_ECAT(); void StartDevice(){ int result = engine.startDevice(); if (result != 1) ShowError("Could not start device: Error code = " + result.ToString()); } After starting device successfully, one can control robot by using “addCommand”, to add command to a queue and “execute” to execute all commands in the queue. A sample for adding and executing commands is shown in the following code.
Fig. 3. RTC linker In RTM application, each function of the robot system is developed in a separate application (known as RTC). To make components work together, we need to connect them by using RTC linker. The RTC linker’s interface is shown in Figure 3. Figure 4 shows an example of Robot Domain Manager.
void SetWheelVelocity(int left, int right) { engine.addCommand(32, 240, left); engine.addCommand(32, 344, right); engine.execute(); } 3. RTM Robot Technology Middleware (RTM), which is developed by AIST (Advanced Industrial Science and Technology) of Japan [2], helps researchers develop a robot system conveniently. RT Middleware is a framework, in which functional elements of the robot is divided into the
Fig. 4. Robot Domain Manager
4. MSRDS Microsoft has developed MSRDS. It is a programming environment to make application for various types of robot. MSRDS is a windows based environment for robot control and simulation. [3] MSRDS are applicable to a wide range of domains, including command and control, sensor networks. With MSRDS, robotic applications can be developed using a selection of programming languages, including languages in Microsoft Visual Studio and Microsoft Visual Studio Express (VC++, C# and VB.NET), as well as scripting languages such as Microsoft Iron Python. Third-party languages that support the Microsoft Robotics Studio services-based architecture are also supported. Beside, MSRDS supports a Virtual Programming Language (VPL) [4]. VPL helps programmers make their own robot applications easily. Figure 5 shows a sample, which is developed by using VPL.
MSRDS has a set of tools for programming and debugging. It provides a simulation environment for testing robot application. Figure 6 is two screen shots of simulation program. MRSDS is a powerful tool for robot control and is used more widely in robot applications. Therefore, the integration EtherCAT device into MSRDS platform is desirable. To support RM_ECAT in MSRDS, we have developed RM_ECAT service that wraps RM_ECAT interface and exposes the operations in service port, so that RM_ECAT can work as a Decentralized Software Services (DSS). Figure 7 describes the architecture of an EtherCAT application in MSRDS.
Fig. 7. The architecture of an EtherCAT application in MSRDS
Fig. 5. VPL Program Mobile robot system is a heterogeneous system. Similar to other Microsoft products, MSRDS is easy to use for all users. It has extensible runtime architecture for all types of robot.
The communication in MSRDS based on DSS services. Service is the basic building block for writing applications using MSRDS and is a key component of the MSRDS application. A service can be: ① Hardware components such as sensors, actuators, camer a, joystick. ② Software components such as User Interface, storage, dir ectory services. ③ Aggregations: Sensor fusion.
Fig. 8. MSRDS Application
Fig. 6: MSRDS Simulation
Figure 8 shows the interface of MSRDS robot domain manager, which reads configuration file and shows the content in the left treeview. The image, captured by camera from remote robot, is displayed in robot domain manager.
Moreover, the information from robot sensors is also sent to robot domain manager continuously. So that, user can control robot by sensors, winform or joystick. 5. UPnP UPnP technology defines an architecture for peer-to-peer network connectivity of intelligent appliances, wireless devices. It is designed to bring easy-to-use, flexible, standards-based connectivity to ad-hoc or unmanaged networks whether in the home, in a small business, public spaces, or attached to the internet.
Fig. 9. Robot communication based on UPnP
the communication of the EtherCAT robot application, which is developed by using Intelligent Robot Software Platform (iRSP) [6]. The UPnP Device Architecture (UDA) is a plug and play model. It is designed to support automatic discovery for a lot of device categories from a wide range of vendors. This means a device can dynamically join a network, obtain an IP address, convey its capabilities, and learn about the presence and capabilities of other devices. Finally, a device can leave a network smoothly and automatically without leaving any unwanted state behind. The UPnP Device Architecture is shown in Figure 11.
Fig. 11. UPnP Device Architecture
Our robot system aims to modularization in both software and hardware. We focus on decomposition of the robot system into functional or logical components with welldefined interfaces used for communication across the components. Components are considered to be a higher level of abstraction than objects. Figure 12 shows a sample of modularization and the collaboration between them.
Fig. 10. EtherCAT robot component for UPnP Fig. 12. Modularization in both software and hardware UPnP technology provides a distributed, open networking architecture that leverages TCP/IP to control and transfer data among networked devices [5]. Figure 9 and Figure 10 show
6. COMPARISON RTM, MSRDS, and UPnP are distributed platforms. They have open architecture protocol based on established standards and are independent on programming language. They have several differences in the following respects. ¾
¾
¾
Processing method: RTM: Remote processing MSRDS: Service oriented UPnP: Plug and Play Network type: RTM: Peer-to-peer MSRDS: Client-Server UPnP: Peer-to-peer Operating System RTM: Independent MSRDS: Windows OS UPnP: Independent
7. CONCLUSIONS Robot middleware is a part of robotic system. In order to integrate new robot technology into an existing distributed systems coherently and in a limited time, a good architecture for robot middleware should be considered. This paper introduces an EtherCAT middleware called the RM_ECAT. The paper presented features of the RM_ECAT and showed some examples of RM_ECAT application along with RTM, MSRDS and UPnP platform to control EtherCAT robot. The authors evaluated the performance of our firmware and the results are shown here. RM_ECAT for EtherCAT device works well in RTM (CORBA), MSRDS and UPnP platform. This middleware is developed to wrap EtherCAT protocol. It helps programmers develop their applications easier, faster regardless the lowlevel architecture of a robot. Applying multi-layers model for robot application enables programmers integrate their robots into distributed systems with convenience. Moreover, RM_ECAT satisfies most of the criteria as a software component: ¾ ¾ ¾ ¾ ¾
Multiple-use: can be used in any platform. Non-context-specific: can be used for any EtherCAT d evice. Composable with other components Encapsulation: provides a simple interface. A unit of independent deployment.
The modularization of RM_ECAT promotes reusability in EtherCAT robot systems, reduces the cost when they need to integrate EtherCAT robot into a new platform.
ACKNOWLEDGEMENT This research was supported by the “GRRC” project of Gyeonggi Provincial Government, Republic of Korea.
REFERENCES [1]http://www.ethercat.org [2]http://www.is.aist.go.jp/rt/OpenRTM-aist [3]http://msdn.microsoft.com/en-us/library/cc998476.aspx [4]http://msdn.microsoft.com/en-us/library/bb483088.aspx [5]http://www.upnp.org/default.asp [6]http://irsp.biz/index.html