After receiving our assignment, my partner and I headed over to the Lego table to begin building our physical model. We attached a motor and one large wheel to either side of the NXT, one small wheel to the front for support and maneuverability, and attached the light sensor so that it protruded out in front of the rest of the vehicle.
Our first model |
We took these factors into consideration and headed back to the Lego table. With regards to our LED sensor, we wanted to make sure that it was as close to the ground as possible for an accurate reading, stable, and far enough forward that its readings would not be blocked by the rotation of the small wheel.
After much tinkering, here is the much-improved fruit of our labors:
Model #2 |
LED attachment close-up |
Our first idea was to have one wheel perpetually going forward, and the other rotate forward or backward depending on the readings from the light sensor. Our hope was that the adjustments of the light-dependent wheel would turn our follower as necessary in order for it to follow the line. We took our creation to the line of tape on the floor to make light sensor readings, and discovered that the tape reading was about 37-40, and the floor readings were about 31-34.
Early Code |
This code has many problems. First, the circular motion in the beginning means that our robot will not be able to find the line unless it is within rotating distance (see movie). Second, and more importantly, we had programmed our robot to simply go straight whenever it found a line. This strategy would not work, because unless our robot happened to be angled exactly along the line, it would be sent in a straight line away from its goal line, since the LED sensor takes some time to process readings. This factor, combined with our robot's inability to find a line more than a rotation away, was a recipe for line following disaster.
Watching our program's results and listening to Lyn's words of wisdom easily convinced us that we would need to spend time developing a robot that followed its line using a sweeping motion. Doing so would give our robot much more calculated movements, and allow us to ensure that it moved in the correct direction.
No comments:
Post a Comment