5
Remote Control the Robot using Web Service Lukáš Richtr, Radim Farana The Department of Control Systems and Instrumentation VŠB-TU Ostrava Ostrava, Czech Republic e-mail: [email protected], [email protected] Abstract— This article deals with the design of a remote control of the robot IR52c. It describes the equipment of the robot and its properties, the connection between the robot and a server. The robot is controlled by a low-level protocol. To control the robot remotely via internet, a web server was created. All methods of a web service are described in this contribution. Another section of the article deals with creating an interface for using the web service. This interface was created in Silverlight technology. We describe the possibilities and the architecture of Silverlight. The last part of the paper describes the application itself. Keywords - Web Service, Remote Control, Control of Robot I. INTRODUCTION The area of the automatic control of a technological process is rapidly changing and growing. One very recent part of the area is the possibility of controlling remote processes on the Internet. There are many different approaches and protocols to implement this task. A very interesting approach appears to be the control of a remote process using web services. A web service is a very comprehensive and versatile tool to be used on different platforms. A web service itself is just the means. It is necessary to create the appropriate interface. Web services and Silverlight might be a very good combination. It is a relatively new technology. Therefore, it should be explored in the area of an automatic control. This work deals with the implementation of this technology on a particular device of the Eurobtec IR52c robot. II. EUROBTEC IR 52 C ROBOT The model IR 52c is a five-axis robot of a total weight 23 kg from the company Eurobtec. The interval of supply ranges from 20 V to 40 V. Its maximum load is about 1 kg and the maximal velocity of the robot is around 1 m.s -1 . Robot axes are driven by five DC motors. The first three axes are driven by GR63x25 DC motors with a maximum torque about 118 N.cm. These motors spin an axis through worm gears and pulleys. The fourth and fifth axes are driven by GR42x25 DC motors, which a have maximum torque 20 N.cm. These motors also drive the axes through the worm gear and pulley. These axes have really good radii, which are shown in Fig. 1. These radii range from 210° to 300° depending on the axis. The last axis even allows a radius up to 360°. Figure 1. Radii of Robot Axis. Each axis contains a disk with slots and a set of LEDs, which form together an absolute position sensor. Through these slots the diodes are emitting pulses on the disk slots. This pulse is translated into a binary code, and gives us information about changes in the arm position. Each axis also has two end switches, which prevent a collision of the robotic arm with the robot´s body. Precise positioning of a robot axis is made by an incremental encoder. It changes the output signal at every step of the motor. The control unit is used for the control of motors. This unit was developed specifically for the purpose of this type of robot. Motors are controlled by the PWM signal in a range of 15-20 kHz. A minimum PWM pulse width is 0.5 ms. The robot control unit has a maximum operating temperature of 64 °C. If the temperature is higher the unit is turned off in order to avoid damage to the control unit. III. POSITION CONTROLLER A position controller is connected to a computer via a serial line. A serial line must have settings of three pins, namely pins 2, 3, 5, and must be shielded. The maximum length of a cable is five meters. A position controller transmits instructions directly to the robot motion units. A scheme of a robot with a position controller and controller positions to PC is shown in Fig. 2. 326 978-1-61284-361-2/11/$26.00 c 2011 IEEE

[IEEE 2011 12th International Carpathian Control Conference (ICCC) - Velke Karlovice, Czech Republic (2011.05.25-2011.05.28)] 2011 12th International Carpathian Control Conference

  • Upload
    radim

  • View
    221

  • Download
    1

Embed Size (px)

Citation preview

Page 1: [IEEE 2011 12th International Carpathian Control Conference (ICCC) - Velke Karlovice, Czech Republic (2011.05.25-2011.05.28)] 2011 12th International Carpathian Control Conference

Remote Control the Robot using Web Service

Lukáš Richtr, Radim Farana The Department of Control Systems and Instrumentation

VŠB-TU Ostrava Ostrava, Czech Republic

e-mail: [email protected], [email protected]

Abstract— This article deals with the design of a remote

control of the robot IR52c. It describes the equipment of the

robot and its properties, the connection between the robot and

a server. The robot is controlled by a low-level protocol. To

control the robot remotely via internet, a web server was

created. All methods of a web service are described in this

contribution. Another section of the article deals with creating

an interface for using the web service. This interface was

created in Silverlight technology. We describe the possibilities

and the architecture of Silverlight. The last part of the paper

describes the application itself.

Keywords - Web Service, Remote Control, Control of Robot

I. INTRODUCTION

The area of the automatic control of a technological process is rapidly changing and growing. One very recent part of the area is the possibility of controlling remote processes on the Internet. There are many different approaches and protocols to implement this task. A very interesting approach appears to be the control of a remote process using web services. A web service is a very comprehensive and versatile tool to be used on different platforms.

A web service itself is just the means. It is necessary to create the appropriate interface. Web services and Silverlight might be a very good combination. It is a relatively new technology. Therefore, it should be explored in the area of an automatic control. This work deals with the implementation of this technology on a particular device of the Eurobtec IR52c robot.

II. EUROBTEC IR 52 C ROBOT

The model IR 52c is a five-axis robot of a total weight 23 kg from the company Eurobtec. The interval of supply ranges from 20 V to 40 V. Its maximum load is about 1 kg and the maximal velocity of the robot is around 1 m.s-1.

Robot axes are driven by five DC motors. The first three axes are driven by GR63x25 DC motors with a maximum torque about 118 N.cm. These motors spin an axis through worm gears and pulleys. The fourth and fifth axes are driven by GR42x25 DC motors, which a have maximum torque 20

N.cm. These motors also drive the axes through the worm gear and pulley. These axes have really good radii, which are shown in Fig. 1. These radii range from 210° to 300° depending on the axis. The last axis even allows a radius up to 360°.

Figure 1. Radii of Robot Axis.

Each axis contains a disk with slots and a set of LEDs, which form together an absolute position sensor. Through these slots the diodes are emitting pulses on the disk slots. This pulse is translated into a binary code, and gives us information about changes in the arm position. Each axis also has two end switches, which prevent a collision of the robotic arm with the robot´s body. Precise positioning of a robot axis is made by an incremental encoder. It changes the output signal at every step of the motor.

The control unit is used for the control of motors. This unit was developed specifically for the purpose of this type of robot. Motors are controlled by the PWM signal in a range of 15-20 kHz. A minimum PWM pulse width is 0.5 ms. The robot control unit has a maximum operating temperature of 64 °C. If the temperature is higher the unit is turned off in order to avoid damage to the control unit.

III. POSITION CONTROLLER

A position controller is connected to a computer via a serial line. A serial line must have settings of three pins, namely pins 2, 3, 5, and must be shielded. The maximum length of a cable is five meters. A position controller transmits instructions directly to the robot motion units. A scheme of a robot with a position controller and controller positions to PC is shown in Fig. 2.

326978-1-61284-361-2/11/$26.00 c©2011 IEEE

Page 2: [IEEE 2011 12th International Carpathian Control Conference (ICCC) - Velke Karlovice, Czech Republic (2011.05.25-2011.05.28)] 2011 12th International Carpathian Control Conference

Figure 2. Scheme of a robot with a position controller and controller positions to PC.

Instructions for the robot are transmitted from the PC to the position controller in the form of text strings. All communication is done via a low level ASCII protocol with the exception of some critical communication tasks, which are in a binary format. It ensures that the controller can be controlled directly by a simple terminal input. The command has the following format:

Command format: ABCx vw

ABC is a string of ASCII characters, x is an axis number and vw is a numerical value with or without an assigned number. A value ranges from -999999999 to +999999999 and depends on the command.

Essentially, the basic format of the command string consists of ASCII characters followed by the number of axes, followed by a space. It is written in a command value (e.g. position), the number of decimal places to nine. In the case when a command includes a number of axes that number begins with 0 and ends with the value n-1. Each command has to be finished <CR> (13d, 0Dh Enter-key). Without this end we receive an error message "unknown command". In the Tab. 1 are the basic commands.

TABLE I. USED COMMANDS

IV. WEB SERVICE

A Web service is a software system, which is designed to support interoperable machine-to-machine interaction over a network. It has an interface, which is described in a machine-processable format (WSDL). A system interacts with the Web service in a manner prescribed by its description using SOAP messages, typically conveyed using HTTP with an XML serialization in conjunction with other Web-related standards [1]. Web services provide a standard communication between different software applications, which can run on a variety of platforms and frameworks [1]. A Web service is an abstract thing. It must be implemented by an agent. The difference between an agent and service is that an agent is the concrete part of software or hardware that sends or receives messages. For example you can implement web services using one agent written in one programming language and a second agent written in second programming language. These two agents will have the same functionality. An agent could be replaced, but the web service stays the same [1]. Other terms are requesters and providers (see Fig. 3). The main purpose of a web service is to provide some functionality to the provider. In our case, the provider is an entity such as a person or organization [1]. The provider is somebody that provides an agent to implement a particular web service. A requester is a person or organization that wants to use the provided web service. The requester agent initiates the message exchange. But it is not always true. The message exchange between a provider and requester requires a web service description (WSDL) (see fig. 3). This web service description is provided to the requester. It is a machine-processable specification of the web service´s interface described in the WSDL document [1]. This document describes the message formats, datatypes, transport protocols and transport serialization formats that should be used between the requester agent and the provider agent [1]. It also specifies one or more network locations at which a provider agent can be invoked, and may provide some information about the message exchange [1]. The web service is connected to the interface application by using WSDL [1].

Figure 3. An example of using the web service [1].

2011 12th International Carpathian Control Conference (ICCC) 327

Page 3: [IEEE 2011 12th International Carpathian Control Conference (ICCC) - Velke Karlovice, Czech Republic (2011.05.25-2011.05.28)] 2011 12th International Carpathian Control Conference

In Fig. 3 is an example of using the web service. In general, there are many possibilities how a requester can use a web service. This figure describes the basic steps which are necessary [1]. The requester and provider become known to each other (or at least one becomes known to the other); (2) the requester and provider somehow agree on the service description and semantics that will govern the interaction between the requester and provider agents; (3) the service description and semantics are realized by the requester and provider agents; and (4) the requester and provider agents exchange messages [1].

V. WEB SERVICE USED TO CONTROL THE ROBOT

This chapter describes the creation of our web services which are used to control the robot and its functions. The robot is connected to a server by a serial port (RS232). It is visualized in Fig. 2. Therefore, the function of a web service necessarily includes instructions for operating and using the serial port. There are two basic development platforms for developing of web services in Visual Studio 2008 SP1. We can choose between them when we create a new project in Error! Reference source not found.4.

Figure 4. ASP.NET Web Service Application and WCF Service Application

We can create an ASP.NET Web Service Application and the WCF Service Application. ASP.NET Web Service Application is an older standard of Web services with limited capabilities, but with greater portability at different platforms (ASP.NET, PHP, Windows Forms Application, Smart Device Project, etc.). WCF Service Application is a newer standard, which was created especially for the needs of WPF and Silverlight applications.

However, it has more possibilities. The greatest benefits include the ability to use duplex communication between the web service and client. It is really an important advantage for the remote control of devices. This provides much better interaction between the device and the client. Web services use a fairly straightforward and somewhat limiting form of interaction. The client (our interface application) sends a request, waits for a response, and then processes it. This is a distinctly one-way type of

communication where the client must initiate every conversation. This model is no surprise, because it’s based on the underlying HTTP protocol.

Browsers request web resources while websites can never initiate connections and transmit information to clients without first being asked. Although this model makes sense, it prevents you from building certain types of applications (such as chat servers) and implementing certain types of features (such as notification). In our case we used the first possibility. We used ASP.NET Web Service Application. The main reason was to use a serial port for communication between the device and the server. This communication is very slow therefore the use of duplex communication would be ineffective. But it must be said that in other cases, the WCF Service Application is usually a much better solution.

Figure 5. Part of web service code

In Fig. 5 is part of the web service code for controlling the robot. It includes several basic elements. The first of them are imported libraries which are necessary to run this particular web service. In the next section we see the syntax description of the basic characteristics of the web service such as namespaces and the possibility to use Toolbox Items. An important part of the code is the syntax of the Web method where we write the web service functions. Cache Duration property is in our case necessary. It ensures the maximum interval of the web service methods and thus the maximum time when the web service controls the serial port. If this feature is set, the method of web services will lock the serial port.

Figure 6. Simple Interface of Web Service

328 2011 12th International Carpathian Control Conference (ICCC)

Page 4: [IEEE 2011 12th International Carpathian Control Conference (ICCC) - Velke Karlovice, Czech Republic (2011.05.25-2011.05.28)] 2011 12th International Carpathian Control Conference

Then, the actual code follows for the function of the web services. It is represented by dots. As an example, consider the function to initialize a robot. This function opens the serial port with certain settings and sends it via the robot's initial series of instructions (a string). These instructions contain information about the initial position, velocity and acceleration of the robot axes. It waits a few tens of milliseconds, and then reads the response from the serial port. Then, it closes the serial port and sends a response to the client. In addition, of course, this method contains the code that protects the application against crashing in cases such as a non- open serial port, etc.

The Web service includes other similar functions, which are consistent with the basic functions of the robot. These functions are described in Tab. 1. After building Web services, a simple interface can run in a browser. This interface is shown in Fig. 5.

This interface shows the basic methods of Web services. It also allows testing these methods, entering the required parameters methods and obtaining the return value from the methods (the robot response). Finally, there is also a link to the WSDL document that describes the Web service. The description is a list of methods for describing the required input variables and output response.

It is also necessary to create a clientaccespolicyfile that specifies the access rights of clients to a web service. This is an XML file, which lets the client receive a response from the web service (returns the value of the robot, such as the axis position of the robot) in the HTTP headers of SOAP communication protocol. This is necessary to follow especially if the interface will be created in Silverlight. We include this file directly in the project of the web service.

VI. SILVERLIGHT INTERFACE OF ROBOT IR52C

Silverlight is a framework for creating browser applications with many possibilities. These applications run on many operating systems and frameworks. Silverlight needs to work as a browser plug-in. When we open some web page with Silverlight content the plug-in is running. This plug-in processes the code and renders the Silverlight content. The Silverlight plug-in provides a much richer environment than normal HTML and JavaScript. It is very convenient for creating applications with a more complicated graphical user interface. Silverlight pages use interactive graphics and vector graphics. The Silverlight has alternatives which are still in use. Other technologies use plug-ins which including Java, ActiveX, Shockwave and most successfully Adobe Flash, but Silverlight uses more modern programming environment - .NET. The comparison of Silverlight and Flash follows.

The most successful browser plug-in is Adobe Flash. It is installed in over 90 percent of the world’s web browsers [3]. Flash has a longer history. It is possible to develop in .NET and use Flash content. However we have to use separate design tools and a completely different programming

language (ActionScript) and programming environment (Flex). If we use Silverlight we can use .NET languages (VB.NET, C#, etc.).

The Silverlight plug-in has a lot of functions, some of which are the same as in Flash, but a few of which are absolutely new (2D Drawing, Controls, Animation, Media, The Common Language Runtime, Networking, Data binding).

Silverlight is a new technology that doesn´t include some functions. For example Silverlight doesn´t support 3-D drawing, printing, command model, and a few controls like trees and menus. But all of these functions are contained in WPF and maybe they will migrate to Silverlight.

It was necessary to create an interface for the remote control of IR52c robot. After some consideration it was decided to set up an interface in Silverlight because it is a relatively new development tool and its options are not yet fully described. Its biggest advantage is the extra rich graphics tools. An environment interface should correspond to the previously described functions and propose a Web service for the remote control IR52c robot. As already mentioned in the previous chapter, Visual Studio 2008 in conjunction with Expression Blend 3 as a means of development were used The application itself is then created as one Silverlight content.

Figure 7. Silverlight Application for Control Robot IR52c

This Silverlight application in Fig. 7 is divided into several panels of importance. The first panel (1) shows us the output data from the robot. The current positions of all six axes are showing along with their conversion to a Cartesian coordinate system. On top of this panel, then there is a component for streaming a video webcam. This webcam is connected to a server and streams the video using the software WebCam XP. This component is able to receive the video. A component was created as an element for Blend3 Express. Its construction will be described below.

Below this panel are two panels side by side with buttons. The first panel (3) contains a series of buttons (start, stop all, switch on, switch off, stop or restart all) to run certain functions. There is mainly an initialization

2011 12th International Carpathian Control Conference (ICCC) 329

Page 5: [IEEE 2011 12th International Carpathian Control Conference (ICCC) - Velke Karlovice, Czech Republic (2011.05.25-2011.05.28)] 2011 12th International Carpathian Control Conference

button that starts the initialization sequence of the robot. After this sequence, the robot moves to its initial position and is ready to receive further orders.

The second panel of buttons (4) is used to switch panels for input data. These panels are labelled as (2). This is the input data communication setup, the input data for the manual control of individual robot axes, and the input data for the automatic control of the robot. The picture currently displays a panel to set the input parameters for serial port communication between the server and robot. The displayed parameters are default and they are set immediately after loading the Silverlight application. Other panels are the input parameters panel for manual control of the position of the robot axes and the automatic control panel for positioning the robot. The panel for the manual control of the robot has six smaller sections for each axis. For each axis, we can set its position by using the TextBox or Slider. We can also move the axis to stop using the Stop button. The possibility of collision of the robot with another object exists. It is necessary to stop the robot in this case.

The second panel contains components to set the robot trajectory. The element was again reprogrammed and can be used in other projects. The component allows adding, editing and deleting point trajectories. Calculating the robot trajectory is very difficult. Therefore, this panel was not completed. This panel does not work.

At the bottom of the application, there is a status bar (5), which shows the robot response. If the command was not executed, we get some error message.

ACKNOWLEDGEMENT

This research was supported by the Specific Research Project Area SP2011/18.

REFERENCES

[1] Booth, D., Haas, H., McCabe, F., Newcomer, E., Champion, M., Ferris, Ch., Orchard, D “Web Service Architecture”, W3C Working Group Note. Available from www < http://www.w3.org/TR/ws-arch/>

[2] Farana, R., Smutný, L., Víte ek, A. & Víte ková, M. “Zpracování záv re ných prací z oblasti automatizace a informatiky”, Ostrava 2004, 116p. ISBN 80-248-0557-X.

[3] MacDonald, M. “Pro Silverlight 3 in VB. Create cross-platform .NET opplications for the browser”, Apress New York 2009, 780p. ISBN 978-1-4302-2427-3.

[4] Parsons, A. “Visual Basic 2005 Express Edition Starter Kit”, Wiley Publishing, Inc. Indianopolis 2006, 358p. ISBN-10: 0-7645-9573-3, ISBN-13: 978-0-7645-9573-8.

[5] Phaithoonbuathong, P., Harrison, R., West, A., Monfared, R., Kirkham, T. “Web services-based automation for the control and monitoring of production systems”, In International Journal of Computer Integrated Manufacturing. London, Vol. 23, No. 2, February 2010, 126–145. ISSN 0951-192X.

[6] Shklar, L., Rosen, R. “Web Application Architecture Principles, protocols and practices”, Wiley Publishing, Inc. Indianopolis 2003, 358p. ISBN 0-471-48656-6.

[7] Stephens, R. “Visual Basic 2005 Programmer´s Reference”, Wiley Publishing, Inc. Indianopolis 2005, 1022p. ISBN-13: 978-0-7645-7198-5, ISBN-10: 0-7645-7198-2.

330 2011 12th International Carpathian Control Conference (ICCC)