Web Controlled Educational Robot

77 downloads 0 Views 397KB Size Report
motor control, Java and C language programming, web graphical user interface ... Java language is taught. .... [2] Absolute Beginner's Guide to Building Robots, ...
Web Controlled Educational Robots Verónica Vasconcelos (1), Inácio Fonseca (1), Micael Couceiro (2), Carlos Figueiredo (2) (1)

Instituto Superior de Engenharia de Coimbra Rua Pedro Nunes - Quinta da Nora - 3030-199 Coimbra {veronica, inacio}@isec.pt (2)

Students at the Instituto Superior de Engenharia de Coimbra Rua Pedro Nunes - Quinta da Nora - 3030-199 Coimbra {micaelcouceiro, ccfigueiredo}@gmail.com

Abstract This article describes a radio-frequency controlled mobile robot, monitorizated and controlled through an embedded Java microcontroller. This project included the mobile robot design and building, as well as the control and communication software. This multidisciplinary project allowed students to learn and apply different areas of knowledge, including mechanical robot construction, electrical motor control, Java and C language programming, web graphical user interface design, real time control and RF communications. The interface with user is made with a friendly Web page allowing the control of the robot motion in real time. The user can also visualize the orientation and x-y coordinates of the robot. Keywords: Mobile Robot, Step Motors, Graphical User Interface, Real Time Control, RF Communication.

1. Introduction New technologies can be used as a teaching tool, especially when used in practical projects that catch the student’s attention. This article describes a project developed by a group of two students from the Electrical Engineering course of Instituto Superior de Engenharia de Coimbra (ISEC), in the subject of Complements of Programming where Java language is taught. Students had an enthusiastic reaction to the proposed project especially because they had the opportunity to apply different areas of knowledge they had been learning during the first years of their course. Students had to design and assemble the robot mechanically and electronically, learn how to control the robot, study the robot’s motion and write high and low level software. When we have high school visiting the Electrical Engineering Department of ISEC, this project is often used to motivate and encourage them to opt for technological courses. The robot is controlled through a PIC 18F258 microcontroller that receives wireless commands at a bit rate of 19200 bps. The interaction with the user is made through a Java Web page, whose HTTP server is located in a TINI board. In Fig. 1 we can see some photos of the project and the relation between the main parts.

Browser running an applet

RS232/RF

TINI – DS80C400 With the Java HTTP Server

Internet

Fig. 1 – System overview.

In the TINI a Java program that implements the HTTP/1.1 norm is running. When this program receives request from the browser, it sends the HTML page where the JavaApplet that controls the robot is included. The exchange of the control information can be seen in Fig.2. PC / TINI HTTP Server Port: 80 Socket Server Port: 6000

ROBOT

HTTP traffic

PC with a Browser Applet running on browser sends commands and receives answers from the Socket

Bidireccional Socket

Fig.2 – Exchange of information between the browser’s user, the TINI DS80C400 board and the mobile robot.

2. Building the Mobile Robot Some of the material used in the robot is reused from obsolete or damaged equipments motors have been recycled from damaged printers, and the rechargeable battery has been recycle from a laptop. The robot is fed through a 14V rechargeable battery that is composed of four series modules each one composed of two rechargeable parallel modules of 3.6V/1700 mAh. Fig. 3 shows, on the left, a photo of the robot platform, and on the right of the figure we can see a top photo of the robot with the board designed to control the robot’s movements where we can identify the main parts of this board.

Driver Motor1 Pic

Battery

RF

Motors

Driver Motor2

Serial

Free wheel

Fig.3 – Photo on the left: position of the motors, battery modules and the rear wheel of the robot. Photo on the right: top photo of the board that controls the robot motion.

The access to the robot is wireless using a half-duplex RF ER400TRS module from the easyRadio that operates in the 433-434MHz band. This module implements data error correction through packet radio protocol. Packet Radio is a form of digital data transmission frequently used in amateur radio, to construct wireless computer networks. Its name is a reference to the use of packet switching between network nodes, which allows multiple virtual circuits to coexist on a single radio channel. Packet radio networks use the AX.25 data link layer protocol, derived from the X.25 protocol. The robot’s platform is controlled by the PIC18F258, a powerful 10 MIPS microcontroller CMOS Flash-based 8-bit microcontroller, programmed in C language using the sdcc 2.6 compiler. The PIC18F258 is a high-performance RISC CPU operating a 25 MHz with a 10 bit 5 channel analog to digital converter, watchdog timer with on-chip RC oscillator, 22 I/O pins, 3 I/O ports, three external interrupt pins, 4 timers, PWM module, 3-wire SPI (supports all 4 SPI modes) and a CAN bus module features that conforms to CAN 2.0B. Fig. 4 describes the feeding circuit of the robot platform that allows the control of the step motors. L293D +5v

Output1 Output2 Output3 Output4

PIC18F258 1 2 3 4 5 6 7 8 9 10 11 12 13 14

X1

Vpp RB7 RA0/AN0 RB6 RA1/AN1 RB5 RA2/AN2 RB4 RA3/AN3 RB3 RA4/T0CKI RB2 RA5/AN4 RB1 VSS RB0/INT OSC1/CLKIN VDD OSC2/CLKOUT VSS.1 RC0 RC7/RX RC1 RC6/TX RC2 RC5 RC3 RC4

28 27 26 25 24 23 22 21 20 19 18 17 16 15

Output8 Output7 Output6 Output5 Output4 Output3 Output2 Output1

+5v

Output8 Output7 Output6 Output5

C1

+5v +12v

G G G G N N N N D D D D

2 7 IN1 10 IN2 15 IN3 IN4 1 9 EN1 EN2 8 16 VS VSS

OUT1 OUT2 OUT3 OUT4

3 6 11 14

Fase5 Fase6 Fase7 Fase8

G G G G N N N N D D D D 4 5 12 13

Fase4

Fase7

6

4

1 2 3

6

Fase6

5

SerieRX

Fase1 Fase2 Fase3 Fase4

Motor de Passo 2 Fase5

1 2 3

4

RSSI BUSY DATA OUT DATA IN HOST RDY VCC GND

Fase2

5

Motor de Passo 1 Fase1

ANT RF GND

3 6 11 14

L293

+5v

Crystal

ER400TRS

OUT1 OUT2 OUT3 OUT4

4 5 12 13

+12v

SerieTX SerieRX

C2

2 7 IN1 10 IN2 15 IN3 IN4 1 9 EN1 EN2 8 16 VS VSS

SerieTX Fase3

Fase8

+5v

Fig. 4 - Electric schematic of the hardware used to control the mobile robot platform.

3. TINI – The Micro DS80C400 In this project we chose a DS80C400 network microcontroller that quickly and easily adds Ethernet/Internet connectivity to our robot. The DS80C400 offers different types of peripherals including: a 10/100 Ethernet MAC, three serial ports, a CAN 2.0B controller and 1-Wire® Master. This network microcontroller can be programmed in Java, C or assembly language. We chose Java language, thereby allowing us to take advantage of the extensive software libraries available for the TINI platform. This board is completely independent and can locally save about 1 Mbyte of files and Java programs in its filesystem. In the application presented here, the TINI’s serial port is used to communicate with the wireless module, sending the commands to the robot. The Ethernet interface is used to bring TCP/IP connectivity and is responsible for answering to HTTP page requests and for resending the commands (through a socket link) to the mobile robot. The HTTP server uses serial ports and Ethernet to exchange information with the mobile robot and with the client browser, where the applet that sends commands to control the robot is located. In practice, the TINI works like a gateway. In summary, there are two programs running: The HTTP server that sends the page that allows the robot control. This server answers to request made in port 80; The socket server that receives orders from the Applet that is loaded by the user browser when the user accesses the web page. This service answers to requests made in port 6000.

Fig. 5 - Some of TINI - DS80C400 peripherals used in this project.

4. Interaction between the Robot and the Browser After validation, the user can configure a set of parameters and control the robot’s movements and velocity, in real time. The commands can be sent through either a set of buttons or by using the laptop keyboard (in Fig. 6 the browser interface can be seen). At the same time we can visualize the x-y coordinates (in centimetres) and the orientation of the robot. The information is processed in the applet and sent to the microcontroller in the format indicated in the expression (1). direction rightWheel leftWheel time

(1)

The first byte corresponds to the direction of rotation of the wheels, clockwise or counter-clockwise. The second and third byte assumes the value "0" or "1", when the respective wheel moves forward, backward or turns. The robot’s position is asynchronously updated through the program that is running in the TINI (socket server) and sent to the Applet.

(4)

Fig.6 – Interface with the user: 1- Some setting parameters. 2- Set of buttons that allows the control of robot movements and the robot’s velocity. 3- Some complementary information. 4 – Position and orientation of the robot.

5. Conclusions This project allowed the students to acquire knowledge in different areas: mobile robotics, control, mechanics and different programming languages. The purpose of this multidisciplinary project was the construction of a simple and versatile mobile robot that motivates students to apply the knowledge learnt throughout the course in practical situations. The robot’s motion is controlled in real time through commands sent from a Java web page. In future work, we are considering allowing the user to see in the browser what is being visualized by the robot, in real time, with the help of a camera that is attached to the robot. The RF communication will be substituted by RF 802.11x modules that allow IP communication. The step motors will also be substituted by DC motors. The robot platform was built in a way that is easy to include different types of sensors that can increase the robot autonomy especially in non controlled environments. References [1] Building Your First Robot, http://www.robotics.com/arobot/build.html [2] Absolute Beginner's Guide to Building Robots, http://www.streettech.com/robotbook/ [3] TINI – DD80C400, http://www.maxim-ic.com/products/microcontrollers/tini/ [4] PIC C Compiler, http://sdcc.sourceforge.net, http://www.microchip.com [5] Radio Module, http://www.easy-radio.co.uk/ [6] B. Eckel, Thinking in Java, Prentice-Hall, 2002, New York. [7] Java Compiler, http://www.java.com