Date: 13th of April 2013
Participating group members: Morten D. Bech and Thomas Winding
Activity duration: 8 hours
To continue our work on the Alishan train track contest robot.
As the building of the robot was completed Thursday the 11th of April, the software is now the only missing part. On Thursday we tried out some smaller things that we should be able to use for the run, like a 90-degree turn and moving forward until a black line is detected.
Our plan for the program is to make a simple sequential program that uses input from the two light sensors. We aren’t going to follow the line using a PID-control as we hope a “free-running” robot should be faster.
First off we did not have the code examples from Thursday because they were made on Kenneth’s laptop, who was not able to be present today, but luckily they weren’t too hard to remake – we need a common repository for sharing and saving files. After we recreated the examples, we made a small program for showing the light values of the two mounted light sensors. With this program we then measured the light values of white, black and green surfaces in the necessary corners of the track. We know that daylight affect the readings but it still gives us some idea of the range that our threshold should be in.
After some serious trouble with getting the robot to stop when seeing a black line using the light sensor we ended up solving the problem by using the stop() method instead of the quickstop() method from the DifferentialPilot-class in the LeJOS API, we’re not sure why but the quickstop() method does not seem to work. Next up we tried to use the light sensor to detect other lines to decide if, and when, the robot should turn, however we found that too imprecise and therefore changed our method when moving in the hairpins to be detect black line – turn 90 degrees – move a certain distance using the travel-method from the DifferentialPilot-class – turn 90 degrees – move towards the next hairpin and repeat the cycle.
Even after changing the algorithm of the robot we still weren’t able to complete the second hairpin – the reason being that the robot simply couldn’t drive in a straight line. To that end we found that there were two parameter on the robot we could adjust: The first one is the rear wheel and the second are the motors. The first parameter we tried to adjust by changing the rear wheel to a different wheel setup which can be seen on the picture below. Changing the rear wheel setup only made things worse as the robot became more unreliable in its ability to drive straight and we changed it back to the original setup.
With regards to the motors we found a webpage  which explained how to find two motors with almost identical power output and rotational accuracy. After consulting the webpage we found two motors which seemed to be almost identical. This helped a lot and, after mounting these motors, the robot could now move up the slopes with no difficulties, it didn’t get it right a 100% of the time but somewhere around a 80-90% success rate. We made a small video of the robot going uphill which can be seen here or below. There is still room for improvement, but we would make a complete run of the first half of the track before we started optimizing.
We still need to make the sequential commands for driving downhill and optimize so we reduce the time it takes to complete the track. One possible optimisation we found was to use an travel arc-method in the DifferentialPilot-class, which moves the robot in an arc, instead of the current solution of turn – move – turn.