Remote controlled mechatronics device via Internet using Matlab 1

0 downloads 0 Views 562KB Size Report
based on Matlab/Simulink and xPC Target toolbox. Described ... The basis of communication between a user and a executive server which run the DC-motor is.
Remote controlled mechatronics device via Internet using Matlab Riko Šafarič, Suzana Uran, Mitja Truntič, Igor Hedrih Faculty of Electrical Engineering and computer sciences, University of Maribor

Key words: Remote engineering, education of control theory Abstract: Recently much attention has been focused on modern control education. The new tools for education emerged and one of most promising is a Remote Rapid Control Prototyping (RRCP), which has a great impact on Control Systems used in industry and on control education. In the paper an example of introductory control course with integrated hands on experiments is represented. Some experiments are Web based while the others are real hands on remote experiments performed using different kind of mechatronics devices. The aim of integration of hands on experiments into control course is to minimise the gap between the theory and practice and to teach students the use of Web and RRCP. Developed RRCP is based on Matlab/Simulink and xPC Target toolbox. Described course was running for the first time in the previous school year and the first experiences gained are represented.

1 Introduction Recently much attention has been focused on modern control education in Engineering. A leading idea to all educators was given in [1]: “ Educators must have an open attitude towards new technologies. They should sensibly incorporate new technological development to avoid the risk of teaching the students of today, how to solve the problems of tomorrow, with the tools from yesterday.” Nowadays two new tools: the Web (Internet) and the Rapid control prototyping have a great impact on Control Systems used in industry. The Web influences the industry because it enables supervision and teleoperation of devices (cost reduction). The Rapid control prototyping influences the industry because it saves time needed for a development of control approaches for different devices and therefore reduces control development costs for 30 to 40%. Both mentioned tools also (could) have a great impact on control education. The impact of the Web was extensively discussed in [1]. Different designs of Web based control labs are represented in [2, 3, 4]. The Web enables more flexible delivery, distance education, new visualisation possibilities (interactivity) and cost reduction. The impact of RCP is more limited to control implementation. RCP frees control implementation of particular implementation details, like coding the controller algorithm in C language for computers, and therefore speeds up implementation of control approaches. This performance makes RCP suitable for hands on, experimental learning of control. The control education up to date was suffering due to the gap between the control theory and practice. This gap appeared because the implementation of control algorithms was not or only now and then covered during the control courses. The control implementation was not covered in courses due to high time demands and a lot of implementation details with no close relation to the control. Today Rapid Control Prototyping seems as described in the previous paragraph could help us to avoid the gap between the control theory and practice [5, 6].

In the paper, an example of introductory simple DC-motor controller and more complicated 6 D.o.F robot controller with integrated remote Web based and real hands on experiments is represented. We called it a Remote Rapid Control Prototyping. The concept with the remote computer, internet, an executive server and the lab is shown in the Fig. 1. The integrated experiments are structural exercises and are not a replacement for laboratory exercises, nor the project based learning of students.

Lab Laboratorij Student Študent

Internet

Executive server Strežnik

Figure 1: The concept of RRCP in the educational process

2 Remote control of a DC-motor 2.1

XPC Target system

The basis of communication between a user and a executive server which run the DC-motor is linked by xPC Target operational system that is a toolbox of MATLAB/Simulink 6.1 programme package. xPC target system enables an execution of the application in an external mode. xPC Target is a solution for a fast prototyping, testing, and deploying real-time systems using standard PC hardware. It is an environment that uses a target PC, separate from a host PC, for running real-time applications. In this environment the desktop computer is used as a host PC with MATLAB®, Simulink®, and Stateflow® (optional) to create a model using Simulink blocks and Stateflow charts (Fig. 2). After creating the model, the user can run simulations in non-real time. xPC Target lets you to add I/O blocks to your model, and then use the host PC with Real-Time Workshop®, Stateflow Coder (optional) and a C/C++ compiler to create executable code. The executable code is downloaded from the host PC to the target PC running the xPC Target real-time kernel. After downloading the executable code, the user can run and test his target application in a real time. Stand-alone applications can be created for the target PC independent from the host PC that can boot from a floppy drive or an alternate device.

Figure 2: The use of xPC OS

2.2

DSP-2 card and DC-motor

The DSP-2 card is a stand alone computer application [10]. It has integrated several A/D, D/A and incremental encoder channels with added analogue current controller amplifier which runs the ESCAP 28D11 DC-motor (see Fig. 3). It is connected to the executive server via RS232 serial communication channel.

Figure 3: Digital signal processor card with DC-motor

We have built two applications including xPC Target system toolbox. The first one give the user (student) oppurtunity to develop the complete controller using MATLAB/Simulink/Real time Workshop program package. Of course the student need to install the complete MATLAB with neccessary toolboxes on the remote computer. The example of the student programme made in Simulink with the help of Real Time workshop toolbox for the DC-motor is shown in Fig. 4. Fig. 11 shows the XPC targetWEB control panel where the user can change some parameters of the control scheme and run the remote application. The grafical interface (Fig. 10) is used for observing the actual and other values of the controlled DCmotor.

Figure 4: Simulink block scheme of the remote DC-controller The other possiblity to run remote DC-motor from the user‘s computer is from the user‘s browser. In this case the user is able only the parameter tuning and observing the actual and desired curves of DC-motor position controller via internet as it is shown in Fig. 5. In fact, such an approach is not completly rapid prototyping system, just remote control system.

Figure 5: The applet for remote PID position controller of the DC-motor

3 Remote control of 5 D.o.F. robot mechanism The remote laboratory approach is based on the concept that it provides a working facility for off-line programming of actual working robot arm in a remote environment and hands-on training. It is desirable that the robot simulation should be capable of being executed through any standard WWW browser application, e.g. Netscape Navigator, Microsoft’s Internet Explorer etc and VRML browser, e.g. Cortona or Cosmo Player etc. Standard browsers for the VRML 97 language don't incorporate collision detection between shapes in the virtual world [7]. Because the adopted control strategy does not provide the remote user with immediate feedback from the actual work-cell, it is desirable that some kind of collision detection between the virtual robot and the virtual environment is created to prevent, or to predict, robot collisions in the real world. This problem has been solved by building JAVA oriented collision detection software [8] to assure platform independent approach. The physical test equipment includes: a WWW network server, a network layer, a robot workcell, and remote user computers (see Fig. 7).

Figure 6: A robot workcell

Rlab

Figure 7: The robot interface between servers and a client

The robot work-cell, shown in Fig. 6, allows Point to Point (PTP) motion of the robot in the joint space. The robot data and environment are constant and are set in the VR software. The remote motion data for the robot arm mechanism are programmed and controlled, respectively, by the user. The work-cell includes the 5 axis educational robotic arm, which has P-position controllers written by Mathworks’ MATLAB (ver.6.1) / Simulink / Real Time Workshop / xPC Target fast prototyping software. The program is executed by xPC operating software on the executive PC server. The WWW network server is responsible for processing the requests done by an external WWW browser, installed on the user’s remote personal computer, delivering on-line documents and providing access to the robotic and control hardware. 3.1

Software organisation

The development of an improved human computer interface, integrating the Java language and VRML language within a non-immersive desktop virtual reality environment, was undertaken in order to help improve the realism and sense of presence the user feels when programming the robot. This simulation tool allows the kinematics behaviour of the system to be studied, and permits research into task planning, process synchronisation and the communication issues involved with the control of robotic manipulators. The additional processes which are executed by the RLab server are shown in Fig. 7. Fig. 8 illustrates the users view of the robot model and its associated 'virtual' teach pendant.

Figure 8: Virtual teach pendant and robot model

3.2 Robot mechanism Robot arm has five degree of freedoms. Mechanical part mostly it is made of plastic and some metal parts. Robot arms and a gripper are driven with six DC motors with permanent magnets. Every axis of the motor has also an incremental encoder. The personal computer (PC) is used for the controlling of all axes of the robot. The controller, which performs time intensive, but simple logical operations, is between the PC and the mechanical part of the robot. The robot controller achieves a constant sampling time for the position control loops, leaving the RLab server free to concentrate on the network interface and services of user browser requests, thus overcoming the aperiodic sampling problems. 3.3

Communication between a robot arm and a user

We have crated stand-alone GUI applications, called RLab on the host PC server, to control, change parameters and acquire signal data from a target application. RLab is a collection of web applications, which represent a main part between a user and a robot. It is divided in four parts. RlabClient represents a user interface for guiding the robot with addition of VRML model of the robot. RLabExecutiveProxy serves for transferring data from RlabClient to the xPCproxy. On the other side of the xPCproxy is the xPC Target, on which the application for guiding the robot is loaded. Application is first created in Simulink and then it is loaded on xPC Target. xPCproxy has a web application for administrating the projects. This application enables loading, starting and deleting projects of xPCTarget computer. Robot arm can be controlled over internet on four different ways: - from Matlab command window, - Internet browser, - direct communication with Simulink model (external mode) and - with Rlab GUI. A basic way of communication with RLab server is over Matlab command window (Fig. 9). Matlab’s command interface consists of: control of target application, changing parameters and acquire signal (Fig. 10). GUI is a part of Matlab command interface and can be used on the executive PC server or over internet browser.

Figure 9: The MATLAB/Simulink model

Figure 10: Graphical user interface of xPC Target Functions of target applications are: transfer of application on a target PC, start and stop of application execution, change of sample and stop time, detection of processor overload and statistics of executing of the application. The Matlab interface contains functions for adjusting the parameters on target PC. When we change one or more parameters in Simulink, then these new values are transferred to the target PC immediately and we can observe response of the application. The command interface (Fig. 11) enables simple acquiring data from executive (target) PC server. We can execute signal logging, so that all data are stored from whole time of application execution. Values are stored in RAM on target PC server. After stopping the application the files can be transferred to host PC server (RLab). Alternative to acquiring signals is tracking the signals like digital scope. Data can be presented numerically or graphically. 3.4

Robot remote control with RLab

The remote user is connected to RLab’s WWW site to register the job using an on-line form. The user details are processed by a CGI program running on the server, to determine user authentication, access control and job queue status experiment. If the robot is currently in use then the users may decide to cancel their job and try again later, otherwise the file is placed in a queue for execution at a later date. In this case an acknowledgement will be returned to the user and the results stored in an on-line archive for retrieval at a later date. Real time manipulator control is achieved using a separate computer (PC) control system. However, the

existing controller requires that set points for limb movement, motor drive characteristics, process status, etc. are provided as a stream of parameters from a host computer, in this case the server, to the robot’s own control system, thus necessitating the development of a replacement command scheduling program written by Mathworks’ MATLAB (ver.6.1) / Simulink / Real Time Workshop / xPC Target fast prototyping software.

Figure 11: Web interface for controlling the application The user invokes the experiment with simple start in the browser with RLab WEB address which is run and seen on the user side (see Fig. 10). The user has to connect the client browser to the RLab via internet, type the password and choose the right application. The next step is initialisation which lasts between five and ten seconds. Here, the Java collision detection code and VRML code for the particular application are downloaded to the user computer. After this step, the user sees the teach pendant in his VRML browser and is able to communicate with an “on-line execution part” of the RLab server. A job scheduling and a data acquisition block of the on-line execution part of the RLab server, or simply xPC proxy, communicates with the executive PC server, which runs the robot arm via internet. The user is able to run the real robot mechanism with simple point-to-point (PTP) movement commands and receive the actual position values of the real robot arm. The user is also able to build and design his own position controller of all fife axis with MATLAB/Simulink package what give the users the whole versatility’s of Remote Rapid Prototyping. The robot arm teach pendant’s collision detection library and its interface to the VRML robot model and communication with a browser has been described in [9].

4. Conclusion The paper presented two RRCP mechatronics applications: a simple DC-motor and more advanced robot arm applications. The focus of the presented RRCP applications was to make a useful educational tool for teaching the basis of Control theory and Robotics at the University of Maribor. The students were able to do several remote “experiments” via the internet and learn the design of the velocity and position controllers of simple DC-motor with the well known and very successful educational tool MATLAB/Simulink. Due to very complicated xPC Target application, which allows students to do the full DC-motor RRCP application with their own built controllers, we also introduced simpler version of the same experiment, which allow the students only PID controller parameters design via WEB applet. So, the beginner students would not spent to many time to learn more or less user unfriendly xPC Target system. The other remote experiment, the robot arm remote control, also had the possibility to be the full RRCP system but because of practical reasons (the danger of damages on the hardware) only the teachers and assistants were allowed to do their own full RRCP applications. The students were limited with the RLab intelligent interface which prevent controller parameters changes and collision of the robot arm with itself or its environment.

References: [1] Dormido, S.: Control Learning: Present and Future, In Proc. 15th IFAC World Congress on Automatic Control,Barcelona, Spain, 2002. [2] Schmid, C.: Internet-basiertes Lernen, Automatisierungstechnik, vol. 51, No. 11, 2003, pp. 485493. [3] Casini, M.; et all: The Automatic Control Telelab, IEEE Control Systems Magazine, vol. 24, No. 3, 2004, pp.36-44. [4] Hoyer, H. et all: Reale Systeme im “virtuellen Labor“, Automatisierungstechnik, vol. 51, No. 11, 2003, pp. 501-507. [5] Schlosser, A; et all: Rapid Control Prototyping in der Lehre ”, Automatisierungstechnik, vol. 52, No. 2, 2004, pp. 75-80. [6] Shiakolas P.S.; Piyabongkarn, D.: Development of a Real-Time Digital Control System with HIL Magnetic Levit. Device for …”, IEEE Transactions on education, vol.46, No.1, 2003, pp. 79-87. [7] Šafarič, R.; Debevc, M.; Parkin, R. M.; Uran S.: Telerobotics experiments via Internet, IEEE transactions on industrial electronics, 2001, vol. 48, no. 2, pp. 424-431. [8] Šafarič, R.; Calkin, D. W.; Parkin R. M.; Czarnecki, C. A.: Virtual environment for telerobotics. Integrated. computer.-aided engineering, 2001, vol. 8, no. 2, pp. 95-104. [9] Šafarič, R.; Šinjur, S.; Žalik, B.; Parkin, R. M.: Control of Robot Arm with Virtual Environment via Internet, Proc. I.E.E.E., 2003, vol. 91, issue 3, pp. 422-429. [10] Uran, S.; Hercog, D.; Jezernik, K.: Experimental learning based on DSP-2 learning module, To be published in the Conference ICIT’04, Hammamet, Tunisia, December 2004.

Authors: Prof. Dr. Riko Šafarič, Asis. prof. Dr. Suzana Uran, Mitja Truntič dipl. ing., Igor Hedrih dipl. ing. University of Maribor, Faculty of electrical engineering and computer science, Institute for robotics Smetanova 17, 2000 Maribor, Slovenia Emails: [email protected], [email protected], [email protected], [email protected]