Posts Tagged ‘ATmega328’

Hockey MANOI – a summary

Posted by Erin, the RobotGrrl on Saturday, January 3rd, 2009

I made a pretty good summary of Hockey MANOI in this thread at Trossen Robotics forum. I figured I should post it on my blog because it is a good summary :D and I broke it down into easy to read parts, so it’s like a whole JOURNEY of awesome!

Hello TRC World! :D

My project is a hockey playing humanoid.

It uses a MANOI AT01 kit, controlled by an Arduino (with an ATmega328) with a Wave Shield, and a SSC-32.

Humanoids have always been associated with walking or running. This project focuses on a different action for humanoids, skating. The end result of this project yields an interesting vision of the possibilities of skating robots.

Introduction

The idea came around when I was trying to make my humanoid (MANOI AT01) walk. Instead of taking a “big bite”, I decided to take a smaller bite and make it slide its feet. However, I quickly realized that when it slides its feet, it looks exactly like a newbie Canadian hockey player!

A Canadian newbie hockey player begins to skate by almost walking. Although the skater doesn’t go far, he does move forward due to the friction between the blade of the skate and the ice.

When I did notice this, I quickly grabbed some lego to create MANOI’s own version of skates, which are similar to rollerskates. I mounted the lego onto the feet using velcro.

The hockey stick I just found laying around. I had to cut a bit of it off, as it was too tall. I use tape and tie wraps to keep it mounted to MANOI.

Development

Development on this project was mainly trial and error. To get all of the motions correct so they all balance together was critical.

Instead of using the controller board that is usually used to control the MANOI, I did a major transplant and substituted it for the Arduino and SSC-32. This allows me to have much more flexibility in terms of sensing and creating motions. The H2H software was too problematic.

Usually what would happen is I would draw out a motion, on paper, that I would want to create, and I would put it into MANOI. Sometimes I got it first try, other times I didn’t. However, the cool part is that a lot of the motions stemmed from the ideas of other motions.

For instance, in the video of MANOI Skating with music (seen below), the motion where MANOI is running is actually a faster version of the sway motion! That was really surprising.

The development for the Wii nunchuck part of the code was quite easy as I had already established all of the variables and settings of when the nunchuck is tilted left or right, forwards or backwards. Instead of using real numbers for it though, I just defined a “home position” of the nunchuck, and subtracted or added numbers to the accelerometer axis, x y and z.

The music part of the wave shield was quite fun and straight forward. I looked around for the songs, and put them on a SD card which plugs into the wave shield. From there, it was just a simple method call inside of the Arduino.

Once the above developments were done, I wanted to create a version of MANOI that could sense if a ball/puck/object was there. I did this by using LDRs and LEDs.

Rest assured, I would have used IR Sensors if I had any ;) This was the best alternative I had, though!

On the left side of the sticks the LEDs are in a yellow casing, and on the right side they are in a clear casing. There is some effect on the reading, however their values change precisely the same when an object is in front of the stick.

The black construction paper enclosure around the LDRs was required to direct the reading. Otherwise, the light from the LEDs saturated the reading and no difference was seen when an object was present or not.

I observed the change between the readings of when there was an object present, and when there was not an object present.

From this, I created a simple neuron, where if the input values succeed a predefined threshold, it will perform an action. In this case, the action would be to shoot the object.

I had to tweak the threshold a little to make it work with smaller objects, such as a roll of electrical tape.

In the video below, you will observe that it does work with a roll of electrical tape, a ball, and a spool of lead solder (the LEAD solder isn’t mine, it’s my DAD’s because he can’t use non-lead solder like the rest of us -_- ;). The spool is white, which proves that the theory does work, meaning that the light that is reflected from the LEDs back into the same LDR board does not obscure the readings.

Results

Here are the videos that you can look at!

This is the first video, where I was just getting the motions down.

The program is basically a sequence of movements:

- Forward 6 times
- Shoot 3 times
- Backward 6 times
- Shoot 3 times

As you can see, the forward and backward movements both result in MANOI moving backwards. As I later found out, through trial and error, it was due to the Arduino and power cords limiting the movement of MANOI! Once they were mounted properly, it worked much better.

This is the second video, where MANOI is controlled by the Wii nunchuck!

You press Z to shoot, and you hold C and tilt to move it. :D MANOI can move forwards, backwards, left, right, and home.

This is there third video, where MANOI is playing a little game of hockey by himself while listening to some music. The song that you first hear is the Hockey Night in Canada theme song!

This is the last video, where MANOI can autonomously decide if he should shoot or not.

(The quality in that video is quite yucky, please check out the video on [URL="http://vimeo.com/2641041?pg=embed&sec=2641041"]vimeo[/URL] if you’d like to see it in better quality)

Conclusion

In conclusion, this project was SO much fun! The only time I didn’t enjoy it was when I was trying to hold MANOI, who was whacking me with its stick, with one hand and trying to type in some code with my other hand.

My favourite part was watching people play with the Wii version of the code. They really enjoyed it!

I also liked making the AI part too, that was pretty fun.

Next Steps

The next steps would include coding a modified version of the Bayes filter algorithm to predict if an object is in front of the stick or not.

More sensors would be fun, like three proximity sensors mounted on the front, left and right. This way MANOI could avoid opponents trying to take the ball off of it.

I would also add two more servos in the leg that would allow rotation. This would then allow me to create a more realistic skating humanoid, where there would actually be a stride.

Perhaps I could also add a camera to the head so that it could track where the ball/puck/object is.

That’s my project, I hope you like it! ^_^
You can see more of everything I mentioned at robotgrrl.com

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Posted in: MANOI, Programming, Projects, Robot.

Friday Night Robotics

Posted by Erin, the RobotGrrl on Friday, December 26th, 2008

Merry Christmas and Happy Holidays to everyone!
Best of all… it’s ROCK EM SOCK EM ROBOTS DAY! (Boxing Day)

Just as a fair warning, if this entry has more bizarre grammar mess-ups than usual, it’s because I ate too many jelly beans, and all I can think of is jelly beans! Robot jelly beans, jelly bean slushie, a meadow of jelly beans, jelly bean snow… *goes on and on* I think in pictures… and all I can think of right now is a DANCING JELLY BEAN ROBOT! Hahaha, joking. (Or am I?) ^_^

I hardly realized it was Friday today, so it doesn’t really feel like a FNR.

Last Friday, although I didn’t blog it, I was working on the LEDs that you’ll see on the stick, and the program! This Friday I tested and twirked the program so I can blog it.

Here is MANOI!

MANOI Hockey AI

Do you notice something different about the stick?

MANOI Hockey AI

The stick now has two perf boards on it! These perf boards have three yellow LEDs surrounding a LDR which has black construction paper around it.

MANOI Hockey AI

MANOI Hockey AI

The reason why I chose these yellow LEDs was nothing scientific. These were the only ones I had where I could have some consistency across the two boards. The LEDs on the left are inside of a yellow casing. The ones on the right are in a clear casing. There is a little bit of a difference in the readings of the LDRs, but they both work the same.

I would have really liked to do a different version of this but with an IR sensor and a FSR, but, as I mentioned above, these were the only things I had, and they will for sure get the job done!

What happens is the LDRs “spit out” a reading of the amount of light around it. I use the cardboard to ensure it is directed at what we want to be observing. When there is no object between the two LDRs, the reading is very high. Yet, when there is an object between the two, the reading drops a fair amount. This is because the LDR cannot sense the light from the opposite LEDs. I also tested this with a fairly white object (my DAD’s lead solder spool (eeew lead)) and it does work, meaning the reflected light from the LEDs back into the LDR (on the same board) does not obscure it. You can see for yourself in the video below. :)

I tinkered with the LDRs’ amount that it to create a threshold that will trigger MANOI’s shot. From what I learned at Stanford, this is simply called a neuron. It has input values, and if they meet a certain threshold,it will do something. This is a very primitive form of AI, but big things come in simple steps. =)

Here is a video of MANOI action! Pretend that the roll of tape is a hockey puck… it almost looks the same!


MANOI Hockey Robot AI from RobotGrrl on Vimeo.

It is also on youtube, here.

At the beginning, you see the LEDs flash. This means that the Arduino is soon going to evaluate the LDR levels. It takes five samples from each LDR, one every 500 ms. It then makes an average, which is the baseline used for comparing the LDR value against the threshold.

Yes, I agree, that this can completely become messed up. I will probably implement a markov approach to create (and update) the baseline. However, I’ll probably only do that after I make a modified Bayes algorithm for the AI. :)

You might have noticed something different about MANOI’s other hand. I’m giving it a gripping claw so that it can grip stuff. It won’t be meant to hold on to anything precious, but it could emphasize an effect here or there.

MANOI Hockey AI

While I was adding on the boards, there was just not enough room for all of the stuff that I needed… like +5V and -Gnd. I made a thing with headers and inverted headers so I can easily plug it in!

MANOI Hockey AI

It saves much needed space on the wave shield:

MANOI Hockey AI

Just to add, today I was using an Arduino with an ATmega328. :)

There are more pictures that you can look at in this photoset on Flickr!

This project is almost finished! I just will add in an algorithm improving the AI, make more videos… and that’s it! I will continue the project later on, though with a few more things. I’ll add servos that can rotate the leg so I can make the robot actually skate, and many more things that I am still thinking of. :P

Can you believe that the Trossen Robotics robot contest deadline is really soon? Yikes!! :P
I just have to take a few more videos and work out what I will say in my post… what do you think the judges will be looking for? Hopefully it won’t end up like BubbleBoy in crabfu’s competition… x_x

Though, when crabfu was on Daily Planet (I actually saw it on TV (like two months before all of the robot websites started to go crazy over it), not on youtube) he described his robots as having character because you can interact with them through a control pad.

I think that is completely opposite, because then it is just the human expressing their character through a machine. When you don’t have to use a remote, yet the robot still interacts with its environment, that’s when a robot truly has character. :d

Now we know why BubbleBoy obviously lost… He can have his definition, and I’ll have mine. :) His works are very interesting though! I never knew you had to start a fire to make a steam thingy move. I figured you would just boil water or something… hahahaha :D (I never thought as far as you would need fire to make water boil, though… EPIC NOT-WIN!) XD

I hope you really enjoyed this blog post. It makes a lot more sense now that one can see what the finished robot will look like!

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Posted in: MANOI, Projects, Robot.

Friday Night Robotics – Adventures with ATmega328

Posted by Erin, the RobotGrrl on Friday, December 5th, 2008

During the week I was testing various things and shields to see if they worked okay with the ATmega328. The wave and motor shield worked okay, but the WiiChuck library did not.

I don’t even think it’s a problem with the new avr-gcc or the board- the code for the shield is made for Arduino 0012, whereas the WiiChuck library wasn’t. Lots of people have problems with Arduino 0012, it has so many bugs compared to Arduino 0011. :(

My plan is to have two Arduinos going: the 328 would be controlling the SSC-32 and the Wave shield. It would listen for input, maybe a few numbers, and move the robot accordingly. The numbers would be sent from the other Arduino, which is using the WiiChuck code.

I can actually expand on this idea more and get another few Xbee Kits and an Xbee so that the two Arduinos could talk wirelessly.

Here’s a picture of when my ATmega168 flew under a cabinet-thing =) :

Oh yeah! I’m getting a Sanguino with super shipping, so it should be here really soon! :) Thanks E.V. =) =)

(Then I’ll have to re-think my robot AGAIN! Hahahaha)

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Posted in: Programming, Projects, Robot.

It’s December!

Posted by Erin, the RobotGrrl on Tuesday, December 2nd, 2008

It’s December!

I thought of a stupid idea which may turn out to be somewhat cool… I’m going to draw a robot graphic each day for the entire month and post it on here. :)

As for those decoration robots, here are pictures:

I think they will make good gifts… :)

The ATmega328 is going okay, I guess. I still don’t have it working yet- I tried the Windows XP machine and Java just freaks out on there.

I finally googled the right keywords and found a mac version… but it doesn’t work either. :/ I’ll have to play around with it…

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Posted in: Art, Other, Programming, Projects.

Giving in to the ATmega328

Posted by Erin, the RobotGrrl on Monday, December 1st, 2008

Today I’m going to give in to the 30K of memory in the ATmega328. x_x

Yesterday I was trying to compile the code I wrote for MANOI, and it’s always a few hundred bytes too big. 8( How am I supposed to do anything if it’s too BIG?!

I hope that the modified version of Arduino 11 will work okay on my Windows XP machine… why do I get this feeling that it won’t … xS

Those XMAS decorations that I was making the other day I had to put a pause on since I couldn’t find a hole puncher. The XACTO knife wasn’t XACTLY doing its job >_> . I think that the hole punch will be too big for the LED, so I’m not sure yet what I’ll do. Hmmmmm!

Oh yeah, if you didn’t notice- I fixed the smilies O:) … but I also accidentally deleted all of the links from the sidebar. I’ll have to re-add them by hand AGAIN! Grrrrrr… >:(

EDIT: Nevermind… they weren’t deleted :>

Post to Twitter Post to Delicious Post to Digg Post to Facebook Post to Reddit Post to StumbleUpon

Posted in: Art, Programming, Projects, Robot.