You are on page 1of 5

Web Based Laboratory for Controlling Real Robot Systems

Chris Messom and Robert Craig, Institute of Information and Mathematical Sciences, Massey University, New Zealand {C.H.Messom, R.G.Craig} Abstract
This paper introduces a web based workbench for experimenting with the PID controllers of a real mobile robot. The first contribution presented is the use of 3D reconstruction rather than video streaming for viewing the robot experiments. The low band width required allows students studying via distance education, using slow modem links, to independently access the experiments and complete them in their own time. The second contribution presented is the use of stored results of experiments to improve the operating efficiency of the experiment

platform. 1. Introduction
Resource constraints have forced engineering schools to reduce laboratory facilities and search for more cost-effective methods of experimentation (Magin et al. 2000). Virtual laboratory environments allow students to work with simulated hardware permitting students to gain an understanding of the principles governing the operation of the hardware at their own pace, with as many repeat experiments as necessary, and without the requirement of technical supervision. However simulation is often a simplification of the real system leaving the student ill prepared to work with the real device. This can be illustrated by the example of building simple electronic circuits, where the troubleshooting process represents the most significant challenge after assembling a circuit that had proven to be faulty. A simulation of the experiment would allow a perfect circuit to be built to support the pedagogical goals of understanding the concepts but at the same time lulls the student into a false sense of security. To develop the complete skills required to build real systems it is necessary to experience the mismatch between theory and experiment caused by unexpected breakdowns and interference (Grant 1995). A more sophisticated simulation or a real circuit would be required to achieve this goal. Experiments that require cheap equipment and components are frequently conducted on real physical systems. Only when equipment costs become large is there an incentive to simulate the system. This paper proposes an alternative approach; namely remotely accessing expensive equipment in a time-shared manner. Ko et al (2001) have reported the use of a web based approach that streams video and audio of the experiment. A limitation of such an approach is that the bandwidth required is normally only available on a local area network. The experiments discussed in the following sections are the control of a mobile robot using a proportional, a proportional-derivative and proportional-integral-derivative controller to achieve a given position set point. The experiments are progressive and allow the student to gain an understanding of the three different types of controllers, the effect of modifying the control parameter on the rise-time, overshoot, settling time and steady state errors of the

control system.

2. System Overview
The mobile robot system consists of a camera that provides a NTSC video signal of the field. The signal is captured and processed identifying the robot position (x, y) and orientation (angle). This information is then transmitted over the network to the robot controller program that uses the current error in the control variable to calculate and wirelessly transmit the required control signal to the robot. The position and orientation information is also made available to the webserver so that the data can be transmitted to client programs that request the information. See figure 1 for a schematic overview of the mobile robot system.
Image Processing Station Network Switch Tx Robot Controller Web Server Internet Gateway

Figure 1. Overview of the mobile robot system The complete equipment costs (mobile robot, camera, image capture board and PC) are in the order of $10,000. This figure is not excessive but expensive enough that dedicated equipment is not available for individual students. Figure 2 shows the physical robot system.

Figure 2. The robot soccer platform

3. Web Based PID Experiment

The PID experiment, implemented as a prototype, allows the experiment results to be visualised using plots of the robot data and analysed by calculating the rise time, overshoot, settling time and steady state errors. Given a series of experiments the relationship between the controller parameters (Kp, Ki and Kd, see equation 1) and the rise time, overshoot, settling time and steady state errors, can also be examined.

U = Kp.error + Ki. error dt + Kd.derror/dt equation 1. The student conducting the experiments is connected to the system as a web client. The client receives the robot position (x, y) and orientation (angle) information and reconstructs the video image. A 3D view of the robot motion is reconstructed so that the detailed movement of the robot can be seen. Cheng et al (2001) provides analysis of the band width advantage of using image processing to identify positions and orientation of robots and transmitting this data rather than the complete video image. They investigated reconstructing the video image provided by the overhead camera, which views the field as a planar 2D space. This paper extends the idea by reconstructing the scene viewed from any position in 3D. The web based laboratory is particularly suitable for managing remote access to laboratory exercises for students studying via distance education. The alternatives are to transport the equipment to the students (highly impractical for expensive equipment that must be used continuously to provide a return on the investment), or transport the students to the experiment, also impractical if the experiment is just a part of a selection of pedagogical tools.

4. Software System
The software structure of the web based laboratory consists of client programs that interact with a real-time controller via a webserver. 4.1 Client Program Structure

Figure 3. Client Work Bench

The client program is a JavaTM program that can run as an independent application or as an applet running inside a browser. The client program provides a user interface to the real robot system. The student has user interface controls to reset the experiment, set control parameters, start and stop the experiment and observe the results (see figure 3). The Java 3DTM animation produces a photorealistic view of the experiment in real time. 4.2 Client-Server Communication The client experiment workbench communicates with the server using http protocol. The client makes GET and POST calls on the server which services the requests, resolves conflicts between multiple clients and passes on the request to the robot control server. The server returns data in XML format allowing the information to be available to any client that is capable of parsing the file. The client uses http protocol to retrieve the current experiment state. The experiment state data must not be of high frequency to minimise the load on the server. Since the sample time of the mobile robot control system is 33ms the frequency of the data generated is low and the load on the web server has not been a problem. 4.3 Server Program Structure The server side structure is more complex because the clients do not directly interact with he experiment. A web interface controls the client view of the experiment. Currently the web interface is implemented in php, but a servlet implementation is being investigated. The web interface program receives requests from the client programs, which are then resolved to identify the currently active client. The web interface acts as the manager of the experiments, time sharing the equipment between the currently logged in clients. In this manner the experimental equipment is also secured from malicious client interaction. The interaction between the web server and the experiment server is in a raw data format. XML format is not used, as additional load on the experiment server would make it difficult to satisfy the real time control requirements of the experiment. A disadvantage with this approach is that the modification and upgrade of the experiment and the data transferred will require synchronised code modifications on both the web components and the experiment server. A process that is normally difficult to manage especially when there are multiple versions of the system in production. However with the current technology and the performance of the hardware this is the only practical solution.

5. Discussion
The PID experiment prototype allows any value of control parameter ( Kp, Ki and Kd ) to be specified by the student. Some combination of values may result in the experimental system becoming damaged. Fail-safe features must be built into the robot controller to overcome this issue. Another problem associated with the variety of possible experiments that can be conducted is pedagogical. A student new to the topic may have little idea about what are reasonable control values to apply. A large number of experiments might be applied before a satisfactory control performance is achieved. This negative reinforcement is not suitable for effective learning. An alternative approach is to give a limited number of control parameters from which to choose. Selecting the control parameters from a given list will reduce the number of possible combinations and increase the chance that feasible experiments are conducted. For an experiment that has been designed for pedagogical (or safety reasons) with a limited number of parameters, an efficiency in the web based experiment can be exploited by storing

the results of the experiments at the webserver. Given the limited combination of possible control parameters there will be a large number of students experimenting with identical parameters. If a student accesses the system but the robot hardware is already in operation a randomly selected set of data from a previously stored experiment with the same control parameters should be returned to the client. The student will not necessarily be aware that the results are not being produced in real time. The amount of data produced per experiment is not large. The PID control experiment discussed above only needs to store the x position of the robot every 33.3ms. The raw data calculated by the image processing system is the position, (x, y) and orientation (angle). In floating point representation this will require 12 bytes of memory storage for each frame of the video image. The video system operates at 30 frames per second, which translates into approximately 400 bytes of storage form each second of experimentation. For an experiment that lasts 30 seconds it will require a total of 30/s * 30 s * 3 * 4 bytes = 10,800 bytes 10.5kB. On modern storage systems with a capacity of more than 20GB a total of over 2 million experiment results can be stored. This indicates that for the experiments described, storage of historical results is a feasible approach.

Using the storage of past results the web based experiment can produce levels of efficiency in experimental platform usage that have not been possible in prior modes. The web based workbench effectively multiplexes multiple students' experiments on a single lab platform gaining efficiencies that are proportional to the number of concurrent users of the

system. 6. Conclusions
This paper presented a proof of concept system aimed at demonstrating the feasibility of remotely accessing real experimental equipment for pedagogical purposes. It has been shown that it is possible to provide web based access to laboratories and visualisation using realtime 3D animation. A prototype laboratory experiment for teaching basic concepts of control system design has been implemented. This prototype will be further developed and tested in our control systems paper so that its efficacy can be investigated. Future developments to the system include further student management facilities; particularly interfaces to standard web based instructional management systems such as WebCT and Blackboard. Other extensions that will be investigated include interfaces to intelligent tutoring systems so that the experimental exploration can be guided by the system providing the student suitable scaffolding as the experiment unfolds.

C.D. Cheng, P. Vadekkepat, C.C. Ko, B.M. Chen and X. Xiang, Robot motion Control and Image Reconstruction over the Internet , Proceedings of CIRAS 2001, Singapore, 423- 428. A. Grant, The Effective use of Laboratories in Undergraduate Courses, International Journal of Mechanical Engineering Education, Vol 23, pp 95-101, 1995. C.C. Ko, B.M. Chen, J. Chen. Y.Zhuang and K.C. Tan , Development of a Web-based Laboratory for control experiments on a coupled tank apparatus, IEEE Transactions on Education, Vol 44, No 1, pp. 76-86, February 2001. D. Magin and S. Kanapathipillai, Engineering Students' Understanding of the Role of Experimentation, Dec 2000, European Journal of Engineering Education, Vol 25, pp 351 358, Abingdon.