The Final Stretch: VEX
Cumulative Overview
We're in the final stages of this course, and now it is time to put all of our knowledge of circuit building and programming together! The final aim of this section is to implement the tools and functions needed to bring us to our final goal: The Firefighting Robot Competition, in which a robot must autonomously (on its own) navigate through a maze, locate a randomly placed fire, and extinguish it. BONUS: Returning to the starting position reduces the time total by a set amount (which is good!).
 |
USB to serial port connector used for downloading our programs into our robot. |
Now that we know how to program, let us jump right in! We began with a right turn about the robot's edge. We did this by only setting the left motor to move forward, while the right motor remained still.
 |
Robot receiving commands. |
Next, lets try moving forward! Setting both motors to an equal value should cause the robot to proceed forward. However, not all motors were created equal, so you might need to adjust values in order that the robot doesn't veer too far to the left or right! IMPORTANT NOTE: The motors are mirrored, thus, they will rotate in opposite directions if you set both values equal. An easy solution is to set the mirrored motor to " bMotorReflected[port #] = true; " so that it will move forward rather than just rotate your robot around.
 |
Awaiting its turn to attempt the maze. |
Using somewhat accurate measurements, we could set the motors to move for a certain amount of time (based on what we tell it), and thus we were able to navigate through a practice maze. However, there is a more accurate, simpler way...
 |
That way includes the use of encoders! Encoders attach to the axles of the wheels, and measure the degrees of rotation that the wheel has gone through. By calculating the circumference of the wheel, we can determine a near exact distance of travel by programming the robot to only move a certain number of revolutions, allowing for much more precise movements through the maze. |
 |
The robot, version 2! Now with encoders. |
Now the robot shall navigate the maze, not based on timing, but based on accurate distance measurements.
 |
Next up: Robot version 2.1! Now with ultrasonic (whale-calling) capabilities! Please refer to previous blogs for how sonar sensors work. The man difference here, is that one of the sets of pins of the sonar sensor must be placed in a low number interrupt port. The other must go the the Analog/Digital ports. Don't forget to set up your sensor in the motors and sensors setup menu (select the correct port and interrupt, and choose SONAR)! |
 |
How the beginning of your code should look after setting up sensors. |
Now we see that the robot is avoiding contact with objects that it detects with its sonar (from a certain distance). The sonar can be particularly useful in avoiding walls in the Firefighting competition.
|
 |
LINE FOLLOWER: An infrared LED and a phototransistor allow for the robot to detect differences in color on the ground. By changing values, we can set it to stop and perform certain functions whenever it meets a black line. |
 |
Above we see a version of the line follower, adjusted to now detect flames. The phototransistor detects certain wavelengths, and thus it is perfect for sensing and finding where our flame could be located, and once found, we can set the robot to extinguish the flame. |
 |
Robot version 3! We decided not to use the ultrasonic (sonar) sensor. But we did opt in for using the flame sensor and line follower! |
 |
Robot Version 4. Now with flame extinguishing power. Time for some test runs to seek, and exterminate the flame. |
Good luck to all on the Firefighting Competition, and thank you to Professor Denny for teaching the Elec 10: Mechatronics course this winter; and a thank you to Tommy for assisting us! Greatly appreciated for your time and effort!
No comments:
Post a Comment