Monday, July 7, 2008

NXTSegway Revision 0.2

OK...this project has experienced a major breakthrough today, as I have implemented a form of dynamic recalibration of robot's "stable point." As you can see from the videos, the robot moves back and forth, and I was able to use that movement to my advantage. The new program measures the raw light data at the extremes (at the point when the robot is momentarily stopped and ready to move back the other way), finds the average of those extremes, and sets the average as the new target light value. This way, if the robot begins to lean a tiny bit too much in one direction, the target light value is shifted in that direction so as to maintain balance (ideally). However, with this method, there is still no way to overcome any substantial error, only minor error, so if it leans too far it will careen into the ground (as evident in the video below). If you want further explanation, take a look at the commented source code and see if you can give me any suggestions :-)

Source code can be found here (4KB)

No comments: