Tuesday, May 29, 2012

Final Code

This is the final code for the robot.



The code proceeds as such:
1.       Block 1 contains the code to lower the front ram into place (allowing the bot to expand)
2.       The next section is a loop which is on infinite loop that repeats the actions until the end of the match
3.       The inner code is split into 3 sensor switches
a.       Light 1: this code deals with the front light sensor that is meant to stop the bot from driving off the edge once it has pushed the enemy off the ledge
b.      Light 2: this code deals with the rear light sensor that is meant to enact a avoidance code
                                                               i.      First motion block turns backwards to change the approaching angle
                                                             ii.      Second motion block turns at an angle forward to further change the angle of the opponent
c.       Distance 1: this code deals with the ultrasonic sensor  and act as an if/if not statement
                                                               i.      If the opponent is within the area then it will move toward it
                                                             ii.      It the opponent is outside of the are then it will turn to and search
[distance is 30cm]

Basic Coding

This is the base of the group's code after the lab in Week 8. At first, the robot will bring down the plow on the ground. When the touch sensor is released, which means the robot has pushed the opponent out of the ring, the robot stops completely. While the touch sensor is not released and the light sensor senses white, the ultra sonic sensor is activated to seek and march toward the opponent. If the light sensor senses black, which means the robot has been pushed all the way to the edge, the robot performs an arch turn and find its way out of the danger.

Edge Stop Idea

In order to get the robot to stop after it has pushed the competitor out of the ring, we came up with a touch sensor design that would stop the robot be it drove off the side.



The way this works is that once it reached the edge of the field, the trigger would be released and the robot would stop. However, over time we have found flaws in this. For instance, when the robot rotates or is pushed back, the trigger is released, causing the robot to stop mid action. This could be a serious problem during a match so the touch sensor was eliminated and replaced with another light sensor.

Tuesday, May 22, 2012

Algorithm-1


The group has created an algorithm for the final coding. To give it more details, as soon as the match starts, the plow comes down. Before the match, the plow is raised up in the air to meet the size requirement. Then the loop starts with the color sensor or light sensor. The group is going to test out both of the sensors during the lab in Week 8, and find out which one works better and more effective. However, regardless of the kind of a sensor, the coding won't be much different. When the sensor senses white, which means the robot is in the ring, the code moves onto the ultrasonic sensor. When the ultrasonic sensor detects an object within eight inches, the robot marches toward the opponent. On the other hand, if the ultrasonic sensor doesn't detect anything within eight inches, the robot will perform a zero point turn until the opponent shows up in the sight. This is to not to chase the opponent because the group's robot is not a fast type robot. When the color sensor or light sensor senses black, which is the color of the edge, the robot will perform a reverse arc turn for 180 degrees and back up. This movement will locate the robot out of the edge. After those two moves, the robot will push forward to counter attack.

Tuesday, May 15, 2012

Final Design

The group has finally come up with the last design for the competition.

[ Figure 1. Front view ]

[ Figure 2. Front view ]

As shown above, the robot will start the competition with the plow raised up in the air. Once the competition starts, the plow will come down immediately.

[ Figure 3.  ]
[ Figure 4.  ]

The plow has to be up in the air in order to be qualified for the competition size-wise. The plow is a critical factor of the group's strategy. Because the robot has traded off the speed with power, the robot will not be able to perform the counter-attack very well. However, if the plow gets under the opponent's wheels by trapping the wheels and slightly lifting them up from the ground, it will reduce the opponent's power. This will prevent the situation where the robot has to perform a counter-attack code.

[ Figure 5.  ]

[ Figure 6.  ]

When pushed to the edge, the robot will sense the danger through the color sensor. A different code, other than the attacking code, will be performed when the black color is sensed. 

The group hasn't finished the algorithm yet. However, the group will be working on the coding during the lab in week 7, and it will be tested. 

Sunday, May 6, 2012

Designing-2


The figures above are the first design that was attached in front of the robot. The plow was supposed to help the robot push the opponent easier and defend its own wheels. However, the plow didn't meet the requirement for the competition, size-wise.

The group created another plow. As shown in the figures above, the plow now has two empty spaces, which will trap the opponent's wheels. In the group's final design, the plow will be connected to a motor and a touch sensor, so when the sensor is touched, the plow can lift up the wheels of the other robot, which will make the opponent powerless. This is the group's strategy, and during the lab in Week 6, the group will work on the code that can make this strategy very effective.