Subscribe To Robotics | IntroDuction | History | Home


Friends Dont Forget To check the archieve at the left end of the page



Make Your Own Robot Tutoials



Simple Beetle Bot | Wired Robot | Combat Robot | Solar Engine |



Beam Symet | Photopopper | Beam Trimet | Line Follower |

Latest Updates
Driver Less Car | I-Sobot | MotherBoard | MicroController | Artificial Brain |

Camera Sensors Hardware | Remote Control Working

Google

Thursday, July 24, 2008

Robotics Programming



When programming is first taught, the concept that a program follows the “input—
processing—output” model is used (Fig. 13-4) in which data inputs to the program are
passed to a processing block and then passed out of the program in the form of outputs.

This model is good for initial programs on a PC in which some number crunching is done to help you learn how the different programming statements work, but they have little relevance when programming robots.

Instead, a programming model like the one shown in Fig. 13-5 should be used. In this
model, the program is continually looping (never ending) and reading (or polling) inputs, passing them to a block of code for processing into outputs and then delaying some amount of time before repeating.

The delay block is critical for robot programming as it allows the code to be tuned for the operation of the robot and its parts. If the delay is too short, the robot may vibrate more than move because one set of commands from some input conditions are countermanded by the next set of input conditions, resulting in the original input conditions are true again . . .



Specifying the appropriate amount of delay is something that will have to be found by
trial and error. The total loop time should be less than 1 s, but as to the “best” time, that is something that you will have to find by experimenting with your robot. As a rule of thumb, try to keep the total loop time at least 100 ms (0.1 s) so that the motors have time to start up and initiate action before stopping and a new set of inputs polled.

You may also want to leave the motors running during the delay based on the assumption that chances are the processed output will not change radically from loop to loop. This will help make your robot move more smoothly, which is always desirable.


Graphical Programming

In this chapter, there is a lot of material on text-based programming that probably seems very difficult and complex, especially when you consider that there are many graphical robot programming environments available that could reduce a reasonably complex function like programming a light-seeking robot into the simple chore of drawing a picture like the one in Fig. 13-6.

This program will cause a robot to move toward the brightest point in the room. This is a lot easier to understand than the text-based version, which would look something like

while (1) ................. Loop Forever
If (Left > Right) ............Turn Left
Right Motor = On
Left Motor = Off
else
if (Left < Right) ....................Turn Right
Right Motor = Off
Left Motor = On
else ........................... Left = Right, Go Straight
Right Motor = On
Left Motor = On
endif
endif
Dlay(100) .............Delay 100 ms
endwhile

which would probably take you a lot longer to program than moving some blocks and lines around in a graphic editor. While being more difficult to understand and longer to develop, the text-based program gives you a great deal of flexibility that you don’t have with most graphical programming environments. Both programs perform the same operations and work the same way, but what happens if you discover that rather than turning as soon as the left and right light sensors are different values, the robot could run straight while they were within two values of
each other.

In the graphical programming environment, this would be impossible, but in the text-based program the two if statements could be changed to

if (Left > (Right + 2)

if ((Left + 2) < Right)

which would cause the robot to move forward if Left and Right were +/−2 of each other
rather than turning if they weren’t exactly equal. There are a lot of other cases where you will find that you need to tweak the program to run optimally, but you find that it is impossible to modify the graphic program for these needs.



Another advantage of text-based programming over graphic programming is the ability to add more complex logic to the operation of the robot. For example, if you wanted the robot to turn right if it has turned left five times in a row you can add the code quite easily to the text program whereas the graphic program does not have that capability (and indeed, very few graphical programming environments even have variables).

It is important to not generalize. While most beginner and hobbyist graphical programming environments and languages do have the limitations listed here, more professional ones do not. For example, National Instruments’ LabView programming environment offers the same capabilities and flexibility as a text programming language despite being based on just graphic symbols for operators, variables, and decision structures.

Hopefully you realize that these capabilities do not come free; creating a complex graphic program will require at least the same amount of study and practice as developing a text-based one.

Wednesday, July 23, 2008

LINEAR PROGRAM EXECUTION

Modern computer systems, regardless of their sophistication, are really nothing more than electronic circuits that read instructions from their memory in order and execute them as they are received. This may fly in the face of your perception of how a computer program works; especially when you are familiar with working on a PC in which different dialog boxes can be brought up at different times and different buttons or controls can be accessed randomly and not in any predefined sequence.

By saying that a computer program is a sequence of instructions that are read and executed may seem to belittle the amount of work that goes into them along with the sophistication of the operations they perform, but this is really all they are.
A sequence of instructions to latch data from a storage location into an external register using two I/O registers (one for data and one for the register clock line) could be:

Address Instruction

1 I/O Port 1 = All Output
2 I/O Port 2 = 1 Clock Output Bit
3 I/O Port 2 Clock Output Bit = Low
4 Holding Register = Storage Location "A"
5 I/O Port 1 = Holding Register
6 I/O Port 2 Clock Output Bit = High
7 I/O Port 2 Clock Output Bit = Low

In this sequence of instructions, the address each instruction is stored in has been included to show that each incrementing address holds the next instruction in sequence for the program. The first computers could only execute the sequence of instructions as-is and not modify the execution in any way. Modern computers have been given the ability to change which section of instruction sequence is to be executed, either always or conditionally.

The following sequence of instructions will latch the values of one to five into the external register by conditionally changing the section of the instruction sequence to be executed, based on the current value.

Address Instruction
1........................................... Holding Register = 1
2........................................... Storage Location "A" = Holding Register
3........................................... I/O Port 1 = All Output
4........................................... I/O Port 2 = 1 Clock Output Bit
5........................................... I/O Port 2 Clock Output Bit = Low
6........................................... Holding Register = Storage Location "A"
7........................................... I/O Port 1 = Holding Register
8........................................... I/O Port 2 Clock Output Bit = High
9........................................... I/O Port 2 Clock Output Bit = Low
10........................................... Holding Register = Storage Location "A"
11........................................... Holding Register = Holding Register + 1
12........................................... Storage Location "A" = Holding Register
13........................................... Holding Register = Holding Register - 5
14 If Holding Register Does Not Equal 0, Next Execution Step is 6

In the second program, after the contents of ‘Holding Register “A” ’ have 1 added to them, the value has 5 subtracted from it and if the result is not equal to zero, execution continues at address 6 rather than ending after address 14. Note that data from a “Storage Location” cannot pass directly to an output port nor can mathematical operations be performed on it without storing the contents in the “Holding Register” first.

In this simple program, you can see many of the programming concepts listed in operation, and while they will seem unfamiliar to you, the operation of the program should be reasonably easy to understand. The sequential execution of different instructions is known as linear program execution and is the basis for program execution in computers.

To simplify the creation of instruction sequences, you will be writing your software in what is known as a high-level language or, more colloquially, a programming language. The programming language is designed for
you to write your software (or code) in a format similar to the English language, and a computer program known as a compiler will convert it into the sequence of instructions needed to carry out the program.

Friday, May 30, 2008



The oscillator will be used to generate a square wave at a desired frequency. The wave is fed into a transistor that drives an infrared LED on and off very rapidly. Because the emissions are infrared and very fast, neither is visible to the human eye.

Inexpensive infrared receiver chips are available at 36 kHz, 38 kHz, and 40 kHz. The receivers are sensitive to oscillations several kilohertz to either side, although reception distance improves with a better signal to start with.

If used for object detection, the signal needs to travel the distance to the object, bounce off the object, and then travel the distance back to the receiver. So, distance becomes a factor.

Because infrared receivers amplify the signal to improve detection, electrical noise generated from the oscillator can leak into the receiver and trigger a false detection. This isn't a problem for VCRs or most consumer devices as they tend to contain either a transmitter (remote control) or a receiver (CD player), but not both.

Therefore, robot transmitter and receiver circuits must be carefully designed and positioned apart to be useful. Robots that chase electrical ghosts, spin in place, or jerk sporadically are initially amusing, but eventually frustrating.

The lower the power of the circuit, the more likely it will be lower in noise. Also, liberal use of decoupling capacitors and metal shielding helps a lot. Greater distance between the circuits makes an enormous difference.

The Popular 555

The 555 IC is an extremely popular timer. The low-power CMOS versions (TLC555, LMC555, and ICM7555) use less power than the older (555, NE555, LM555) versions and don't require a capacitor on the control pin. Although pin and functionally compatible, the component values differ between the low-power CMOS and older versions.

Infrared Emitter 555 Schematic

A portion of the configuration presented here is similar to an example in the Maxim ICM7555 datasheet. In this circuit, the 555 is used in astable multivibrator mode.



For maximum effect, over 60 milliamps pulses through the infrared LED. Adjust R3 as appropriate for your use and LED specifications.


When calculating current through the resistor, don't forget to first subtract the voltage drop across the LED and transistor. Let's say the LED uses 1.8 V (1.6 V to 2.2 V wouldn't be unheard of). Let's say the collector-emitter drop of the transistor uses 0.2 V.

5 V (total) - 1.8 V (LED) - 0.2 V (transistor) = 3 V remaining to drop across the resistor.

3 V / 47 ohms is about 64 mA. Because there's only one path, the current going through the resistor must be the same as what's going through the LED.

Now for the other trick: the word "pulses". The LED is only on half the time because it is blinking. If you use an ohmmeter, the average current is 32 mA (half).

Aside: The LED heats up faster than it cools off. As such, it's not possible to drive 100 mA through a 50 mA LED even though the average current is half. Depending on ambient temperatures, it's usually safe to drive only 125% or 133% of rated maximum at 50% duty. With smaller duty cycles and frequent pauses, it's possible to drive a lot more current in very short bursts.


Theoretical frequency can be calculated by:

f=1/(1.4 RC)

where f is frequency in kilohertz, R is resistance in kilohms, and C is capacitance in microfarads.

38 kilohertz = 1/(1.4 * 18.7969 kilohms * 0.001 microfarads)

Even if you could find a 18796.9 ohm resistor, it turns out the capacitance and resistance of the wiring and the wide tolerance (even at 1%) of the parts means a variable resistor (potentiometer) is a must! Also, the current being used to drive the transistor (Q1) alters the timing a bit.

Using a 1-nF (C1) [1 nF is same as 0.001 ยตF] capacitor and a 15-kilohm fixed resistor (R1) plus a 5-kilohm potentiometer (R2) does the trick. Not only does the potentiometer allow for hand tuning, but also the frequency can be varied from about 32 kHz up to about 42 kHz. The margin means the desired values of 36 kHz to 40 kHz should be attainable even with variations in parts and wiring.



Solderless Breadboard

There's a slight change from the official schematic presented above. On the breadboard, the timing capacitor (C1) is connected to +5 V rather than ground. Testing indicates the same frequency, voltage range, and power consumption regardless. Still, you should use a connection to GND.



On the left is a multiturn potentiometer. The small brass-colored screw rotates many times to perform the same adjustment as the white single-turn dial on the right. The multiturn allows for more precise adjustments and is less prone to shift out of position. Even if it does shift, less change results because it needs to take multiple turns around.

Multiturn potentiometers are more expensive, but worth it for timing circuits.















Surface Mount Components:

A very small infrared circuit can be created with surface mount components. The power usage and basic functionality is the same. Theoretically the electrical noise should be reduced since through-hole leads can act as transmitter antennas.

A couple of notes:

* R2 is a very small (4 mm) surface-mount multiturn potentiometer.

* A lot of extra drill holes exist in the board so that I could use up my small stock of through-hole parts if desired (for this board, I didn't desire). For example, C2 has extra holes to the left and right.

* This circuit differs from the breadboard and schematic as it is designed to drive a pair of dual emitters (four LEDs total). A tiny, green, surface-mount LED indicates when the oscillator is enabled.



create a surface-mount boards at home.

It's really not difficult. You should try it!

There are a few tricks that help me...

Using a toothpick, I place a small dab of silicone adhesive (which I suspect is just caulk in a smaller, more expensive tube) on each location of the board where a surface-mount component is going to be.

As far as I can tell, silicone is pretty friendly compared to the usual nasty PCB chemicals. The package indicates the material is stable up to 400 degrees Celsius. The wet viscosity holds components in place but allows for nudging. The thickness is perfect for bridging the space between the board and slightly raised component backs.

I then deposit each component using tweezers. After five minutes or so, the components can be soldered without them moving around. If a mistake is discovered, the component can be pulled off easily, as the silicone dries to a pliable, soft, rubbery consistency.

With small components, sometimes solder bridges form and sometimes the core flux misses the mark and cold solder balls or joints form. No problem, just place some flux paste in those locations. Reheat the joints with the tip of the soldering iron and they melt to perfection.

Which Oscillator Is Better?

The 555 circuit uses less power when turned on, but the total power usage of an infrared emitter device easily overshadows any minor power-on savings in the oscillator itself.

The NAND solution is cheaper and basically as easy to construct.

Obviously my optimized NAND circuit is better than my original NAND circuit. However, I can't say whether my 555 circuit is even better.

Since the 555 is specifically designed for timing and since it has been widely adopted, I assume there are benefits that I haven't perceived. Most likely the ability to vary duty cycle and other versatility is the real reason the 555 is so popular.

Wednesday, May 28, 2008

Cadmium-Sulfide Color Sensor

Over the years, a number of methods have been tried to create an inexpensive color sensor. One way is to surround an ordinary photocell with a red, green, and blue ultra-bright LED.



All three LEDs are never actually turned on at the same time. Each LED is turned on one at a time and the intensity of light reflected back to the cadmium-sulfide photocell is measured. An analog-to-digital converter measures the voltage divided between a fixed resistor (usually between 470 ohms and 10,000 ohms) and the photosensitive resistor (the photocell).

Ultra-bright LEDs are available from any electronics seller or eBay. Back when I first wrote this article, I got the LEDs from AllElectronics. I purchased red #LED-50 for $0.50, true green #LED-57 for $3.75, and blue #LED-58 for $3.50. Prices have come down considerably since then.

The advertised brightness of red is 3000 mcd, green is 3000 mcd, and blue is 1200 mcd. The resistor values that provided equivalent readings reflecting off white paper are red with 100 ohms, green with 800 ohms, and blue with 100 ohms. Either the green LED is a lot brighter than the others or the photocell's peak sensitivity is to green (or probably some combination of both).




The LEDs are water clear when turned off. Black electrical tape surrounds the photocell in the center of the LEDs. The tape blocks the direct light from the LEDs from reaching the photocell, thus detecting only reflected light.

After the amount of red light, green light, and blue light is measured, each component is individually scaled based on minimum and maximum values obtained at calibration. One-time calibration consists of aiming the completed sensor first at a white piece of paper and then at a piece of black conductive foam. The maximum and minimum values are plugged into the EEPROM of the microcontroller. Scaling based on actual data allows the individual attributes of that particular sensor and set of LEDs to be accounted for.



Alternatively, you can adjust the balance of the colors in hardware by using with three separate trimpots (trimmer potentiometers). Dialing a trimpot changes the brightness of a particular LED. For example, if there's too much red being sensed, simply increase the resistance to decrease the LED brightness by turning the trimpot attached to the red LED.

It's a good idea to always include a minimum fixed resistor value (100 ohms to 150 ohms) in series with each trimpot so that if you accidentally dial the trimpot to 0 ohms the LED won't be damaged.

The photo above includes an Atmel ATtiny45 microcontroller for turning on and off each of the LEDs, reading the results, and outputting the values to a personal computer. You can use any microcontroller of your choice. Or, if you just want a color mixer to play with various output colors, simply pull the microcontroller and feed the resistors 5V.



above is a pic of Regular and small cadmium-sulfide photocells.

Improvement

The above readings were taken through a clear plastic case (not shown). By substituting a few black threads on which to rest the candy, the contrast between colors improved significantly. Perhaps the shiny plastic reflected too much LED light back into the sensor, regardless of the actual color of the object being examined.

Position Problem!

Later discovered a significant flaw with the sensor as currently designed. The candies had always been manually centered for reading. However, misplacement of objects causes more light to reflect from one of the LEDs than the other LEDs. This causes a false detection of color, since it now appears that the object has more of one particular color simply because that LED is closer to the object.

The design could be modified so that the LEDs can be placed together with all light appearing through a single tube or source. A disadvantage to this approach would be a reduction in brightness. An advantage would be that only one light source (the tube) needs to be aligned with the sensor for optimal and equal reflection.



For objects up close, the multicolor LED (also called an RGB LED) works pretty well for reducing object-position errors. Unfortunately, as the RGB LED is lifted up, it becomes apparent that the position of the individual color chips within the single lens causes the light sources to diverge. Perhaps this isn't as much of a problem with other RGB LEDs?

Speed Limitation

Only two or three complete color readings can be performed per second. The cadmium-sulfide photocell needs time to react to the brightness changes. Blinking the LEDs faster than this rate reduces contrast until all colors result in the same apparent reflective value, as though all LEDs were lit at the same time.

A visible-light phototransistor would provide superior speed. The infrared (remote-control quality) phototransistors I possess are all nearly insensitive to visible light, especially blue. Therefore, infrared diodes and infrared phototransistors won't work.

At first I thought I could use the "visible phototransistor" from Jameco Electronics (part number 120221, product number BPW77, for $1.99 each). However, the datasheet shows that the phototransistor is 100% sensitive for infrared, 50% sensitive for red, 33% sensitive for green, and even less sensitive for blue. This could be somewhat compensated for by using lower-value resistors on the green LED and blue LED so that they would emit more light.

A better choice is the family of TAOS light-to-voltage converters. Each consists of a fast true-visible-light photodiode and an amplifier in a hobbyist-friendly three-pin package. No external voltage-divider resistor is necessary.

At Mouser Electronics, you can find three major visible-light varieties that trade off speed vs. light sensitivity. (But even the slowest one is 1000 times faster than a cadmium-sulfide photocell.)

* TSL12S-LF or TSL250R-LF: Slower speed but more light sensitive.
* TSL13S-LF or TSL251R-LF: Middle speed and middle light sensitivity.
* TSL14S-LF or TSL252R-LF: Faster speed but less light sensitivity.



The [sloppy] paint job on the RGB LED is to prevent light from going directly to the TAOS photosensor. This sensor arrangement works by have each LED color (red, green, and blue) in the RGB LED turned on one at a time, the light then reflects off of an object, and is read by the photosensor. The next color is turned on, the results read, and so on.

Friday, May 23, 2008

TINY MOTOR



Tiny motors are wonderful for driving little robots (like Appetizer or Chicago) or turning small parts (like sensors) on big robots. Illustrated above, from left to right:

* Blue m&m's candy for size comparison
* Cell-phone vibrating motor (salvaged)
* Solarbotics #TPM tiny pager motor. Replaced by TMP2 ($4.95) -- comes with clean shaft (no weight)
* Solarbotics #RPM pager motor. Replaced by RMP2 ($3.95) -- comes with clean shaft (no weight)

Electronic Goldmine has a number of pager motors with weights on their shafts: G12809 ($0.99), G13566 ($1.29), G15241 ($0.99), G15768 ($0.99), G15768 ($0.99 for 2), G16153 ($1.00).
BGMicro has a pager motor with a weight on its shaft: MOT1030 ($0.99).
All Electronics has a pager motor with a weight on its shaft: #DCM-204 ($1.25).

Solarbotics sells tiny geared pager motors!!

Geared motors are far superior to ordinary pager motors for robotics, since they have more torque (pushing power) and rotate more slowly. See the GM10 ($12) and GM15 ($19) in the Motors section of Solarbotics. Although slightly larger than most pager motors, the GM11, GM11a, GM12a, GM13a, GM18, GM19 ($19.75-$23 each) are still relatively small and are worth a look.

Parts

Before discarding a damaged or obsolete cell phone, pager, or force-feedback joystick (aka game controller), crack it open and recover the vibrating element! The vibrating part usually consists of a miniature motor with an offset-weighted shaft. Because the piece of metal on the shaft is not centered, when the motor spins it causes the device to shift back-and-forth as the weight of the metal piece shifts around and around the motor shaft. Vibration.



Dremel High-Speed Rotary Tool Failure

The offset weight must be removed to make an effective robot motor.

My first attempt at removal was to use a cutting wheel. Then, I tried to use a grinding stone. Although I successfully removed the weight, the process was difficult and took a long time. More significantly, the motor shaft got damaged. In the above photos, the shaft is nearly ground to half diameter. That's not good!

Someone with greater skill and tool-accessory knowledge could probably perform the operation better than I could. The Dremel isn't at fault.

Seriously, always wear goggles or protective eye wear when working with tools!



Locking Pliers

The metal attached to my cell-phone vibrating motors is extremely strong. It doesn't appear to be made of lead or some other malleable element. The metal ended up dulling or damaging the heads of standard pliers and cutters. Even when I could get a grip, I ended up pulling out the entire shaft of the motor. That's not good either!

While attempting to get a better grip on the motor, I accidentally discovered a reliable, repeatable, and easy way to remove the metal weight. Simply applying the locking force of locking pliers to the weight seems to crush or deform the metal very slightly, but enough to pop the crimp.

Unless you've got super powers, normal pliers won't work. The leveraged force of locking pliers is absolutely necessary.



Position, Squeeze, and Tug:

Grip the metal weight at the end of the locking pliers like popping off a beer cap with your molars. (The American Dental Association would like to point out that the prior sentence is very reckless and is likely to result in the enrichment of your local dental specialist.) Try to grip across only the crimped portion of the metal weight, so that it can squish out rather than crimp further. The motor body shouldn't be touching the pliers at all.

Use the greatest squeezing force the pliers can reasonably apply. The more the initial resistance to the squeeze, the easier it is to remove the motor shaft. When positioned and squeezed just right, I barely had to tug on the motor body to pull the shaft from the weight.

Use only your hand to pull on the motor body. No other pliers or tools should be necessary.



Alternate Method: Slitted Metal:

Depending on your access to precision machine tools (like a lathe and a milling machine), it may be possible for you to make a custom gear puller. If not, then a slightly more crude method can produce similar results.



Find the thickest piece of flat stock metal sheet (can be from a junk drawer) that will fit between the end of the motor and the gear or other object you want to remove. Saw or cut a slit part of the way through the metal sheet. See item (1) in above picture. The slit should be wide enough that the motor shaft can be slid on, leaving the gear on one side of the sheet and the motor on the other side of the sheet.

Then, find a rod (like from a consumed Dremel grinding bit) or make a punch tool that can fit through the object to make contact with the motor shaft. See item (2) in the above picture.



Place this setup on a vise or something similar to support the metal sheet. With the rod making contact with the motor shaft, gently tap the rod with a hammer. This should force the motor shaft out of the gear. At some point, the motor will fall to the floor. Be sure to put a blanket or something there to catch the motor.

Better still, if you have an arbor press, you can use the same tools to ease the motor free, rather than tapping on it with a hammer.

Monday, May 5, 2008

Robo's Think Like Humans


You know the future has arrived when scientists bring together two staples of science fiction: lasers and robots.

But rather than 50-tonne behemoths dealing death with a massive light cannon, the El-E robot is instead using lasers to think like a human.

Scientists at the Georgia Institute of Technology and the Emory University School of Medicine believe they have found the answer to the difficulties that robots have in processing the imperfections of the real world using laser pointers.

Ordering El-E to retrieve an item is as simple as shining a laser pointer on the object you want. The pointer can also be used a second time to tell El-E to put the object in a certain place or give it to a specific person.

Above, Charlie Kemp, director of the Healthcare Robotics Center at Georgia Tech and Emory, accepts a towel from El-E.




El-E, named after its arm's resemblance to an elephant trunk, as seen here, can grasp a range of household items including towels, pill bottles and telephones from floors or tables.

The robot and its ability to pick up items from both floors and shelves could be a lifeline for people who have mobility difficulties.

El-E's creators are gathering input from ALS (also known as Lou Gehrig's disease) patients and doctors to prepare El-E to assist patients with severe mobility challenges.

Researchers from Georgia Tech and Emory are working with an expert on human-computer interactions to ensure the robot will one-day be ready to be used in people's homes.



El-E uses a custom-built omni-directional camera to see most of the room. After it detects a selection has been made with the laser pointer, the robot moves two cameras to look at the laser spot and triangulate its position in three-dimensional space.

Once it has reached an object, sensors in its hands will guide it on opening and closing its gripper until it has a firm hold, as pictured here.

The robot is able to detect the difference between a face, a table or the floor so it is able to carefully present an object to a person or place it on a table or the floor.



Researchers say one of the key benefits of the system is that El-E does not need to understand what objects are called, instead relying on an array of sensors similar to those seen here.

El-E's power and computation is all on board and runs Ubuntu Linux on a Mac Mini.

Kemp said: "We humans naturally point at things but we aren't very accurate, so we use the context of the situation or verbal cues to clarify which object is important.

"Robots have some ability to retrieve specific, predefined objects, such as a soda can, but retrieving generic everyday objects has been a challenge for robots."

Georgia Tech and Emory researchers are now working to help El-E expand its capabilities to include switching lights on and off when the user selects a light switch and opening and closing doors when the user selects a door knob.

FIRE BREATHING ROBOT



Those metal sculptures really looks great, and the best thing is that those weird mechanic’s have a lots of fire for you. Those are fire breathing robots and it looks too cool. These creative creators of those weird robots really do have some extra free time. Take a look at pictures and enjoy.



Jumping spiders, flaming bots and unnamed “things” inhabit the Greathouse Labs, providing lots of overheated excitement:



Terminator-like entities haunt the grounds:




Wicked-looking battle bots and robot crawlers lurk in the garage, the walking cannons scurry around like mechanized chickens:



Imagine meeting this thing somewhere in the country field in the middle of the night… You just might become a connoisseur of “grotesque” for the rest of your life.

Friday, April 18, 2008

Neural Network Example

A simple example for testing a neural network implementation is trying to
learn the digits 0..9 from a seven-segment display representation. Figure 19.8
shows the arrangement of the segments and the numerical input and training
output for the neural network, which could be read from a data file. Note that
there are ten output neurons, one for each digit, 0..9. This will be much easier
to learn than e.g. a four-digit binary encoded output (0000 to 1001).



Figure 19.9 shows the decrease of total error values by applying the backpropagation
procedure on the complete input data set for some 700 iterations.
Eventually the goal of an error value below 0.1 is reached and the algorithm
terminates. The weights stored in the neural net are now ready to take on previously
unseen real data. In this example the trained network could e.g. be tested
against 7-segment inputs with a single defective segment (always on or always
off).



Neural Controller

Control of mobile robots produces tangible actions from sensor inputs. A controller for a robot receives input from its sensors, processes the data using relevantlogic, and sends appropriate signals to the actuators. For most large tasks, the ideal mapping from input to action is not clearly specified nor readily apparent. Such tasks require a control program that must be carefully designed and tested in the robot’s operational environment. The creation of these control programs is an ongoing concern in robotics as the range of viable application domains expands, increasing the complexity of tasks expected of autonomous robots.

A number of questions need to be answered before the feed-forward ANN in Figure can be implemented. Among them are: How can the success of the network be measured? The robot should perform a collision-free left-wall following.

How can the training be performed?

In simulation or on the real robot.

What is the desired motor output for each situation?

The motor function that drives the robot close to the wall on the left-hand
side and avoids collisions.

Neural networks have been successfully used to mediate directly between
sensors and actuators to perform certain tasks. Past research has focused on
using neural net controllers to learn individual behaviors. Vershure developed
a working set of behaviors by employing a neural net controller to drive a set
of motors from collision detection, range finding, and target detection sensors
[Vershure et al. 1995]. The on-line learning rule of the neural net was designed
to emulate the action of Pavlovian classical conditioning. The resulting controller
associated actions beneficial to task performance with positive feedback.
Adaptive logic networks (ALNs), a variation of NNs that only use boolean
operations for computation, were successfully employed in simulation by
Kube et al. to perform simple cooperative group behaviors [Kube, Zhang,
Wang 1993]. The advantage of the ALN representation is that it is easily mappable
directly to hardware once the controller has reached a suitable working
state.
In Chapter 22 an implementation of a neural controller is described that is
used as an arbitrator or selector of a number of behaviors. Instead of applying a
learning method like backpropagation shown in Section 19.3, a genetic algorithm
is used to evolve a neural network that satisfies the requirements.

NEURAL NETWORKS

The artificial neural network (ANN), often simply called neural network(NN), is a processing model loosely derived from biological neurons [Gurney 2002]. Neural networks are often used for classification problems or decision making problems that do not have a simple or straightforward algorithmic solution. The beauty of a neural network is its ability to learn an input to output mapping from a set of training cases without explicit programming, and then being able to generalize this mapping to cases not seen previously. There is a large research community as well as numerous industrial users
working on neural network principles and applications [Rumelhart, McClelland 1986], [Zaknich 2003]. In this chapter, we only briefly touch on this subject and concentrate on the topics relevant to mobile robots.

Neural Network Principles:

A neural network is constructed from a number of individual units called neurons that are linked with each other via connections. Each individual neuron has a number of inputs, a processing node, and a single output, while each connection from one neuron to another is associated with a weight. Processing in a neural network takes place in parallel for all neurons. Each neuron constantly (in an endless loop) evaluates (reads) its inputs, calculates its local activation value according to a formula shown below, and produces (writes) an output value.

The activation function of a neuron a(I, W) is the weighted sum of its inputs, i.e. each input is multiplied by the associated weight and all these terms are added. The neuron’s output is determined by the output function o(I, W),for which numerous different models exist.In the simplest case, just thresholding is used for the output function. For our purposes, however, we use the non-linear “sigmoid” output function
defined in Figure 19.1 and shown in Figure 19.2, which has superior characteristics for learning (see Section 19.3). This sigmoid function approximates the Heaviside step function, with parameter ๔€• controlling the slope of the graph
(usually set to 1).






Feed-Forward Networks:

A neural net is constructed from a number of interconnected neurons, which are usually arranged in layers. The outputs of one layer of neurons are connected to the inputs of the following layer. The first layer of neurons is called the “input layer”, since its inputs are connected to external data, for example sensors to the outside world. The last layer of neurons is called the “output layer”, accordingly, since its outputs are the result of the total neural network and are made available to the outside. These could be connected, for example, to robot actuators or external decision units. All neuron layers between the input layer and the output layer are called “hidden layers”, since their actions cannot be observed directly from the outside.

If all connections go from the outputs of one layer to the input of the next layer, and there are no connections within the same layer or connections from a later layer back to an earlier layer, then this type of network is called a “feedforward network”. Feed-forward networks (Figure 19.3) are used for the simplest types of ANNs and differ significantly from feedback networks, which we will not look further into here.




For most practical applications, a single hidden layer is sufficient, so the typical NN for our purposes has exactly three layers:

• Input layer (for example input from robot sensors)

• Hidden layer (connected to input and output layer)

• Output layer (for example output to robot actuators)

Perceptron Incidentally, the first feed-forward network proposed by Rosenblatt had only two layers, one input layer and one output layer [Rosenblatt 1962]. However, these so-called “Perceptrons” were severely limited in their computational power because of this restriction, as was soon after discovered by [Minsky,Papert 1969]. Unfortunately, this publication almost brought neural network research to a halt for several years, although the principal restriction applies only to two-layer networks, not for networks with three layers or more. In the standard three-layer network, the input layer is usually simplified in the way that the input values are directly taken as neuron activation. No activation function is called for input neurons.

Friday, April 11, 2008

Working Of Remote Control System

Wireless control has always seemed to fascinate people, and Questor’s remote control system is the heart of his appeal. While the technical aspects of remote control may be
a little hard for the novice to grasp, Questor’s remote control system is rather simple in construction. Before I go into detail on how the system is comprised, a brief explanation of remote control is in order.

A remote control system consists of three basic components.The first is the transmitter or “encoder.” Moving controls on thetransmitter causes it to send or encode signals to the second part of the remote control system, the receiver, or decoder. Thereceiver gets the signals from the transmitter and then decodesthem. Depending on what signal the receiver decoded, it willactivate a servo, the third part of the system. Servos are the
mechanical part of a remote control system.

A wheel or sometimes bar on the servo will turn in proportion with the movement
of the transmitter’s control. This movement can then be used to directly control the function of a robot, or in Questor’s case to trip switches that control his movements.
Questor’s remote control system is a standard off-the-shelf type like that pictured in Fig. 4-1. Notice the three main parts of the system. The robot requires a system with a minimum of two channels.

A two-channel system has two servos; each of the servos is used to control one of the robot’s motorized wheels. The system used in my version of Questor has three
channels; the third channel is used to trip two switches that can turn other items on the robot on or off.




The switches that the servos trip are called leaf switches (Fig below). A leaf switch is a very small on/off switch that is triggered by depressing a small metal strip or “leaf” on the switch. By using four leaf switches, it is possible to recreate the function of the DPDT switches used in the temporary control box.



A total of eight switches is needed to duplicate the function of the DPDT switches used to control the robot’s motorized wheels. One servo is then used to trip four switches in
such a way to drive the wheel either forward or reverse. You use the control sticks on the remote control transmitter in the same way as you flipped the DPDT switches on the temporary control box; up is forward, center is off, and down is reverse.

If you chose a remote control system with more than two channels, you can use the other servos to trip leaf switches for turning other devices on or off, or control motors (forward,
stop, and reverse) within the robot. The third servo of my remote control system is used to turn a horn on and off.





You need only one leaf switch per function if that function is to be turned only on or off. Figure above shows how the leaf switches are positioned and triggered for either on/off or forward/reverse control. By now you’re probably wondering
where all this fits inside of Questor. The remote control system (servos and receiver), leaf switches, and other components are mounted on a motherboard that is then installed inside Questor’s framework.

Sunday, April 6, 2008

Camera Sensor Data

We have to distinguish between grayscale and color cameras, although, as we will see, there is only a minor difference between the two. The simplest available sensor chips provide a grayscale image of 120 lines by 160 columns with 1 byte per pixel (for example VLSI Vision VV5301 in grayscale or VV6301 in color). A value of zero represents a black pixel, a value of 255 is a white pixel, everything in between is a shade of gray. Figure below illustrates such an image. The camera transmits the image data in row-major order, usually after a certain frame-start sequence.

Creating a color camera sensor chip from a grayscale camera sensor chip is
very simple. All it needs is a layer of paint over the pixel mask. The standard
technique for pixels arranged in a grid is the Bayer pattern (Figure 2.17). Pixels
in odd rows (1, 3, 5, etc.) are colored alternately in green and red, while
pixels in even rows (2, 4, 6, etc.) are colored alternately in blue and green.



With this colored filter over the pixel array, each pixel only records the intensity of a certain color component. For example, a pixel with a red filter will
only record the red intensity at its position. At first glance, this requires 4 bytes
per color pixel: green and red from one line, and blue and green (again) from the line below. This would result effectively in a 60๔€ต80 color image with an additional, redundant green byte per pixel. However, there is one thing that is easily overlooked. The four components red, green1, blue, and green2 are not sampled at the same position. For example, the blue sensor pixel is below and to the right of the red pixel. So by treating the four components as one pixel, we have already applied some sort of filtering and lost information.



A technique called “demosaicing” can be used to restore the image in full 120๔€ต160 resolution and in full color. This technique basically recalculates the three color component values (R, G, B) for each pixel position, for example by averaging the four closest component neighbors of the same color. Figure below shows the three times four pixels used for demosaicing the red, green, and blue components of the pixel at position [3,2] (assuming the image starts in the top left corner with [0,0]).



Averaging, however, is only the simplest method of image value restoration
and does not produce the best results. A number of articles have researched better algorithms for demosaicing [Kimmel 1999], [Muresan, Parks 2002].

Camera Sensor Hardware


In recent years we have experienced a shift in camera sensor technology. The previously dominant CCD (charge coupled device) sensor chips are now being overtaken by the cheaper to produce CMOS (complementary metal oxide semiconductor) sensor chips.

The brightness sensitivity range for CMOS sensors is typically larger than that of CCD sensors by several orders of magnitude.For interfacing to an embedded system, however, this does not make a difference. Most sensors provide several different interfacing protocols that can be selected via software.

On the one hand, this allows a more versatile hardware design, but on the other hand sensors become as complex as another microcontroller system and therefore software design becomes quite involved. Typical hardware interfaces for camera sensors are 16bit parallel, 8bit parallel, 4bit parallel, or serial.

In addition, a number of control signals have to be provided from the controller. Only a few sensors buffer the image data and allow arbitrarily slow reading from the controller via handshaking. This is an ideal solution for slower controllers. However, the standard camera chip provides its own clock signal and sends the full image data as a stream with some frame-start signal. This means the controller CPU has to be fast enough to keep up with the data stream.

The parameters that can be set in software vary between sensor chips. Most common are the setting of frame rate, image start in (x,y), image size in (x,y), brightness, contrast, color intensity, and auto-brightness. The simplest camera interface to a CPU is shown in Figure below.



The camera clock is linked to a CPU interrupt, while the parallel camera data output is connected directly to the data bus. Every single image byte from the camera will cause an interrupt at the CPU, which will then enable the camera output and read one image data byte from the data bus Every interrupt creates considerable overhead, since system registers have to be saved and restored on the stack.Starting and returning from an interrupt takes about 10 times the execution time of a normal command, depending on the microcontroller used. Therefore, creating one interrupt per image byte is not the best possible solution. It would be better to buffer a number of bytes and then use an interrupt much less frequently to do a bulk data transfer of
image data.

Figure below shows this approach using a FIFO buffer for intermediate storing of image data. The advantage of a FIFO buffer is that it supports unsynchronized read and write in parallel.So while the camera is writing data to the FIFO buffer, the CPU can read data out, with the remaining buffer contents staying undisturbed.The camera output is linked to the FIFO input, with the camera’s pixel clock triggering the FIFO write line. From the CPU side, the FIFO data output is connected to the system’s data bus, with the chip select triggering the FIFO read line. The FIFO provides three additional status lines:

• Empty flag

• Full flag

• Half full flag

These digital outputs of the FIFO can be used to control the bulk reading of
data from the FIFO. Since there is a continuous data stream going into the
FIFO, the most important of these lines in our application is the half full flag,
which we connected to a CPU interrupt line. Whenever the FIFO is half full,
we initiate a bulk read operation of 50% of the FIFO’s contents. Assuming the
CPU responds quickly enough, the full flag should never be activated, since
this would indicate an imminent loss of image data.

Tuesday, April 1, 2008

MOTHERBOARD

The motherboard is simply a 10-10-1/8-inch piece of plywood on which all of the components for the remote control system are mounted. The various components consist of the remote control system’s servos, receiver, and battery pack, along with ten leaf switches, four barrier strips, and a four-slot fuse holder. Figure 4-4 shows where each item is placed on the board.

The first items to be mounted are the servos. Cutouts will have to be made in the board to allow the servos to sit flush with the board. To do this, first place the servos evenly spaced on the motherboard and trace around their bases. Cut out the wood where traced and slip the servos in place. The servos’ body should have tabs sticking out along its top edge; these tabs prevent the servo from going all the way
through the board and this is where the servos are screwed to the board. Most remote control systems come with either plastic wheels and/or star levers that are screwed on the servo’s motor.



WIRING THE MOTHERBOARD:

Before you wire the motherboard, cut two notches on each side of the motherboard so the wires will not go past its edge. Figure 4-8 shows how to wire together the components on the motherboard. There are two main rows of barrier strips on the
motherboard; the first row is numbered.

These numbers correspond with numbers on the tabs of the leaf switches; simply wire the matching numbers together. In some cases more than one wire will go to one post on the barrier strip. Use the half of the barrier strip closest to the leaf switches. The color wire used is indicated on the leaf switch: R _ red, B _ black. The other row is where the motorized wheel and horn will be connected; they too use the matching number system.

The second row is divided into two parts called power grids. The first 8 post (which is one complete barrier strip) is called the positive grid and is where the positive lead of the battery is connected and where all the positive or red wires from Questor’s electronics will be connected. The second 8 post is for the negative or black wires and is called the negative power grid. All the posts on the same side of each grid must be wired together by one wire run from post to post.

Be sure not to run a wire between the positive and negative grids; this will cause a short circuit. Figure 4-8 shows where the wire runs. Later when other functions are wired, the instructions will say “wire to positive power grid and negative power grid.” You can then connect those wires to any open post on the grids. Figure 4-8 also shows four wires coming from the positive grid to the fuse holder. These wires are all positive and you should use red wires.

Two more red wires run from the opposite ends of two of the fuses directly to the post on the leaf switch barrier strips. This is where the switch gets the power to control two on/off functions in the robot. (The negative or black wire forms the function being controlled; in my robot a horn is wired directly to the positive power grid.) There are also two black wires running from the negative power grid to the leaf switch barrier strips at post 8 and 2.

These are also shown in figure below...



Wires to the leaf switches and fuse holder will have to be soldered. The wires that lead to the barrier strips should have hooks bent at their ends so they can wrap around the screws on the strip. After the board is wired, check it against Figure because errors here can affect the function of the rest of the robot. Also at this time, install four 20-amp fuses
in the fuse holder. These fuses help protect the robot’s components from short circuits and overloads. Once the board is wired and checked, the remote control receiver can
be mounted and the motherboard mounted in Questor’s framework.

COMPLETING THE MOTHERBOARD:

The remote control’s receiver and battery are mounted on the underside of the motherboard. Using four screw-on hooks, rubber bands and foam rubber, the receiver is held securely in place. Figure shows how to mount the receiver. The figure
is self-explanatory. The only thing to keep in mind is that the servos must be wired to the receiver, so don’t mount the receiver out of reach of the servo wires.

The order in which the servos are connected to the receiver is very important to the control of the robot. When both control sticks on the transmitter are pushed up, the
robot should move forward. If both sticks are pulled down, the robot should run in reverse. The center or neutral position is off and of course causes no movement of the robot. If you have a third channel (and servo) in your remote control system, it should react to the sideways movement of one of the control sticks on the transmitter.




Table 4-2 lists all of the control combinations used to operate Questor’s functions. It is not necessary to wire the motorized wheels to the motherboard. To check this simply make sure that when thesticks are pushed forward, the two servos controlling the motorized wheels turn as shown in Fig. 4-10. If you have a third servo a sideways movement of either stick should causethe servo to activate it.