Google It All

Wednesday, April 22, 2009

A neural network for Java Lego robots - Learn to program intelligent Lego Mindstorms robots with Java

By Julio César Sandria Reynoso, JavaWorld.com, 05/16/05

This article shows how to develop a robot that can learn by using the backpropagation algorithm, a basic neural network, and implementing it on a Lego Roverbot. Using both the algorithm and Java, the Roverbot—a Lego robot vehicle—can learn some basic rules for moving forward, backward, left, and right.

In this article, we use the Lego Mindstorms Robotics Invention System 2.0 for building the Lego robot; leJOS 2.1.0, a little Java operating system for downloading and running Java programs inside the Roverbot; and J2SE for compiling the Java programs under leJOS.
Lego robots

The Lego Mindstorms Robotics Invention System (RIS) is a kit for building and programming Lego robots. It has 718 Lego bricks including two motors, two touch sensors, one light sensor, an infrared tower, and a robot brain called the RCX.

The RCX is a large brick that contains a microcontroller and an infrared port. You can attach the kit's two motors (as well as a third motor) and three sensors by snapping wire bricks on the RCX. The infrared port allows the RCX to communicate with your desktop computer through the infrared tower.

In this article, we use a Roverbot as it is constructed in the Lego Mindstorms Constructopedia, the guide for constructing robots. This Roverbot, as shown in Figure 1, has been configured to use all three sensors and two motors included in Lego Mindstorms RIS 2.0.

Figure 1. A Lego Roverbot with two touch sensors, one light sensor, and two motors
leJOS

leJOS is a small Java-based operating system for the Lego Mindstorms RCX. Because the RCX contains just 32 KB of RAM, only a small subset of the JVM and APIs can be implemented on the RCX. leJOS includes just a few commonly used Java classes from java.lang, java.io, and java.util, and thus fits well on the RCX.

You must load the RAM with the Lego firmware, or, in our case, with the leJOS firmware, and your programs. The firmware contains a bytecode interpreter, which can run programs downloaded from RCX code.

For setting up your leJOS installation, please take a look at Jonathan Knudsen's article "Imaginations Run Wild with Java Lego Robots," (JavaWorld, February 2001), Programming Lego Mindstorms with Java (Syngress Publishing, 2002), or the leJOS readme file contained in the leJOS zip file, which you can download from the leJOS homepage.
Neural networks

If we want to build intelligent machines, we should model the human brain. Early in the 1940s, the neurophysiologist Warren McCulloch and the mathematician Walter Pitts began working on the idea of building an intelligent machine out of artificial neurons. One of the earliest neural network models was the perceptron, an invention of F. Rosenblat in 1962. A perceptron can learn; it models a neuron by taking a weighted sum of its inputs and sending an output of 1 if the sum is greater than some adjustable threshold value, otherwise it sends 0. If a perceptron can compute, it can learn to compute. Figure 2 shows a neuron and Figure 3 shows a perceptron.

ADAPTIVE NEURAL NETWORK CONTROL OF ROBOTIC MANIPULATORS

by S S Ge, T H Lee (National University of Singapore) & C J Harris (University of Southampton)

Recently, there has been considerable research interest in neural network control of robots, and satisfactory results have been obtained in solving some of the special issues associated with the problems of robot control in an "on-and-off" fashion. This book is dedicated to issues on adaptive control of robots based on neural networks. The text has been carefully tailored to (i) give a comprehensive study of robot dynamics, (ii) present structured network models for robots, and (iii) provide systematic approaches for neural network based adaptive controller design for rigid robots, flexible joint robots, and robots in constraint motion. Rigorous proof of the stability properties of adaptive neural network controllers is provided. Simulation examples are also presented to verify the effectiveness of the controllers, and practical implementation issues associated with the controllers are also discussed.


Contents:

* Mathematical Background
* Dynamic Modelling of Robots
* Structured Network Modelling of Robots
* Adaptive Neural Network Control of Robots
* Neural Network Model Reference Adaptive Control
* Flexible Joint Robots
* Task Space and Force Control

Robotics Technology And Flex

In recent years, robotics have dramatically changed the arena of manufacturing, fabrication and assembly. And in the process of its evolution, the robot has become an intelligent being possesing sensory and control capability and improved dexterity.This book unfolds the full potential of robotics technology and automation and explores the field of robotics as a powerful manufacturing tool. Topics covered include: robot kinematics, sensors, AI, robot vision, robot language, programming simulation, installation and design.

Wednesday, April 1, 2009

Neural Network Control of Robot Manipulators

In this article, the author describes neural network controllers for robot manipulators in a variety of applications, including position control, force control, parallel-link mechanisms, and digital neural network control. These "model-free" controllers offer a powerful and robust alternative to adaptive control.

In recent years there has been increasing interest in universal model-free controllers. Mimicing the functions of human processes, these controllers learn about the systems they are controlling on-line, and thus automatically improve their performance. So far, neural networks have made their mark in the areas of classification and pattern recognition; with this success they've become an important tool in the repertoire of the signal processor and computer scientist. However, the same cannot be said for neural networks in system theory applications.

There has been a good deal of research on the use of neural networks for control, although most of the articles have been ad hoc discussions lacking theoretical proofs and repeatable design algorithms. As a result, neither the control systems community nor US industry have fully accepted neural networks for closed-loop control applications. In this article, I address the major problems facing neural network control and demonstrate that neural networks do indeed fulfill the promise of providing model-free learning controllers for a class of nonlinear systems.

The basic challenges for neural network control are

# providing repeatable design algorithms,
# providing on-line learning algorithms that do not require preliminary off-line tuning,
# initializing the neural network weights for guaranteed stability,
# demonstrating closed-loop trajectory following,
# computing various weight tuning gradients, and
# demonstrating that the neural network weights remain bounded despite unmodelled dynamics-because bounded weights guarantee bounded control signals.

K.S. Narendra and others have paved the way for neural network control by studying the dynamical behavior of neural networks in closed-loop applications, including computation of the gradients needed for backpropagation tuning. (There are also several groups currently analyzing neural network controllers using a variety of techniques.) Unfortunately, the necessary gradients often depend on the unknown system or satisfy their own differential equations. Thus, though rigorously applying them to identification, researchers have not fully developed neural networks for direct closed-loop control.

Neural networks and artificial intelligence in robotics

When talking of artificial intelligence(AI) many people think that neural nets should be as intelligent as human brain. Some people don’t even imagine how widely they are used in their life. Lets narrow us to something more simple and understandable.

The most exiting usage of AI is robotics. Today isn’t very hard to build simple robot with few sensors and couple motors. But harder part is to make it react to real world as you expect to be. Usually when programming robot brain usually there is checking sensor states and reacting on particular circumstances like hitting the wall, line on the ground and so on. But more sensors robot has more complex reactions may be. Programming of more complex systems may be pain without using simple neural networks.

In neural networks we have two subjects: “knowledge” and “learning”. This means that intelligent systems has some knowledge,or so called experience and ability to learn and improve. Lets have an example: Suppose we have T form maze. In this maze there is a mouse. In one side of T there is electric shock and in another side si a cheese. During some tries mouse will learn which side to choose in order to avoid electric shock and get cheese. You see – wee have touched both subjects: learning and knowledge. Speaking of science on first try probability of choices ara 50×50 percents, but after repeat tries probability grows due to experience gained. Everything seems fine until we face hardware – a robot. How to make robot feel hunger, anger, thirst, pain, satisfaction?

We human have these standard reflexes on birth brought by genes. Using them we grow and learn. Once you burned a hand in oven, you will always remember how painful it is and try to avoid the heat. With artificial intelligence there is almost the same. Just in different level. In modern world AI is making first steps in understanding how our conscious works, how neurons interact and how brain works.

In digital electronics neuron could be interpreted as multiple input AND, OR or XOR element. But in reality neuron is analogue element with multiple inputs with different sensitivities. Sum of these input signals defines the activity of neuron. The output signal of neuron may be processed as rezult or forwarded to another neuron input.

In general neural network is a set of interconnected elements where each of them has their own input signals and outputs some resulting signal. For instance simple robot platform:





Mathematically everything is possible to describe with formula: Outputs=f(Inputs),

Function may be any logical algorithm, finite state algorithm or simply as a set of operations of any programming language. But understand, that algorithm isn’t a reaction to one or another input, but simply describes method which is used by neural network. Teaching neural network is done by examples: network inputs are affected by some actions and output signals are compared to our expected reaction. If it differs – then we get so called an “error”. In order to reduce this error sensitivities of inputs are reduces so, that error would be minimal. This process is repeated many times until network reacts as expected.

Some science has to be done while choosing right structure of neural networks. If neural network will be too small, then it will be ineffective and it won’t be able to learn what you want. If there will be too many neurons, then learning can take much more time then expected.

After initial training - neural network may be used to control robot platform. It can learn by itself reacting to real world objects. For instance: it can learn to find the most effective way to turn to light with minimal collision number and so on…

This is very narrow area we have touched in this article. Building effective neural networks require some knowledge and experience. But such simple solutions can be good starting point.

Looking further there are many more interesting things that touches neural networking like genetic algorithms. They are used to copy real world example, where it acts as population of several neural networks and can duplicate and form effective neural net that is most effective for particular purposes. But this is early to talk about artificial intelligence as it is more likely artificial reflex.