I have built a car like robot which goes around itself like many examples out there. I want to do mapping with its sensors.
The problem is if I use dc motor on wheels, can I detect how much it moved from starting point or should I use servo motor?
I have built a car like robot which goes around itself like many examples out there. I want to do mapping with its sensors.
The problem is if I use dc motor on wheels, can I detect how much it moved from starting point or should I use servo motor?
There are several ways to do do this:
Use stepper motor (as Jodes suggested). Because the step angle of the stepper motor is given, you can measure the time for which the wheels kept turning and figure out the distance (Hint: The distance covered by one complete rotation of the wheel is equal to it's circumference).
Use an encoder (As John suggested). Lots of material is available online.
Use a GPS module. This might sound overkill but might actually be a real life saver depending upon the estimated area which you are looking forward to map.
Both #1 and #2 are prone to slippage and other mapping issues because none of these techniques making your bot 'aware' of it's precise location. So, there is a possibility it can count the same distance more than once.
As for #3, you can decrease the on board complexity by your board simply acting as an explorer and transmitting it's co-ordinates to a pc via a wireless link or something familiar. The PC can then do all sorts of fancy things with the data (including drawing an actual map).
But then again, the correct choice depends upon the use case scenario.
Assuming no slippage between wheels and the ground you could use an encoder on one or more of the wheels to determine how far it has moved.