How to keep track of (x,y) co-ordinates of a line-following bot?

I am working on a bot that follows a certain line path based on some pre-determined algorithm. I would like to know what the (x,y) co-ordinates of my bot are as it traverses with respect to some pre-defined origin and scale.

I am very new to robotics, so I am not sure of the hardware requirements such a task would entail. I would be glad to provide any further information.

You need reference points that the bot can detect and calculate its position.

nihaljainn:
I am working on a bot that follows a certain line path based on some pre-determined algorithm.

I am a bit confused by "pre-determined algorithm". Do you mean that it is following a line on the ground?

If not, what do you mean?

Reliably figuring out a location without being able to check against some reference point will be difficult. If your 'bot is following a line on the ground you should be able to confirm the position at each corner and estimate the position between corners.

...R

Look into odometry. Use encoders on the wheels and basic geometry to determine the robot's position over time. It's generally effective if you know the wheel diameters to a good degree of accuracy, there's no slip and your encoder output frequency is sufficiently high to give a good number of ticks per wheel revolution.

Suppose 2 drive wheels and 1 idling wheel. How to go straight, no deviation that makes the bot leave the ideal X-line for going much X but a little Y? How to find that out? References-
There are positioning systems for modell railroads that use fixed "light houses" that triangulates the trains.