Tuesday, May 17, 2011

NXT Projects: Line Follower

Our next assignment with the NXTs was to build a line following robot using only one reflector sensor. This made things difficult, but my partner and I went to work.




The first order of business was building the robot. We put a pivoting wheel in the front so that it could turn as the line turned. After building the robot, we started working on the code.
This program says to go at 50% speed until the reflector sensor reads less than 15 at which point the right motor coasts and the left motor keeps going until it finds the line, then the left motor coasts and the right motor keeps going.

 Our program gives the robot a jerky movement, but it follows the line rather well so we were happy.
 

NXT Projects: Silly-Walking Robots and Going the Distance


This was our first day working with LEGO NXTs, and our first assignment was to make them walk. Which, as it turns out, is not as easy as it sounds. This was a really quick, in-class assignment so I didn't remember to take video, sorry!
The next part of the class we built robots with wheels (a little bit more elegant than the jerking, walking robots). We had to make these robots drive a certain distance and stop before hitting a pedestrian:
My partner as I used ultrasound to detect where our pedestrian was. As we got closer, the car stopped. At first, we had the car go directly up to the pedestrian and stop. The car's momentum made it hit the pedestrian, so we made it stop further away from our little guy.





Final Project: Game Time

PROBLEM!!
We got to the lab a little over an hour before the showing of final projects in the science center, and our puppet is completely broken! Sometime in the night it fell off the table and all of the motors fell out and the strings were utterly tangled. It was a stressful disaster. And to top it all off, we ran out of glue sticks for the hot glue gun, which was how we attached the motors to the box. So, duct tape came to the rescue. It wasn't pretty, but it worked and that's what counts.
The exhibition went very well, and our puppet danced his pants off. Other than a slightly gimpy right arm, everything worked really well and people really enjoyed playing with it. My partner took some great video of me and another girl using the Man-ipulator. They are on her blog, http://jchevallier.tumblr.com/, but we had some difficulty downloading them because they were taken with her phone, which is why I don't have them. My camera died a few minutes before the exhibition and I don't have a smart phone to download the videos. We had an awesome time showing people how everything worked, and anyone who had played DDR was impressed by our homemade pad.
Unfortunately, after two hours of vigorous play, our little Harvard boy wasn't holding up so well. The duct tape couldn't hold up one of the motors and it was hitting another, making a little grinding noise. Very unpleasant.
So that was the end of our final project! We were really happy with how it turned out, and impressed with ourselves for following through with out idea.

Final Project: Finishing Touches

Now that the main parts were done, all we had to do was make it look good. This was a fun part.
We decided to call our little game the Man-ipulator, in true Wellesley fashion, and we made our guy a nice, preppy Harvard boy. With a bright yellow baseball cap (I thought his head looked empty).
We spray painted the box black, and then added a little bit of sparkly spray paint. Voila! Instant party atmosphere.

Because we were done with a few days to spare, we decided (after prompting from our professor) to make the program better and tweak a few little things. I rearranged the motors so there was more space and changed the string from nylon thread to floss. The string had been slowly unraveling, and looked generally messy. Because the floss is already coated in wax, we knew that it wouldn't unravel.
As for programming, things became a little bit more complicated. This is where we ran into some trouble. At first, the motors would just keep rotating, pulling the puppet right into the little spools we had attached to kept the thread in place. It was a little stressful. However, after a few hours of work, we had a working code!




These new codes worked REALLY well, and we were super excited about them. Now, instead of the puppet moving a limb to its full extension when a pad is pressed, the limb moves only when the pad continues to be pressed. So now we could have little movements. To prevent someone from reeling the puppet all the way into the motors, we put a cap on how much they could rotate. That way, even if someone stayed on the pad, the puppet would just stay at its full extension. This way, two limbs could be moving at the same time, making for a much more dynamic dance.

Final Project: Programming

Now that we had everything put together, it was time to program. Here's where I thought we would run into major snags, but while I was building the body and pad, Juliette had pre-written the code she though would work, and all we had to do when everything was put together was plug in the amount of rotation each motor needed to do. Of course, it wasn't that simple--there were a few kinks to work out about which NXT was communicating with another, and which mailbox it was sending data to, but that was so minor compare to what I thought we were going to have to go through with the programming. Thank goodness for Juliette!
These codes are for the NXTs attached to the pads. They are the codes sending the resistance measurements to the NXTs attached to the motors. In a nutshell, it says that if the resistance reads more than 50, send that data to the NXT controlling the motor. All of theses codes are in "while" loops so that the NXTs are constantly checking the numbers they are receiving.



These programs are for the NXTs attached to the puppet. What they tell the NXT is if they receive a number over 50 in a certain mailbox, the motor associated with that mailbox rotates a certain number, pauses for a short time, and then returns to where it started.

Monday, May 16, 2011

Final Project: The Making of the Pad

So far in our project, everything was running smoothly. We weren't having any technical or mechanical difficulties, we were ahead of the schedule we set for ourselves, and the only thing to do for a few days was wait for the materials we needed for the dance pad.

This was a really fun part. We ordered copper taffeta and conductive foam, bought some carpet padding, and Juliette's mom sent us some FABULOUS fabric to cover everything. So we got to work. First, we tested a miniature version of the pad:
Our pads consisted of conductive foam sandwiched between copper taffeta that has a wire soldered to each side. pressing on the pad changes the resistance between the wires, and we can measure that change using LEGO NXTs. We choose to use NXTs for our project because of the Bluetooth capability because the pad and the dancer are separate. Bluetooth gave us flexibility in where we could set up our project, because the pad could be quite far away from the dancer, and if we decided to put it in a display case that would not have been an issue.



We made a mock pad on the floor with masking tape so we could get a feel for how big it should be. 


To measure resistance on the NXT, we had so trick it. It actually doesn't have a way to measure resistance, so we connected the wires to its light sensor. The numbers it collects read from 0, when the pad isn't pressed, to 100, when the pad is pressed. The wires that read the "light" are the black and white wires, so we just soldered wires onto a connector and it plugs right in! We were good to go!
HI JULIETTE!!
Duct tape is GOD



As you can see, we have seven sensors connected to 2 different NXTs. Each pad controls a different motor. We have pads for the elbows, knees, and hands, and another for the right hip, so he can do a little hip action.

Final Project: The Making

Our first task was to make the body of the puppet. First, I drew a sketch which was roughly the size of that we wanted:

After sketching, it was time to design in SolidWorks!

 Now, I'm a huge fan of splines in SolidWorks, so most everything in this design is made with splines! I don't know why, but I find using splines and auto-dimensioning is really quick and easy. This design only took about 15-20 minutes, including a few iterations of shape until we found the "perfect bod."
Next, and this is my favorite part, we sent the file over to the laser cutter to be printed. We used relatively thin Delrin because our puppet did not have to be particularly resilient. After the printing, we drilled holes for hinges. We wanted the puppet to have easily movable joints and be authentically marionette-ish, so we used some stripped wire soldered into loops as hinges.
TADA!!

Final Project: The Idea

The theme for out final project is "Puppet Show," which, at first, seemed a little difficult. What would we do with puppets? Should we be traditional and use a marionette or hand puppets? I had no ideas at first. Our first assignment, therefore, was to brainstorm. Everyone presented three or four ideas in class so that everyone could find something they would be interested in doing. I watched some puppet videos on Youtube, thought about the mechanics of different options, and eventually came up with 4 ideas I was pretty excited about.

The first was inspired by N*Sync, the 90's pop boy band. All of their music video dances were very coordinated, and I thought it would be pretty funny to have a coordinated N*Sync dance performed by puppets. My second idea was inspired by DDR, the dancing video game. I imagined a mat much like the DDR mat: pressure sensors in a square and a space to stand in the center. Each button would control a part of the puppet, which would be mounted on a little stage. From this dancing idea came another: the "man-handler." Our professor told us about "bend sensors" which measured resistance as they are bent. The sensors can be big or small, and can be implemented into a variety of things. My idea was to make a glove with bend sensors in the fingers. Each finger would control a limb of a marionette mounted from a wall or a box. My final idea was inspired by one of my favorite online games: QWOP (http://www.foddy.net/Athletics.html). I wasn't sure exactly how the mechanics of the action would work, but the idea was exciting to me.

After everyone had presented their ideas, we had a little time to think about who we would like to work with on  the project, and what idea we would like to work on. I talked with a classmate about a few different ideas and how to make them work mechanically.

Our next assignment was to make LEGO prototypes of our different ideas. They didn't have to be perfect, but they had to show roughly how we expected our puppets to work. Juliette and I decided to collaborate and try out our ideas together, since we had enjoyed working together in class on daily projects. We talked and talked about ways to make our different ideas work, and eventually we make a model for an idea.


As you can see, it's a very rough model. But the concept is the important part. This model works by the motors rotating and the string lifting up the limb it is attached to. We thought a lot about how the motors will be controlled. Our first idea was by bend sensors in a glove. As each finger is bent, a different motor rotates, moving a different limb. We researched on a few websites about either buying or hand-making bend sensors, but then we found this great website with ideas for pressure sensors. We decided to combine two ideas: the "man-handler" and the DDR puppet dancer. The motors would be controlled by pressure sensors in a pad that is connected via bluetooth to the motors attached to the marionette strings.

Tuesday, February 22, 2011

Day 7: More Birds!

Today we get to present our birds in class! My partner, Lisa, and I fully assembled our bird the day before, and we ran into a few complications. The "body" we made for our bird didn't fit quite perfectly, so we had to make a few modifications. First, when we turned the crank our wings were too close to the backs of the two support pieces we made for them, and so we had to sand down the edges to make them rounded which made it easier for the wings to turn. We then decided to make the two piano wires we press-fitted into the Delrin rod at the wings closer together so that the wings wouldn't wobble around. This helped a little, but as we kept cranking the mechanism we realized that the tips of the wings kept tapping the table. It wasn't really a huge deal, but it bothered us enough that we sawed off the last part of the wings. This solved our problems, and we could decorate our bird! Since the Delrin is white, we decided to just stick with white and made our bird into a swan, naming it Natalie (if you've seen Black Swan, you understand).




Cute, right? We certainly like her. Some thoughts after assembly: I'm officially a huge fan of the piano wire. It's so easy to work with, and doesn't require reprinting all of your parts on the laser printer each time you need to change something. However, I would not recommend using the piano wire method if precision is imperative. The drill doesn't drill the same way each time, and the holes can be off if it doesn't go in straight. For our purposes, it was great.