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.