Monday, May 17, 2010

Fire Fighting Robot- Part 10 videos

Here are some videos of our test runs after our best trial runs. We were having problems with sensors detecting the candle, so most of the videos show the MotorCar spinning around trying to detect it.


In order to fix this problem, we had to re-print the values that the sensors read at those locations. It was a bit hard to do this because there was limited space for us to use because a lot of groups were using the floor space, so we weren't able to hook up our MotorCar to the computer whenever we wanted.
Another problem that we had was that the car deviated to the right after it centered on the candle at the starting line. We didn't really know why this occurred and we changed our program to try to fix this, for example we made our nudge smaller and less powerful, but the car kept shooting off to the right.
Here is a video of this:


By fixing the nudge, we were able to make the car deviate to the right less and it became less of a problem because even if the car beared to the right, it was able to see the candle at the halfway mark. In the video below, we came across this problem where the car did not stop when it was near the candle. The mechanism turned when the MotorCar was at a certain distance from the candle just like the program said but the car itself did not stop! This was so strange because we didn't have these problems before and we had not changed any part of the program. We were using the same basic program this whole time and it was strange that these problems arose when we had never seen them before.
Here is a video of this occurrence:


By the time of this video, the end of finals were coming and I had to leave for home. I had spent a lot of time working on this final challenge and although we had some successes, it was a bit disappointing to not have it work by the end of that night. Even though we were not able to extinguish the fire that night, we had learned a lot throughout this whole process about designing, programming and just trying to find a consistent and clever solution. Despite the challenges, this final project was a lot of fun and it was really satisfying when things worked exactly the way you wanted them to. I just wish that I had more time to carefully look over our program and to come up with a solution.

Sunday, May 16, 2010

Fire Fighting Robot- Part 9 Best Videos

Despite some of the challenges we came across, we had some pretty successful runs. We were actually able to put out the candle, but unfortunately we did not get a video of it. We really regretted not recording this because we were not able to get the same results. This shows how inconsistent our program was. We were able to get the MotorCar to reach and put out the candle fairly quickly, but the more we worked on it, the less and less successful we were. It was extremely frustrating because we had been successful and every time we fixed a problem in our program, another problem arose. It was also very frustrating that the candles changed constantly because we always had to adjust to it and that took us a lot of time.

Below are two videos of our most successful runs. In both of them, the MotorCar just misses the candle. It would have been nice if the shaker shook left to right, instead of back and forth, in these occurences because then the candle would have definitely been extinguished.



Fire Fighting Robot- Part 8 Other Problems

To make our MotorCar perform better we added capacitors on our breadboard. Although we did not have problems with this, we wanted to prevent our LogoChip from frying up. By having the MotorCar spin left and right rapidly, it can cause the LogoChip to fry up and by using capacitors it allowed us to smooth the output of power supplies. Here is a picture of the capacitors (in blue) on our breadboard:
Another problem that we had was with programming. Because we relied a lot on counts and our straight prorportional program, we had to remember to re-set our "count a" and our "count b" back to 0 whenever we told the MotorCar to move forward for a certain amount of counts. In this video below, you can see the effect of not re-setting the counts to zero because instead of the car moving straightforward, it went off a different direction. This was a major problem because our goal was to direct the MotorCar towards the candle and it was frustrating when the car deviated away from it.

Below is a video of our MotorCar missing the target:
As you can see, the MotorCar passes the candle because the sensor values that we set in our program were off. When Esther and I tested out what the sensors read when they were very close to the candle, we recorded the values and set them in our program. However, as time went on and the candle decreased in size, which changed the values that the sensors read at that specific location. So as the MotorCar was spinning around to locate the candle, it was a bit off and it deviated away from it. This was a recurring problem that we had and in order to fix this problem, we had to constantly check our sensor values.

Fire Fighting Robot- Part 7 Problems

We came across several problems during the process of having the car finding the candle. The main problem was that the environment that the car was in constantly changed. As long as the candle was lit, it decreased in size which would change the values that the sensors would read at a certain distance. Because of this, we had to constantly change the values in our program and constantly check that the sensors were reading the same values. In order to avoid this, we tried to have the same sized candle. We had to have a relatively low candle so that it wouldn't come in contact with the shaker or burn the plastic. When it was getting too low, we changed the candle and picked a new one so that the flame would be 11cm of the ground, just to keep things consistent. Here is a picture of the size of the candle that we used:Another problem was the the sensors kept shifting. Obviously, this would alter the readings of the sensors. So in order to avoid that, we taped the sensors at the exact positions that we wanted so that would not move. This actually worked pretty well and we didn't have to worry about re-adjusting the sensors all the time.
Another problem was that baking soda isn't the best thing to work with. A lot of other groups in the class were using baking soda and it left the floor very messy. As you can see in the picture below, baking soda got everywhere and it really affected the way our MotorCar moved. The baking soda made the wheels slip and the shaft encoders don't take into account slippage, which would really affect the counts and our straight proportional program embedded in our larger program. It also affected the way the MotorCar turned. Instead of spinning quickly, it made these large circles which affected the car's position and the values that the sensors would be reading.
Here is a picture of the baking soda on the wheels:
In order to avoid this program, we cleaned the wheels regularly and we swept the floor after every test run. We sometimes had to clean the floor with water because the baking soda accumulated so much.

Another problem was a weight distribution issue. We were concerned that because most of weight was on the right side which would make the car topple over. Well it just did that. Here is a video of it:

In order to fix that we added some batteries on the back and left side of the car as weights to create some more stability. This proved to work very well because the car did not topple over again.

Fire Fighting Robot- Part 6 Picoblocks

Now that we had our mechanism down, we were able to focus on the programming aspect of the final challenge. It took a lot of trial and error to figure out to make the MotorCar find the candle. Our candle-finding algorithm consisted of using shaft encoders to have the MotorCar travel a certain distance and having several checkpoints during its path to make sure that it is directed towards the candle.
We first had the car spin left to locate the candle. Once it did, we had the MotorCar stop and since it didn't always stop precisely in front of the candle, we had it nudge in order to find a more precise position. After the car was centered on the candle, we had the car travel halfway, using the shaft encoders. Once the car reached that halfway mark, we had it spin again to center itself on the candle. Then we had it move bit more forward, so that it was had 75% of the way. We had it check again its positioning and after that point we had it inch up to the candle and check its position regularly. This would ensure that the car would always travel towards the candle. Once the MotorCar was close, we had it travel until the sensors at reached a certain value. We didn't want to MotorCar to run over the candle and since the mechanism extends out, we had the MotorCar stop a safe distance away from it, this time by not using shaft encoders but sensor values.We did this by using "wait until" blocks. So for example in the second to last block, we had the car move forward and once the sensors read a certain value, it stopped. The rest of the program was similar to that procedure and uses a lot of "wait until" blocks. For example with the checkpoints, we had the car spin left until it read a certain value and then it stopped.
This technique required us to check what the sensors read at each of the checkpoints. The problem was that these values constantly changed as the candle decreased in size and if the sensors shifted on the MotorCar. Another problem was that the car did not always move to these exact checkpoints because sometimes the MotorCar did not travel perfectly straight. So in order to account for that, we made our sensor values a bit lower so that if the MotorCar was behind its checkpoint, it would still be able to see the candle. It was just a tedious process because the sensors a very sensitive and it is hard to get accuracy in the MotorCar's movements.
Below are screenshots of our LogoChop programs:


Above are the blocks that are responsible for the basic movements of the blocks, for example like moving forward, stopping, spinning left and right. We copied these blocks from our previous LogoChip challenges in this course.
Below you can see our program, the long list of blocks to the left. It consists of various of small procedures that consist of the MotorCar checking its positioning or moving forward. As you can see, it is a pretty long program that has many parts to it. The last block turns on the motor for the mechanism and tells the shaker to shake for 8 seconds.

When we tested our program, it worked fairly well but it required a lot of patience and double checking. It would have been better if we had made a program that relied less on the shaft encoders and that moved forward according to what the sensors read, instead of having it checking for its positioning every once in a while. What we could have done was to first have the car center on the candle and then to have it keep the candle within its range of sight by using the sensors. There many other ways to solve this challenge, but some are more accurate and easier than others. I'm afraid that we did not pick the easiest solution, but that is part of engineering and it takes a lot trials and errors to figure out the best way to achieve something. By the end of the week, Esther and I didn't really have enough time to re-create a program, but we decided to work with what we had and even though we had a some pretty successful test runs, our program was not consistent in its results.

Fire Fighting Robot- Part 5 Shaker Idea

Esther and I had to think of another way to put out the candle using our mechanism. We realized that our mechanism was not good at pulling things, but it was good at pushing things and at moving back and forth relatively fast. We decided to focus on the strong aspects of our mechanism and we transformed our mechanism into a shaker. We thought about having something shake something over the candle that would put it out. It is relatively easy to put out a candle with baking soda and it is lighter than sand, so we decided to use baking soda.
In order to make a shaker, we made a piece on SolidWorks that would attach to our mechanism. We designed that extra piece according to a box-like plastic piece that we found in the engineering lab. We drilled holes in this plastic piece that small enough so that the baking soda would not just fall out while the car was in motion and large enough so that a decent amount of baking soda would sprinkle out as the shaker was shaking back and forth. In our design, the plastic piece would just fit on the delrin piece and we could remove it whenever we wanted. We attached this new delrin piece to the our mechanism by heat staking them together and this proved to be very effective because our new shaker was very sturdy. Here are some pictures of our new shaker:
As you can see, the shaker requires less support and reinforcements than with the spritzer idea. This was very nice because we could reduce the amount of Lego pieces we used as well as the overall weight of the MotorCar. We could also have a clear view of the breadboard and it made it easier for us to change wires and to connect the motor powering the mechanism to our breadboard. We were able to see very quickly how much easier it was going to work with this shaker idea rather than the spritzer idea and how much time we would save trying to make it work.
Here is a close-up picture of the new delrin piece and the plastic piece:
Here is a picture of the what our robot looked like after we finished attaching the mechanism to the robot:
To connect the NXT motor to our breadboard, we had to go back to one of our LogoChip challenges. Since these motors are designed to use a 9 volt power supply, we needed to supply it with more power and in order to do this we wired a transistor to power our NXT motor. We connected it to pin P3, so in order to turn it on and control its speed with PicoBlocks we used the "setpower3" command. We reduced the power a bit because with full power the shaker was shaking way too fast.
Now we had to figure out if it actually worked! This was the moment of truth and we were pretty nervous because we had been spending a lot of time trying to put out this candle and if it didn't work, we would have to spend more time making new reiterations.
But it worked beautifully and it put out the candle almost instantly. Here is a video of it:

As you can see in the video, the shaker is moving rapidly and that is because we removed the extra gears because now our intent was to create a fast motion and not a strong pull.
Another good thing about this mechanism is that it is very stable and even with this rapid motion, it did not fall apart. The only concern that we had was that most of the weight was on the right side and we didn't want the car to topple over. So I added some more Lego blocks to the left side of the car in order balance the car a little bit.

Fire Fighting Robot- Part 4 Spritzer Idea

As we changed the design of our robot, we continuously tested our mechanism out on the spritzer by powering the NXT motor. To our disappointment, the mechanism never worked because it wasn't powerful enough to pull the handle of the spritzer. As a result, something always broke off at the weakest point of our design. So we decided to get assistance from the professors because we were at the point where we didn't know how to make our mechanism work.
Professor Turbak first told us to focus on the mechanism without having it being attached to the robot. We would worry about attaching it to our robot later. So we designed a "spritzing unit" where the mechanism was attached to the motor, the spritzer and the Lego pieces . Unfortunately I do not have picture of this, but it looked like some kind of "spritzing gun" and we succeeded in making it pretty sturdy. Professor Turbak showed us a trick that would make our design sturdier and it was to add vertical components to our "Lego towers" so that they would not break apart. To increase the power supplied for pulling the handle, Professor Turbak also showed us that we could play around with the gears. We attached other gears of varying sizes to our main gear on the axle to increase the torque. We saw that going from small gears to big gears increased the overall torque and that it decreased speed of rotation. We ended up using a 15:1 gear ratio and we could really see a difference in the pull that the mechanism provided. Unfortunately, even with this gear ration, the mechanism still could not pull that handle.
Again, pictures would have been very helpful to show our "spritzing unit" and our gears, but in the end we ended up not continuing with our spritzing idea. Even with all the changes and reinforcements that we made on our model, the mechanism was simply not powerful enough to pull the handle on the spritzer. Every time we tested it out, something broke off of our model and it became very frustrating. To decrease the amount of force needed to pull the handle, we could have extended the handle but doing so would increase the amount of space and the amount of Lego pieces that we would need, adding weight to the car and making it harder navigate. It would also make our whole design more complex and we were not completely certain that it would successful, so because of the limited amount of time we had to complete the challenge, we thought it would be better if we left our spritzer idea behind and used our delrin mechanism for something a lot simpler.

Saturday, May 15, 2010

Fire Fighting Robot- Part 3 Spritzer Idea

Today, we designed our mechanism on SolidWorks. We intended to use a servo motor to power it, but Professor Berg warned us that it would probably provide enough power to pull the handle of the spritzer. So we decided to use a NXT Lego motor along with the Lego gears (we did not want to make gears out of delrin) because they would provide enough torque. Since the NXT motor is designed to connect to Lego pieces, using this motor was a lot easier than using a servo motor because we didn't have to worry about connecting it to our robot with extra delrin pieces. Here is a picture of the motor that we are planning to use:After deciding which motor we were going to use, we were able to make the other pieces. We closely followed our Lego model for measurements, which proved to be very successful because all the pieces fit together. We used rods to connect delrin pieces together and lego pieces to connect delring pieces with lego pieces. All of our holes were designed to be loose fits so that the pieces would rotate smoothly. We then made bushings (tight fits) to secure the pieces on the rods. We made different bushings for the rods, lego rod, and lego black connecting pieces. It took us a couple designs to find the perfect bushing size and in the end they worked very well and made our mechanism stable and function wonderfully. Here is a picture of our mechanism attached to the motor:
In this picture, we placed our mechanism to the right side and our motor to the left side of the robot. We wanted to distribute the weight so that the robot would not topple to one side as it was moving. However, because the motor was separated from the mechanism with a certain distance (as we can see in the picture),when we powered our motor, the mechanism wobbled a lot and most of the energy was lost to the lego rod. The lego rod connecting the NXT motor, the gears and the delrin piece moved a lot so we decided that it was best that we take away that distance between the gear and the motor. We also decided that it would be best if the mechanism was pulling on the spritzer directly behind it, rather than having it pull it from the side. This would concentrate all the power towards pulling the spritzer.
Because of all the changes we wanted to make, we greatly altered the design of our robot. We took this opportunity to minimize the amount of lego pieces we would use in order to make our robot lighter.

Sunday, May 9, 2010

Fire Fighting Robot- Part 2

Today, we focused on the programming aspect of this project. Esther and I think that this will be one of the biggest challenges of this final project, because making the MotorCar move exactly where you want is actually pretty hard, especially after finishing the LogoChip challenges. In order to detect the candle, We were given four photo transistors. We attached the photo transistors to legos so that they could move left to right and up and down and then connected them to the front of our MotorCar. Here is a picture of the photo transistors:On the breadboard, they are connected to the outputs and so on PicoBlocks, because they are sensors, we can print out the values that these photo transistors record. In order to get a feel for what kind of values the sensors gave, we attached them to the front of the car and lit a candle fairly close to it.On Picoblocks, we were able to see the values that each sensor recorded and we immediately saw that some of the sensors were weaker than others. There was great disparity in the values. For example, when the candle was up close, sensor 1 printed values below the hundreds, while sensor 4 printed out values above a thousand. This was very important to note because we would have to take in account different ranges of values for each sensor. So we designated the weaker sensors to locate the candle at a short range and the stronger sensors to locate the candle at a long range.
We decided to use 4 photo transistors: 2 for long range and 2 for short range. In doing so, we can locate the candle more accurately because the motion of the MotorCar will be restricted by two sets of limits, instead of one. This will also ensure that the car will move straight towards the candle, instead of having one sensor move straight towards the candle.
To test the long range sensors, we placed the candle 10 feet away from the MotorCar. We positioned the photo transistors (sensor 3 and 4) at our desired angle and we read the values that they gave. Sensor 4 fluctuated from 730 to 760 while Sensor 3 fluctuated from 750 and 770.
For our short range sensors, we placed the candle close to the MotorCar, at the distance at which the robot could put out the fire. Like with the long range sensors, we positioned our photo transistors (sensor 1 and 2) and read the values from PicoBlocks. Both sensor 1 and sensor 2 fluctuated around 5 and 10.
The values that we obtained are very important because we will use them in our program to ensure that the MotorCar is moving straight towards the candle and that it stops at the proper distance from it.
Below is a picture of how we placed the candle in order to test the values from the photo transistors.

Friday, May 7, 2010

Fire Fighting Robot- Part 1

For our final project in this class, the challenge is to make a fire fighting robot. We can use and build upon our existing MotorCar and use a mechanism primarily built from laser cut parts. The goal is to extinguish a candle that will be placed 10 feet away from the MotorCar. The car will not be necessarily placed directly facing the candle. We are also limited to one motor to power our mechanism.
Esther and I first started brainstorming about different ways to put out a fire. We needed to think of a clever, yet simple, idea that would get the job done because we knew that we did not have a lot of time to complete this project. So we had a few ideas:
  1. snuffing the candle
  2. using vinegar and baking soda
  3. "pinching" the flame
  4. throwing a heavy fabric on top of the flame
  5. using a spritzer
In the end, we decided to go with the spritzer idea because it put out the flame effectively and also because no previous groups, that we know of, had used a spritzer. For example, we really liked the snuffing idea, but a previous group created a really cool robot with a snuffer and we really wanted to be original.
So we looked at the spritzers that were located in the room. We decided to use the green and white spritzer because it had the most powerful spray and because it had a longer handle which would help us get a good grip on it. We knew that the size of the bottle were too big and would probably make the MotorCar topple over, so we had to find a replacement.
Now that we knew with what we were going to extinguish the fire with, we had to figure out a mechanism to actually do it. We decided that it would be best to pull the handle in repeatedly until the candle was out. We thought that we could attach a string to the bottle, which would lie on the handle and be pulled on the other end. The question now was, how to pull the string back a forth?

We looked at previous motion modules. For example, like the one below. We could tie the string to the end and have a motor rotating the circle piece, which would pull the string and in the end pull the handle in. The good thing about this mechanism is that we could just continuously rotate it would just move the string back and forth.
So using that motion module, would be relatively simple but the problem is that we didn't know how strong it could be. It takes a certain amount of power to pull the handle in and we didn't think that this motion module was powerful enough for that. So looked at a different mechanism. This time we looked at a project from last year and we were intrigued with their idea. Below is a picture of it. As you rotate the gear, the Lego blocks contract and extend. This is the kind of motion that we were interested in and it looked a lot sturdier than the other motion module. It is a bit more complex than the other, but we thought that it would be more effective.
Now we had to think of various ways to place all these elements on the MotorCar. This was a bit tricky because had to make sure that the MotorCar and our bottle wouldn't topple over and that our mechanism wouldn't get in the way of the photo transistors and breadboard.
Here are some our sketches describing the motion that we wanted and how we wanted to design our robot.


I went to a convenience store and bought a small bottle to which I attached the spritzer. Here is a picture of it:
We tested it out just to see if it would still work and it did! So now that we reduced the size of the bottle, we were able to start modifying our MotorCar. We decided to place the spritzer in the front of the MotorCar above the breadboard. We attached the photo transistors to the side in the front, so that nothing could interfere with them. Because the spritzer is placed so high, we knew that would have to use a tall candle.
Then, we wanted to incorporate the mechanism into our design. Instead of directly creating the pieces on SolidWorks, we wanted to see how it would fit on the MotorCar so we could make precise measurements. Below is a sketch of our motion module:
Instead of having a gear to make the motion module move, we wanted to directly attach the pieces to the rotating motor. Professor Turbak said that it was possible to press fit a wire on the delrin with the motor, so we would definitely use that technique to attach the two pieces. We made a model in Legos and made a foundations on the MotorCar to support it. We would use the exact same dimensions as the Lego pieces when creating our pieces on SolidWorks. We also have to imagine that a string would be attached to the end of the mechanism and to the bottle. Here is a picture of what our basic design looks like.