Docstoc

CSE 400 Serious Proposal

Document Sample
CSE 400 Serious Proposal Powered By Docstoc
					          Lego Mindstorms
                        Fei Jin
                     Jennifer Gau




Advisor Signature____________________________________
TABLE OF CONTENTS
Abstract ............................................................................................................................... 3
Problem with Mindstorms.................................................................................................. 4
Progress as of December 5, 2002....................................................................................... 5
   Background Research ............................................................................................................... 5
   Coordination with Other Groups ............................................................................................ 5
   Robot Design and Construction ............................................................................................... 5
   RCX Firmware .......................................................................................................................... 6
   LeJOS and Java ........................................................................................................................ 6
Revisions from Original Proposal ..................................................................................... 7
Potential Obstacles and Solutions ..................................................................................... 7
Expected Results ................................................................................................................ 7
   Scenario ...................................................................................................................................... 8
   Crucial Elements ....................................................................................................................... 8
   Diagram – Controller to Robot Communication ................................................................... 8
   Diagram – Robot to Remote Communication ........................................................................ 9
Revised Timeline .............................................................................................................. 10
Description of Prior Work ............................................................................................... 10
   Introduction ............................................................................................................................. 10
   History ...................................................................................................................................... 10
   Development of Other Programming Environments ........................................................... 11
       NQC .....................................................................................................................................................11
       LEGOS ................................................................................................................................................12
       LEJOS ..................................................................................................................................................12
       J-STAMP .............................................................................................................................................13
       JREALTIME ........................................................................................................................................13
   Other Hardware Solutions ..................................................................................................... 13
       Development of Robots .......................................................................................................................14
   Wireless Initiatives .................................................................................................................. 14
References ........................................................................................................................ 15




                                                                                                                                                               2
Abstract
Lego Mindstorms leverages the programming power of the Robotic Control Explorer
Brick (RCX brick) to enable users to easily build robots with various functionalities.
 This brick permits users to download their own specialized programs for controlling the
robot. The RCX is the core of the Mindstorms robots with 32 KB of RAM and an
infrared transmitter and receiver. It also contains a Hitachi H8 micro-controller used to
manage three motors, three sensors and an infrared serial communications port. All these
functions can be controlled by user programs.

One of the main constraints of the robot is its limited processing power. The J-Stamp
processor is an embedded Java controller. It is faster, runs in real time, and contains
more RAM and ROM than the RCX brick. It also allows users to program in a familiar
environment with the advantages and the support of the Java language. By replacing the
RCX with the new J-Stamp processor, we are taking advantage of these capabilities.

Other limitations of the RCX brick are the light conditions and distance requirements.
Using a wireless modem with Bluetooth standards in place of the infrared port enables
users to overcome these limitations. The modem extends the distance signals can travel,
and removes the light constraint.

The final added feature is the web-camera which captures the perspective of the robot.
Attached to the robot, it transmits a continuous video feed to the user via a wireless
connection. This video feed will appear on the user’s screen; thus it allows the user to
see through the eyes of the robot.

These modifications and addendums build on the current capabilities of the robot and
expand its usage beyond simple games and tasks. Future robots will possess remote
access capabilities across farther distances and have more accuracy of motion.




                                                                                           3
Problem with Mindstorms
This project allows us to explore some of the latest developments in robotics, applied to a
useful application while still creating something entertaining. This project allows us to
improve upon signal transmission, remote access, and processing power.

Currently, the Mindstorms robots communicate to the computer via an infrared port.
This connection is restricted by the distance between the robot and the computer and the
light conditions. For example, the robot will not be able to communicate with a computer
ten feet away under direct sunlight. The specifications suggest a maximum distance of
four to six feet, away from direct lighting. To improve upon the communication between
the robot and the computer, a wireless modem connection can be used to transfer data at a
faster rate and over longer distances.

The current release of the RCX brick only permits users to control the robot’s motion
when the he or she can physically see the movements of the robot. Otherwise, the user is
controlling the robot blindly. This severely limits the remote access capabilities of the
robot. This handicap forces the robot to be in visible range of the user controlling it. To
solve this problem, a web-camera is mounted on the robot which captures the perspective
of the robot and transfers the image to the user’s screen via a wireless connection.

Finally, the built-in processor of the RCX brick has a processing power of only 16MHz.
The 16 KB of ROM restricts the number and size of programs that can be executed on the
RCX. The J-Stamp processor not only allows programs to run in real time but also
contains more memory and thus can run more complex programs. In addition, the
expanded memory decreases the response time of the sensors.




                                                                                          4
Progress as of December 5, 2002
This semester, we started by completing the background research which allowed us to
determine an aspect of the project on which to concentrate. In coordination with other
teams working on the project, we narrowed our focus to the movement analysis and
control. We also designed and constructed various robots to accommodate our project
needs. We then tested the various sensors and the movement control of the robot with the
shipped firmware and through our own code with the LEJOS firmware.

Background Research

We studied various aspects of the past work and projects. First, we studied the uses of
Legos by people world wide in classrooms as a teaching tool, and as a toy. From these
projects, we learned about extensions individuals created for the Legos, such as
temperature sensors which shows other areas where the Legos needs improvement. In
addition some researchers reverse engineered the RCX and analyzed the ability and
limitations of the brick.

By exploring other programming languages designed for the RCX brick, we weighed the
advantages and disadvantages of each language and chose Java. This was selected
because of its extensibility, ease of use, support, and portability to the J-Stamp processor.
A similar language to C, called Not Quite C, was not picked because it has less support,
is much harder to work with, and would not be compatible with the J-Stamp real time
processor.

Coordination with Other Groups

Our advisor initially suggested focusing on the Operating System for the RCX and
designing a distributed system to work with the brick. On discovering that several
alternative operating systems were available, we decided to focus on other ways to
improve the robot. We started with the idea of having the robots play the game, and
expected to focus on all the game aspects such as positioning, laser recognition, and
movement. However, this goal was too ambitious for one group given the two semester
time constraint. As a result, the project was divided, and two other groups are working
on determining the robot position and the laser tag abilities. We are working on precision
movements, accuracy of control, and potentially a distributed management system.

Robot Design and Construction

After seeing other people’s designs, we embarked on designing and refining our own
robot. In the Lego manual, several robot models were suggested. We built three of these
robots, and pulled the best features out of each. From the ―Inventorbot‖, we realized the
functionality of robot appendages. These were useful for sensor attachment and extra
tasks. However, this robot had too many limbs that hampered its movement. The


                                                                                            5
―Roverbot‖ showed us the full movement range of the wheels, but it had no room for
expansion. In the ―Acrobot‖, there seemed to be a combination of the qualities of the
previous two robots. Still, there were problems with stability and the robot was rather
fragile.

From this hands-on experience, we determined the best robot construction. We decided
on large wheels. The lighter side of the robot had to be reinforced with extra weights to
prevent the robot from flipping over due to sudden changes in direction. Too many
weights slowed down the robot. The sensors of the robot had to be built fairly close to
the base; otherwise collisions caused massive damage to the robot. Depending on where
the sensor is attached, the response time changed. Trial and error was used to determine
the optimal sensor position.

In some of our designs, the sensor bases interfered with the wheels and caused erratic
movement or none at all. The wheels also have a problem moving in a straight line
depending on the surface they are placed on. They wobble and have a tendency to fall off
on impact. These problems still affect the robot’s performance and are continuous works
in progress.

RCX Firmware

After constructing the robot, we learned about the applications available for the RCX
firmware. We completed all the tutorials and created toy programs using the shipped
programming environment. We modified the default commands and practiced using the
RCX features. These program executables are downloaded to the brick through the USB
tower and can be run by the remote control or the buttons on the brick.

LeJOS1 and Java

After exploring the RCX firmware, we moved onto the LeJOS firmware. LeJOS allowed
us to program and control the movements of the robots and its sensor with Java programs.
For instance, one of our test programs moves the robot forward and reverses its direction
on collision. We chose the Java 2 Platform, Standard Edition (J2SE) development kit
provided by Sun Microsystems. This scaled down version of Java provides all the
essential Java packages and library functions with the notable exception of garbage
collection.

We first learned to compile, run, and download the Java programs on the MS-DOS
command line, but this process was slow and painful. Therefore, we also downloaded a
GUI interface compiler and emulator which allowed us to download byte code onto the
RCX brick.




1
    Refer to LeJOS in the Prior Work Section for more details


                                                                                            6
Revisions from Original Proposal
Our main modification to the original proposal is a narrower focus. Instead of working
on all aspects of the game, we divided the project with two other senior design teams.
We are now concentrating on improving the movement precision, control accuracy, and
sensor recognition.


Potential Obstacles and Solutions
Our biggest concern is that the real time J-Stamp processor has not move into the
production stage and not available for us to use. We are working on obtaining a
prototype from the University of Utah once they are done testing the models.

Another impediment is the connection between the modem and the RCX brick. The
modem was purchased independently of the Legos and there may be compatibility issues
and communication problems. As of today, we have yet to come up with a viable
solution.


Expected Results
Our final product will focus mainly on navigation and control of the robot through the
ipaq (a small handheld device similar to a palm pilot). On the ipaq, the user will be able
to see the image from the robot’s camera and control the motions of the robot providing
increased user mobility. One ipaq controls only one robot.

Multiple robots will make up a distributed system. There will be a main computer server
which stores each robot’s information and status. This can be expanded to store
additional game play information such as health, ammunition, and scores. This is similar
to a client-server control where the computer is the server and the robots are the clients.

The robot will run the J-Stamp processor with a wireless data connection to the computer
server. A web-camera will be mounted on the robot to provide video feed and
transmitted wirelessly to the ipaq. These streams will also be sent to the computer
controller. The wireless standard used is Bluetooth.

In conjunction with the related projects on robot position in a playing field and laser
recognition, we can develop a game similar to laser-tag. This will enhance the user’s
experience.




                                                                                             7
Scenario

        You and your best friend are arguing about who is the better game player in Lego
world, a terrain designed specially for Lego Robots. You pull out your ipaq and
challenge him in a head to head contest in the Game. You start the computer controller, a
device which will maintain scores, health, ammunition, and track your movements in the
Game. Using your ipaqs, you and your best friend play the Game, in which you control
your Lego robot around the terrain in an attempt to gain the most points.
        This scenario is similar to playing a video game, as your ipaq will display what
your Lego robot sees and senses. But you are also able to look up at your robot, and
know its position on the field. In instances where the robot is out of your line of sight,
the ipaq screen becomes a crucial part of your game playing strategy. Luckily, your
robot has a full range of motion, as the robots are controlled wirelessly through the ipaq.


Crucial Elements

At the conclusion of the Spring Semester we expect to have:
     Functional robots.
     General Computer Controller device. This will use aspects of distributed
        programming, and wireless standards
     Wireless connection between the robots and the ipaq
     Video and data streams from the robot to the ipaq controller



Diagram – Controller to Robot Communication




                                                                   ROBOT1




       WORLD MAP                 COMPUTER
                                CONTROLLER                         ROBOT2




                                                                   ROBOTn




                                                                                          8
       The computer controller is a device that will track robot states and position on the
world map. Data goes from the robot to the computer controller where it can be access
by other robots. For instance, if ROBOT1 wants to access information about ROBOT2, it
can query the computer controller. This is similar to a client-server control where the
computer controller is the server and the robots acts as clients. The computer controller
must maintain consistent information. The robots can also be viewed as a distributed
system where the CPU is located at the computer controller.
       The world map is an image of the playing field of the robots. It is stored in the
computer controller.


Diagram – Robot to Remote Communication



                                                                  USER



           CAMERA
                                  VIDEO STREAM


                                                          HUMAN
                                                        CONTROLLER
                                  DATA STREAM             DEVICE
                 ROBOT




        The human controller controls the motions and actions of the robots. Robots
communicate with the human controller through video streams and data streams. The
data stream is transmitted by the RCX brick to the human controller. The data stream is
numeric, or coded information, and can be handled by the processor. The camera is
going to be separate from the robot because the RCX brick does not have the capability
or power to handle transmitting the video stream. A small web-cam will be used as the
camera. It will have its own transmission device. This set up will allow both a camera
and a data line to exist without overwhelming the capability of the RCX chip.
        The user will not notice that there are two streams on his controlling device.




                                                                                          9
Revised Timeline
    December 2002:

         Complete exploring programming with Java and LeJOS
         Begin and complete work on conventional (wired) modem and camera

    January 2003:

         Begin work on programming with IPAQ – wireless data feed

    February 2003:

         Complete work with IPAQ
         Begin work on wireless web-camera

    March 2003:

         Complete work on wireless web-camera
         Begin work on real time J-Stamp processor

    April 2003:

         Complete work on real time J-Stamp processor
         Fine tune project and reconcile with other teams working the project


Description of Prior Work

Introduction

       Lego Mindstorms is the generic brand name for programmable kits manufactured
by the Lego Company. These kits include the Robotics Invention System (RIS) and the
RoboLab Mindstorms for Schools. Multiple expansion sets are also available under the
Mindstorms brand name. Together these kits are used to build robots, and other
programmable devices that are controlled via computers.


History

      Since the early 1980’s, Lego bricks were used in engineering to make scale
models of assembly lines. Today, they are still applied towards building prototypes of



                                                                                         10
mechanical models. In 1984, the Lego Company partnered with the Massachusetts
Institute for Technology (MIT) to create computer controlled motors and bricks. First,
MIT created a programmable brick, aptly named the ―MIT Programmable brick.‖ Then,
Lego independently developed a programmable block based on the MIT idea and
introduced the Robotic Command Explorer Brick (RCX programmable brick), which is
the ―brain‖ of Lego Mindstorms.
        The RCX brick is programmable, and contains a central processing unit (CPU),
32 KB of RAM, battery space, and an infrared transmitter and receiver. The Hitachi H8
micro-controller is used to manage three motors, three sensors and an infrared serial
communications port.2 The brick has wire connectors that can supply power to other
motors and can read from the various sensors. These abilities make it easy for the novice
user to create a robotic project. Projects created with the Lego Mindstorms use the RCX,
motors, sensors, building bricks, beams, wheels, and other parts that are available with
the Lego kits.
        Since the introduction of the Lego Mindstorms, people have built various
creations or robots which complete tasks that span from the trivial to very useful. The
Lego Mindstorms were initially developed as a learning tool for young children, but
quickly became popular with adults and university researchers due to their expandable
nature. On the internet, there is a large forum of discussions and newsgroups where
comments are posted pertaining to different applications of Mindstorms.


Development of Other Programming Environments

        Lego shipped the RCX brick with a graphical programming environment that
performed simple tasks. However, the limited capability, and poor support for repetitive
tasks encouraged enthusiasts to develop new programming systems for the RCX through
reverse engineering of the brick and its associated hardware. The most common
language is Not Quite C (NQC). In addition, one can install LegOS or LeJOS, a type of
firmware for the Lego system which is controller software for the RCX brick.


NQC

        NQC was developed by David Baum3, and is currently on version 2.5 Beta
Release. The language is a simplified version of C, produced especially for the RCX
brick as an alternative to the graphical programming environment which is shipped with
the Mindstorms kit. Some of the language features depend on the RCX brick (or
comparable programmable blocks) to function. The library modules available include
Sensors, Outputs, Sounds, Timers, Communication, Liquid Crystal Displays (LCD), and
Data Logging which correspond to parts of the RCX brick. The language is available as
freeware for download.



2
    RCX board Internals are available at: http://graphics.stanford.edu/~kekoa/rcx/
3
    The NQC website is: http://www.baumfamily.org/nqc/


                                                                                       11
        NQC is quite popular as a development environment amongst Lego programmers.
Several individuals have created Integrated Development Environments, (IDE’s) for
NQC, and ported it to other platforms. Common usage is to develop the program on a
personal computer (PC), compile it, and download the executable file to the RCX brick.
Generally, the sensors attached to the brick read in data, and send it back to the
controlling device, usually a computer.
        Some devices programmed with NQC include:
         The Kennedy Space Center Crawler Transporter. A small vehicle which can
           carry loads from the Vehicle Assembly Center to the Launch Pad. This
           project illustrates motion range abilities.
           http://www.geocities.com/CapeCanaveral/Runway/1604/ksc_ct.html
         The Lego Scanner. A dual printer and scanner based on a design which
           allows movement along the two axis. This illustrates the optical capabilities
           of the Lego. http://www.mop.no/~simen/legoscan.htm


LEGOS

        LegOS was developed by a PHD student, Markus L. Noga, who wanted a more
efficient routine for controlling the RCX brick. The LegOS is an open source operating
system for Lego Mindstorms, and claims to perform better and provide greater flexibility
than the standard operating system.
        Users of LegOS can write C programs on their own computer and use a standard
compiler to create machine code. The machine code is downloaded to the brick, and
executed directly by the RCX CPU. Consequently, this method is much faster than
using interpreted byte code. This miniature operating system can work with a variety of
platforms such as Windows, Linux, and UNIX.
        Many of the more complicated Lego programs run on LegOS.


LEJOS

        LeJOS is a java based replacement firmware for the standard Lego Mindstorms
RCX brick that comes with the RIS. The firmware provides a ―virtual machine‖ which
executes byte code programs downloaded onto the RCX. The LeJOS firmware differs
from the default firmware in that it can run normal Java byte codes. The java program is
first compiled with the LeJOS compiler which is the normal ―javac‖ compiler with a
wrapper which specifies various base classes. The compiled code is then loaded into the
RCX to be run.
        Some projects created with the LeJOS operating system are:
         The ―Mars Lander‖ robot. The interesting feature is the attempt to detect
            when the robot has a stalled motor. The Java class ―stalled‖ should handle the
            stalled motor and enable the robot to restart.
         The tennis ball retriever robot. This robot will wander around the tennis
            court, pick up balls, and bring them back, although it is not clear how long the
            retrieval will take.


                                                                                         12
J-STAMP

         J-Stamp is an embedded Java controller developed by Systronix, Inc that provides
fast native Java execution and contains deterministic real-time capability. J-Stamp
includes 512 KB of SRAM, 512 KB to 2 MB of flash ROM depending on the version,
and other supporting circuitry including a high-efficiency power converter, dual UARTs,
a serial peripheral interface (SPI) controller, and three 16-bit counters. It is also equipped
with the industrial standard test interface, JTAG, which is used for loading and
debugging programs on J-Stamp.
         The CPU on the J-Stamp is the aJ-80 made by aJile Systems. The aJ-80 is
programmed entirely in Java and its native instruction set is the standard Java Virtual
Machine byte code. It is rated for a maximum operating frequency of 80 MHz although
J-Stamp can be configured to run at various clock speeds. However, the 7.372 MHz
crystal used on the current version of J-Stamp constraints its highest in-spec clock
frequency to 73.72MHz. J-Stamp’s power use is proportional to its speed.
         Since J-Stamp has no keyboards or displays, programs written for J-Stamp must
be written on another computer and loaded onto J-Stamp. Loading programs onto J-
Stamp involves linking all classes prior to runtime and then transferring the binary file
onto J-Stamp via a JTAG cable.


JREALTIME

        The J-Stamp is programmed using JRealTime, a real time Java programming
language in order to take full advantage of the fast native execution of Java code
provided by J-Stamp. JRealTime systems use a 32-bit native Java execution controller.
        The University of Utah offers a computer science senior design course which uses
the J-Stamp processor and JRealTime to develop small programs and applications for a
small robot which can recognize colored objects, avoid objects of certain colors, connect
to LCD’s and report back to a main controller.


Other Hardware Solutions

        Others in the Lego community created new hardware to increase the Mindstorms
functionality. There are designs available for homemade sensors that recognize touch
and temperature, as well as designs for input that can snap into the Lego parts. The more
ambitious have built cameras that trace the distance to the nearest object, and include
stronger processors that are up to ten times faster than the current microprocessor in
Mindstorms.
        A great obstacle is power supply, as users are limited by the battery life of the
batteries in the RCX block.




                                                                                           13
Development of Robots

        Since the Lego Mindstorms product is designed to facilitate creating robots for
young children without engineering degrees, many robotic designs are available. Some
designs such as the Rubik cube solver rely heavily on the connection to the personal
computer for processing power. A camera on the solver identifies and records the
configuration of the cube. Then, the cube’s configuration is sent back to the computer,
which uses a table to determine the steps needed to solve the cube. Finally, the Lego
parts twist the cube back to the correct position.
        Lego creations can also involve more mechanical aspects. Ben’s Lego page4
contains a list of more complicated, useful robot devices. On this site, one can find a
working clock, VCR, caliper, and pneumatic valve. In addition, there is a truck, and a
robot that can fetch and grab parts. A probe exists that will move around a solid object,
and transmit its coordinates to a computer. This will enable a 3-dimensional imaging
program to recreate the object on another computer.
        Other sites include an Energy Water Mineral collector, which is a robot that can
travel and collect minerals from the ground and determine if the place is safe for humans
to explore. It contains different car modules that travel separately looking for minerals
that are missing from the collector. This complicated design took the creator several
months to create. Some creative gadgets made are a module that can change compact
discs at parties, a typewriter, and a toilet bowl scrubber.

        Multiple Lego Robot Design Competitions exist, such as the Lego Robot Program
Class offered at MIT, the Competitions sponsored by Mindstorms, and other local and
national competitions. From these, we formed a better idea of the complexity and time
tradeoff in creating a decent robot.


Wireless Initiatives

        Although the Lego Mindstorms come with an infrared transmitter, this transmitter
is limited by range and obstacles between the robot and the transmitter receiver, and
amount of data that can be transferred. To improve upon this we are considering
revamping the wireless connection to take advantage of newer, more improved wireless
protocols such as Bluetooth or IEEE’s standard 802.11b.
        Bluetooth is a wireless technology specification that allows wireless devices to
communicate with other devices world wide. Bluetooth operates in a 2.4 GHz ISM band
(the radio frequency used). Similarly, IEEE’s wireless standard 802.11b is more suited
towards Local Access Network (LAN) use. The choice of which standard to apply will
depend on the Lego’s compatibility with the standard, and ease of implementation, and
access to documentation and resources. Due to the department’s familiarity with
Bluetooth applications, we are currently leaning towards using Bluetooth standards.



4
    Ben’s Lego Page http://ozbricks.com/benw/lego/


                                                                                       14
References
About LegOS http://www.noga.de/legOS/

Ben’s Lego Creations http://ozbricks.com/benw/lego/

Bluetooth Specifications http://www.bluetooth.com/dev/specifications.asp

Energy Mineral Water collector http://www.fischer-mellbin.com/Marcus/Lego/EMW-
      module/emw-module.html

Ferrari, Giulio. Programming Lego Mindstorms with Java. Syngress. Massachusetts.
        2002.

Kennedy Space Center Crawler/Transporter Model
      http://www.geocities.com/CapeCanaveral/Runway/1604/ksc_ct.html

LeJOS, Java for the RCX http://lejos.sourceforge.net/

Lego Mindstorms, Company Page http://mindstorms.lego.com/

Lego Mindstorms Robots—Online Resources
      http://www.oreilly.com/catalog/lmstorms/resources/

Lego Scanner http://www.mop.no/~simen/legoscan.htm

Martin, Fred G. ―The Art of Lego Design‖ The Robotics Practitioner: The Journal for Robot
       Builders, volume 1, number 2, Spring 1995
       ftp://cherupakha.media.mit.edu/pub/people/fredm/artoflego.pdf

Not Quite C http://www.baumfamily.org/nqc/

RCX Internals http://graphics.stanford.edu/~kekoa/rcx/

Wallich, Paul. ―Mindstorms, Not Just a Kid’s Toy‖ IEEE Spectrum. September 2002.
       Pages 52-57




                                                                                       15

				
DOCUMENT INFO
Shared By:
Categories:
Tags:
Stats:
views:6
posted:6/23/2011
language:English
pages:15