Tuesday, June 5, 2012

Week 9: Final Design and Competition

During week 9, the final design and code for the robot came together.  There were still unresolved issues involved with turns.  When the robot changed surfaces from rug to regular floor, the wheels of the robot would drag, causing the turns to shorten.  Also, the battery severely affected the power of the motors which in turn affected the robot's ability to turn.

As stated last week, the infrared sensor was replaced by the light sensor in order to detect when the robot reached the candle.  This week, the code was finalized so that when the light sensor detected a change in the floor color, the robot would move slightly closer to the candle and then rotate back and forth as the fan put out the flame.  The following chart represents the final room search pattern:

 

The final competition took place on Sunday.  The robot performed somewhat well; it located the candle two out of three rounds, but both times the fan failed to extinguish the flame.  This problem could have been fixed if the robot moved closer to the candle or the fan produced more of an air flow.  The robot was able to extinguish a flame after the competition in the following video:



Wednesday, May 30, 2012

Week 8: Turn Calibration and Reintegration of Light Sensor

This weeks lab was spent finalising the code by running the robot multiple times in the arena. By doing this it was easy to identify errors in the coding as the robot went through the house. The majority of errors came from the robot overturning or underturning. This would then mess with the rest of the room searching as the robot's turns would be off by that amount each time. Errors also came from the robot running too fast into the wall, causing the robot to pivot around the touch sensor. This would also affect the following movements. Due to the nature of these errors they could be fixed one by one as the robot moved further throughout the house.

There is also an issue with the turning caused by the battery running low. When the battery is full the turns are all perfect but towards the end of the batteries life there is less power going to the motors so the turns don't go to completion. This can be corrected by always keeping the battery fully charged.

The infrared sensor has now been replaced by a light sensor. The infrared sensor was not consistent enough to detect the flame every time. Due to there being a white quarter circle around the candle it was decided that candle could be detected by detecting the white surface. The robot would then rotate with the fan on and extinguish the flame.

Tuesday, May 22, 2012

Week 7: Fan Redesign and Room Search Code

This week a flaw was found with the design which is something that should have checked much earlier.  Because the infrared sensor was ineffective, the light sensor was substituted as it was much more effective when tested in the lab on Thursday.  However, when used in the lab this week, it was very inefficient as it could only sense a difference in light when it was very close to it, which the infrared sensor could do more reliably.  This is because there is too much ambient light in the lab, so this obstacle must be accounted for.

The code will have to be changed to account for this issue. The code will be added to to allow the robot to, when it gets to the entry way to a room, it will enter and ride the perimeter of the room instead of turning and trying to sense from the entrance.  This will allow the robot to get very close to the candle so that it can sense it at a close range and be able to simply stop there and put it out with the fan.

There were also issues with the original fan design. It was not strong enough to put out the fire and therefore a new design had to be come up with. The problem was that original fan could only blow the candle out from a certain position, and due to the random location of the candle this was not reliable enough. The new fan design shown below is more capable but a pre-made fan blade is being considered.



Wednesday, May 16, 2012

Week 6: Full House Coding with My Blocks



Since last week all the coding has been completed. This was acheived by creating My Block's for moving into one room after another. This resulted in four different blocks that when put into one sequence would allow the robot to move from room to room and search each one in turn for the flame. If the flame was found, the robot would move towards it and turn the fan on. Each My Block uses a similar sequence to the one shown in our last blog post.

This week it was decided that the infrared sensor wasn't fit for the job as the differences in readings between the room with the candle in and a room without the candle were too small to be reliable in identifying the flame everytime. It was decided to use a second light sensor instead as this would be more reliable.

This is the code within My Block for the 1st room:
This is the code within My Block for the 2nd room:
This is the code within My Block for the 3rd room:
This is the code within My Block for the 4th room:
This is the final code:

As of now this code should work, but to make sure it does we will test it out thoroughly during the lab period.

Tuesday, May 8, 2012

Week 5: Testing and Starter Code

After finally attaining all the parts to the robot, the testing and coding of the robot could begin. The following results were found:

1) Ultrasonic Sensor - it was found that at any point in the hallway, the ultrasonic sensor will read a value of 15 or less when along a wall, so it could be programmed to turn when the number went above 15.

2) Touch Sensor - no surprises here, it successfully touched the wall, sensed it and could turn.

3) Infrared Sensor - this could not be posted yet as we had no flame to use, but this will be the first test run next week.
4) Color Sensor - this sensor failed to pick up a difference between black and white because they are technically only 2 different shades of the same color.  Because of this it was decided to use a light sensor instead, because it is known more light will be reflected off of the white than the black.

5) Light Sensor - the two readings received for the white ground and black ground differed by about a value of 30, the white giving off a reading around 70 and the black showing around 40.

After this, it was decided to begin coding.  Below is a view of our code:





Essentially this code programs the robot to do the following:
  1. Move forward until the ultrasonic reads greater than 15
  2. Turn left and move forward again until the ultrasonic reads above 15
  3. Turn left and go forward until the light sensor picks the black line which signifies the entry to a room
  4. Although this has not been added yet because the Infrared has not been calibrated, we will sweep the room to find a flame
  5. If one is found, move forward until we are about 15 centimeters from the flame
  6. Stop and deploy the fan.

Tuesday, May 1, 2012

Week 4: Initial Design

This week, the group decided to order the Dexter Infrared NXT sensor in order to help detect the flame.  The sensor was ordered and was delivered last week.  The following is a picture of the sensor:


With the sensor, the physical design for the robot was created.  The robot was set up with the fan mechanism and all 4 sensors, keeping the main design very simple and allowing for sensors and motors to be easily attached.  The following picture shows the design:


Some of the key features of the design are:
1. Mounted Fan Mechanism - Mounted on top of the robot is a motor with a set of gears used to power the fan.  The fan blades are made from a soda can and are bent in order to propel air forward.  The fan has been tested and can put out a flame at a distance of 1ft.
2. Color Sensor - The color sensor is mounted on the front of the robot in order to detect changes in the floor color.  Doorways are marked by white lines on the floor and the candle location is marked by a white semi-circle.
3. Touch Sensor - The touch sensor is also mounted on the front of the robot in order to detect walls.
4. Ultra Sonic Sensor - The ultra sonic sensor is mounted on the left side of the robot, facing the left.  This sensor will be used to determine when the robot passes by a doorway.
5. Infrared Sensor - The infrared sensor is mounted underneath the fan.  It is used to detect infrared light emitted by the flame.
6. Wheels and Motors - On each side of the robot is one motorized wheel.  There is also a free spinning wheel on the back of the robot.

Tuesday, April 24, 2012

Week 3: Fan Design

This week, the group worked to create an efficient and effective extinguisher design.  In the lab meeting for this week, research was done to determine the most effective type of extinguisher.  Some options that were looked at for the design were fans, misting devices, buckets, water guns, and carbon dioxide canisters.  It was decided to incorporate a LEGO motor to construct a fan in order to extinguish the fire.  It was thought that this would be the most compatible with the lego robot and the most reliable way as a water gun or mist could misfire and miss the fire (no pun intended) completely.  Below are two pictures of our LEGO fan:




 An intricate system of gears was created to greatly increase the speed of the motor. Without this the fan blade would not spin fast enough to put out the candle. The long lego piece shown above is only tentative. The final design will have either a fan blade taken from a handheld fan or one fashioned from appropriate material.

In addition to the blade, research was conducted to find different infrared sensors to use on our robot to sense the flame, as the light sensor could be ineffective because a flame would not give much light in comparison to the ambient light in the room.  An infrared sensor would be very effective and would only cost us around $50, so it is definitely worth the investment.  The group will decide on one of three that we found and order it this week.