Archive for the ‘Robot’ Category
Friday Night Robotics – Yoda Bot Extender Shield and R2D2

Y O D A ! This Friday Night Robotics I added an extra shield to the Rampage Robot, aka Yoda Bot. BUT I also did some other random things during this week. No computers though, all hardware this week.
The plan is to take this stackable robot design, and actually add a layer to it!

From the shield extending headers that I received from Krafter’s big box and some protoboard that I have hanging around, this should be a pretty simple task. This is the finished product!

Not sure about the center of gravity with Yoda sort of hanging off the back of the robot. This will probably have to be tested. It would be nice if it is offset from the center just enough to produce some cool wheelies!
Some other things that I did that week were…
Bought some rechargeable D cell batteries for Artoo!

The amount of detail that was put in to this robot toy is so amazing, it’s really cool. Check out the sparkly gold “wires” on its feet!

When I eventually hack Artoo, I’m going to do it by splicing the wires, because I still want the “original” Artoo to be operational. Check out Artoo wearing my NASA JPL cap!

Here’s a video of some of the things that Artoo can do already:
Testing Out R2D2 from RobotGrrl on Vimeo.
The next thing that I did was paint the Lego for the RoboGlyphs stand to be conductive. This is using the conductive paint that Krafter sent in the big box!

The paint smells really bad, I highly recommend painting it outside.

For the second coat, I did indeed paint it outside:

That’s about it. It dried, but I’m a little worried about the cracks between the bricks. I’ll measure the resistance with an Ohm Meter next time to see if it is continuous!
Unboxing Krafter’s Box!

From the Fat Man and Circuit Girl internet circuit reality show’s chatroom, a fellow member krafter boxed up a bunch of electronic goodies and sent them to me to prepare robots for epic world domination! I am super happy and thankful
Let’s see what’s inside the box:

In here is conductive fabric, foam, thread and some conductive charcoal paint. There is also insulating tape, which prevents two circuit boards that are close to eachother from shorting out. The conductive paint will be useful to paint some lego for the RoboGlyphs project! The conductive thread and the fabric will be great for BubbleBoy’s scarf, as another sensor that can be used to influence it’s behaviour!

Shapelock! This is stuff that you can put into water and it becomes malleable, it’s completely awesome! It can be used to create gears, gearboxes, robot parts, whatever. I recently thought of a use that would be really fun, perhaps a lens adapter for my camera!

“Opto device” sounds totally robotic. A matching emitter and detector, these are great so that you don’t have to figure out what the frequencies of both components are so that they can be detectable and stuff. They’ll probably go onto Yoda Bot to detect obstacles

Bag o parts: inside there’s this cool segmented display. It looks like it will be hard to communicate to though! There are also 15 purple LED’s in here, and there are also photogates in here. A photogate can be used on TECHNOROBOT as an encoder for its antenna!

Screw shield! At the moment of unpacking it, I thought it would be great for MANOI, but it actually doesn’t fit. It is great on Yoda Bot, though!

Shield extenders, for adding another layer onto Yoda bot!

Dremel accessories, so that I can destroy things for a very long time!

Conductive tape! Not sure how I could use this yet…

An AC Dremel! So happy that this isn’t a battery one that loses power and strength too easily. Dremels are so cool. I can finally cut things now! I tried it with cutting a CD. It’s really cool. Can’t wait to destroy some other things with a Dremel!

An R2D2!!!!! Wowee!!! I just watched the three original Star Wars movies a few months ago, and changed the various sounds of my computer to beeps and whirrs mimicking R2. I was also in the middle of making a super cool AppleScript that would be an R2 TTS. Beep boop boop whirr! This robot is going to be so awesome to hack!

Aretoo where are you?

Dremeled a CD!

Behold the purpleness!
So yeah. More supplies to make more great robots! They have been very useful already. Thank you Krafter!
Refurbishing Robot

The missing parts to the TECHNOROBOT kit that I got at the explOratorium during the Stanford EPGY AI Program in 2008 have been found! This robot has been transformed many times, the first as an idea/prototype for an emotional line following robot, then a snowplow, and now it will be an XBee messenger robot!
Refurbishing it was OK, it only took 4 hours. The only thing that was drastically broken was the drive axel. To fix it, I used some Lego axels.
The robot now uses an Arduino, and is powered off of USB. The motor is driven with the Adafruit Motor Shield (I plan to add more motors to the robot someday). The motor is powered from an Adafruit mintyboost.
I broadcasted the refurbishment to the Fat Man and Circuit Girl stream, AND took a photo every 5 seconds! You can see the HD timelapse on Vimeo!
The next steps for this robot is rather short:
- Make a battery pack for the Arduino
- Attach XBee
- Mount an ultrasonic sensor, program a simple behaviour
- Transmit messages, listen to messages
Can’t wait to blog more about it!
Friday Night Robotics – Crazy Computers?!
For some reason, this weekend (July 16th) all of my computers went crazy at the same time! My Macbook had a disk stuck in its drive, and the Mac Mini decided to spontaneously explode into madness when trying to remove a partition. The Mac Mini would not want to boot from the disk, either. It actually couldn’t understand any keyboard input at startup at all!
The fix for the Macbook turned out to be using a piece of cardboard to fish the disk out. It took a lot of patience and practice!
The fix for the Mac Mini was to take it to the Apple Store, where they used an older Apple keyboard (white plastic) and it worked perfectly, first shot. I’m not too sure why the aluminum keyboards don’t work the same. Heheh!
So here is a video of the TECHNOROBOT working, enjoy!
TECHNOROBOT Moving Around from RobotGrrl on Vimeo.
FNR – BubbleBoy Behaviour AI
This week and this Friday Night Robotics I was working on a behaviour AI for the newly refurbished BubbleBoy! It is much easier to design an AI that you know will be interactable with thew orld! Without the headbobbing capability of BubbleBoy, this effort would not be worth it.
BubbleBoy’s behaviour is primarily focused on food and water. BubbleBoy lives its anthropomorphized life just be be fed/watered! This means that BubbleBoy will want to know when it will expect to be fed, so that way it can headbob at the most optimal times. Being fed/watered is having a button pressed on BubbleBoy’s green stage area (the part with the blue and white LCD).
BubbleBoy will have three sensors, and a rudimentary measure time. The three sensors are the LDR, lid switch, and Xbee. All of these are onboard the robot (except for the Xbee which isn’t implemented yet).
Here’s a broad flowchart of the behaviour, which I will then explain below in detail.

-
Creating the Expectation
-
Pattern Finding
-
Determining the Sensor to Use
-
Calculating the Cost Adjustment
-
Following the Expectation
-
Real-World Behaviors
-
Last part of Following the Expectation
This is the observatory phase. BubbleBoy initially does not have any expectation of when to be fed, so it waits around. While it is waiting, its collecting data from all of the sensors and storing them to an array. There has to be 10 numbers in the array for each sensor before BubbleBoy can proceed to the next stage, pattern finding. Once this is fulfilled, and if BubbleBoy is fed/watered, then it goes on to find a pattern.
BubbleBoy is seen as a simple robot. Thereby, its pattern finding is relatively simple as well. The main idea is to check each sensor’s array and see if there is a pattern within the residuals. Meaning, if looking for a sequential pattern, the array would be iterated through (starting at i=0, stopping after i=8), and i+1 would be subtracted from i. An average of the residual change would be calculated at the same time. The array would be iterated through again, this time to count how many items are within +- 10% of the residual average. If the count is above 7, then it is said that there is a sequential pattern in there.
The same process is done for a secondary pattern, and a ‘thirdary’ pattern. Meaning, every 2nd number and 3rd number is checked to see if there is a pattern. It also goes through and checks with offsets, just incase the pattern is “even/odd/whatever”.
If there are no patterns, a random primary sensor is chosen for BubbleBoy to work with.
A problem exists in determining which pattern for which sensor to trust the most. A thirdary pattern for a photosensor is less dependable than a sequential pattern for a lid switch. This is handled in the next step.
The sensor with whatever pattern to follow is chosen through a Bayes Filter. This allows for a simple specification of confidence levels for a given sense resulting in a particular state through a table where all rows add up to 1.0. The sense columns are the sensor and pattern type. Meaning, there’s three sensors for every sensor, giving 9 senses in total. The states are confidence intervals. Anything >= 85 would be considered the most confident.

The numbers in bold are the ones that are more probable to be a result. A sensor in particular to look at is the Xbee for a thirdary pattern. The numbers are dispersed in such a way that it is almost a bimodal distribution. In order to understand why this is, imagine the scenario in real:
Xbee modems can communicate for up to a few meters. If BubbleBoy only receives a message every 3rd instance, it could either be a clever pattern, or it could be a miscommunication.
For this reason, the largest probability is given to the least confident state, and the second largest probability is given to the most confident state. It depends on the Bayes Filter and random roulette for what will actually be chosen.
This is just for determining what sensor is the most confident, that will provide the best result. This can mean that the chosen sensor will be followed, but it also may not. This will be explained in the next step.
The adjusted cost is determined by using the result from the previous step, and multiplying the probability by the inverse of whatever column it was situated in. In simpler terms, if the result was found in the best confidence interval state, then it would be multiplied by 5. If it was in ( 85, 70 ], it would be multiplied by 4…
This is then used as the sense for the next Bayes Filter. The state is how much of a cost to reduce the sense by.

Once the cost adjustment amount is determined, it is then subtracted from the cost of the particular sense’s cell. All of the senses are in a grid, with the most “primary” being the closest to BubbleBoy. An A* search is then used to choose the closest and least cost sensor. Once this is done, BubbleBoy can get on to entertaining its audience while waiting for food/water!
This is the main loop of the program. It’s where BubbleBoy is thinking in the present time about if it will be fed or not!
The key idea here is that BubbleBoy is thinking in the now. Meaning, it tracks the patterns differently than it does when it is reflecting back on them (in a “past” thought).
Sensor data is retrieved and placed into an array of size 10. The data at i is checked wither it is within +- 10% of the average in the pattern. The threshold percentage amount differs for the type of pattern, where secondary would be +- 20%, and thirdary would be +- 30%. If the data fits in to the check, then a “yes” counter is incremented.
Once the “yes” counter is >= 6, the food level will begin to decrease by (i/2)^2. At the same time, BubbleBoy will begin to show signs that he is excited to be fed/watered soon, by spinning its hat and bobbing its head.
If the “no” counter is >= 6, then it means that the expectation isn’t really working in the present thought. A flag is set to redo the expectation once BubbleBoy receives food and water.
i is then either incremented or reset to 0, depending if it hit 9 or not. (That’s a sort of obvious step)
When the time elapsed from not receiving food exceeds 150% of that of the observed elapsed time, BubbleBoy goes in to a “wallow” mode. When BubbleBoy is wallowing, it spins its hat slowly, and bobs rarely.
If the time elapsed is ( 150%, 100% ], BubbleBoy is “angry” because it did not receive its food exactly before the time elapsed. The hat will not spin, and BubbleBoy will bob side to side, and once (quickly) in the opposite axis to simulate a sort of “twitching” to all this anger!
If the time elapsed is ( 100%, 85% ], BubbleBoy is eager to please. Hat tricks will be common, same as delightful bobbing. Depending on how much food/water BubbleBoy has, it may also hoola hoop!
Depending on when BubbleBoy was fed, if it was in ( whatever, 100 ], the expectation will be done. Essentially, BubbleBoy is a positive/eager thinker that believes it should always be fed before the elapsed observed time. What an attitude!
If it is in [ 85, 100 ), then the expectation will be kept.
To reformulate the expectation, the previous steps are executed on the collected data. Then, everything repeats!
What will be super interesting to see, in my opinion, will be when the discrepancies occur from past thought to present thought. It will be interesting to see which sensors fare better through that transformation.
It will also be interesting to see if this actually can work on an Arduino, and not in simulation. I created a simulated version of BubbleBoy in Processing earlier in the week.

I’ll do the initial coding and testing through this simulation, mainly because I already coded the Bayes Filter Algorithm (with random roulette) in Processing from 2009 Honors Summer Research.
Plus, in Processing it is very simple to communicate to an Arduino through Firmata. I can read in the data from BubbleBoy through there.
Hopefully next Friday I will have devised a test sequence to test the soon-to-be-coded AI on. This will of course be Open Source, under the Attribution-NonCommercial-ShareAlike 3.0 Unported License (BY-NC-SA).
Let me know what you think of this AI in the comment section below! (And yes I know it is very linear, but BubbleBoy doesn’t have enough DOF in the real world to spend the effort making the AI more nonlinear, since the observed result will essentially be the same!)