Thursday, September 23, 2010

Lab Exercise 4

Date:
23/9 2010

Duration of activity:
3 hours

Group members participating:
Frederik, Lasse & Christian

Goals:
Getting a robot balancing by gathering inspiration from various examples [1]

Plan:
1. Build the robot
2. Get the robot balancing

Results: 
1. The robot was built by following the instructions to the NXTway[2]. Later on we rebuilt the robot using the instructions from Brian Bagnall[3] and we then had a robot that matches the code.

2. We used the example from Brian Bagnall[3] as a starting point which is a PID controlled robot[4]. The robot was able to balance for a short period of time but was very unstable. When the robot got a little out of balance the robot fell down immediately. So we needed to modify the code to get it working. While tweaking the parameters we found out that the light conditions in the room has a lot to say. The slightest change in light intensity causes the robot to crash.
We tried to change the size of the wheels and it help of the responsiveness of the robot. Afterwards we rebuilt the robot a desribed in the chapter above (1.) but that wasn't succesful either. We decided to give the robot a higher center of gravity by building a tower on top of the robot, which can be seen on the picture below - that was no help.



As a last desperate attempt we built the robot more or less like the first attempt again. The main difference was that we moved the sensor away from the robot body in order to get a wider range of sensor values and avoid some of the shadow from the robot. We then tested the robot in a dark room and it actually performed quite well! The robot is seen below.


Below is a video showing our best result in daylight:




Conclusion:
We didn't manage to get the robot balancing more than 5 seconds in daylight even when we used programs that should be working and was tested on robots similar to the one we built.

By using the lightsensor to balance a robot it requires uniform light in the testroom to get the robot balancing properly. Also the surface has a lot to say; we experienced opposite behaviour when placing the robot on a table and on the floor. The best conditions for the robot has clearly been the dark room.


References:
[1] Lab Exercise 4 description - http://legolab.cs.au.dk/DigitalControl.dir/NXT/Lesson4.dir/Lesson.html
[2] NXTway building instructions: http://www.philohome.com/nxtway/bi_nxtway.htm
[3] Brian Bagnall, Maximum Lego NXTBuilding Robots with Java Brains, Chapter 11, 243 - 284
[4] PID controller, http://en.wikipedia.org/wiki/PID_controller