Task#2: Basic Robot Programing

Robotics, 2nd Semester (Jan-May) 2012
Nii Adjetey Sowah

Task Objectives:
– Build a differential drive robot using parts from the Lego Mindstorm kit.
– Write a program to get my robot to drive 2m in a straight line (using RobotC and NXT visual programing language).
– Write another program to get my robot to drive in a closed shape of my choice (using RobotC and NXT visual programing language).
– Perform a task using sensors from the Lego Mindstorm kit.

This is a report to discuss the completion of the stated objectives above.

Figure1.1 Images of my differential drive robot

In programming my robot to drive in a straight line for 2m, I attempted to use the measured value of the wheel radius to figure how long the robot should drive for to achieve the desired distance. I calculated the time to be 7.5 seconds. The calculated theoretical value for the distance to be covered needed to be adjusted to work in reality. The actual time needed was 8.2 seconds. After this experience in programming my robot using the NXT visual programing language, re-programing it in RobotC programming language was straight forward.

I used the NXT visual programming language to program my robot to move in closed loop. This time I anticipated the difference between the the theoretical calculated turn angles and the real turn angles. I then repeated the program in RobotC programming language.

In my final objective which is to use sensors from the Mindstorm kit, I used the sonar sensor. I programmed the robot using the NXT visual programing language to search for an obstacle in front of it and follow. My robot was programed to turn left and right in succession in a spot in search of an object. It would repeat this behavior until an obstacle is found using the sonar sensor. Once found, it would move towards the object.

I implemented these programs several times on the robot. The robot accurately and consistently performed the task as expected. On a few occasions, it deviated a little because it was unable to move in a straight path. The only occasion that the robot did not behave as described by the program was when the robot’s battery was low.

When the surface was changed from the tile floor to the wooden table top, the results were similar with little or no difference in the behaviour of the robot. I however presume that, if the surface was sandy or muddy instead on the tiled floor, the robot would have encountered mobility issues.

Summary (what I have done and learnt):
I have learnt two robot programming languages (RobotC and Mindstorm NXT visual programming language). I also learnt how to manoeuvre a 3-wheel differential drive robot and the calculations involved in programming robots to move.

Challenges faced:
My biggest challenge was building the robot from all those tiny Lego pieces.
Observations made:
One key observation I made was that, once perfect code is brought into an imperfect world it loses its perfection. No matter how well you calculate and code a robot to perform a particular task, it has to be tested in the real world. 9 out of 10 times, code alteration has to be made.

Questions I have:
(General)
Without the Lego kit, how will miniature robots be built and from what type of materials?
Will it be possible to bring one of such ‘real’ robots to class?
(Lego Mindstorms NXT platform)
Can you design your custom Lego parts to be manufactured for you by the Lego Company? And how much more will it cost someone to do such a thing?

Advertisements

Leave a Reply

Fill in your details below or click an icon to log in:

WordPress.com Logo

You are commenting using your WordPress.com account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s