Hi. I am trying to build a two wheels robot during the summer and I am looking for a way to have control over how many revolution does a motor rotates, such that I can have precise control over how far does my robot moves. For example, I want to be able to rotate my wheels for 20.4 revolutions, such that my robot will go 1.5 meters forward.
Fast answer: Use a wheel encoder. More in a bit...
I understand that it can be done using stepper motors, as long as I keep the speed low enough such that there is no skipped step. This solution is simple, but a stepper motor is too slow and heavy for my application.
This is called "open-loop" control, and is only reliable in certain instances; provided your weight is low enough, you don't care about extreme accuracy, or a whole host of other reasons - it can work well. Even for a small robot (they do make fairly small servos - heck, just the other day, I saw one smaller than a person's thumbnail!).
Another approach is to use a DC motors with feedback loop control. They are usually quite small, doesn't consume a lot of power, and offers fast rotational speed but I am unable to fully understand what components are needed nor how to control a servomotor using a microcontroller. Do I simply buy a small DC motor, an encoder and try to model the motor's transfer characteristics function and design my close loop control system, using my microcontroller's PWM as the input to the system? That sounds fun and all but I don't know if I can figure them out all by myself... Is there any tutorial I can follow as for how to do the modelling?
That's a lot of words - personally, I think you are over-thinking this problem. What it sounds like you are talking about there is "closed-loop speed control" via comparing the output of an encoder to the PWM being input. Yes - you could do this - but that's for speed control - not position control. That said - both are really similar...
Oh also, does it has anything to do with a "continuous servo"?
Not much - a "continuous rotation" servo is simply an R/C servo which has been modified in such a way so that it's servo position control system has been neutered, so that when you feed in a certain position - it tries to reach that position by rotating the servo in the direction needed to get to that position, but because it's feedback system has been disabled (and internal stops removed), the motor continues to rotate in one direction - never reaching it's goal state. In effect, it becomes a somewhat easier-to-control DC gear motor.
Now - if your goal is to build your robot, and not focus on the hows and whys of DC motor control theory - then going the "continuous rotation servo" route might be your best bet. Servos are available in a lot of styles, and depending on how big you plan on making the robot, there is likely a servo that will work for you. Most standard size and smaller servos can be easily found in a modified "continuous rotation" variant; but the larger servos will have to be modified yourself. Also, if you go for a large robot (more than 1-2 kg in size), you will want servos that have ball-bearings (preferably dual bearings on the output shaft) and metal gears. Going the route of a servo-based robot will allow you to concentrate on getting a small robot working, rather than being focused on getting it's wheels turning.
However - if you want to DIY the whole lot of it - then what you need are wheel encoders - one for each wheel.
At it's most basic, you will want to measure how far a wheel turns. To do that, there are a variety of options. But for all options, they boil down to monitoring the rotation of a shaft by counting pulses, generally via an optical system.
The simplest way to do this is to mount on the wheel an encoder disk (printed from your computer, perhaps), and point a photo-transistor and IR LED combo (also known as a side-looking photo-detector pair) at the encoder and monitor it that way. Here is a site to use for the encoders - to show you what you need/want:
http://www.robotoid.com/printable-templates.html (toward the bottom)
This is just one instance - I'll provide some more links in a bit.
Anyhow - as your wheel turns, and the white/dark stripes pass by - they will impart a "pulsing" on the photo-transistor from the reflection of the IR LED - which you can monitor with your Arduino.
Another possibility - rather than using a reflection-based system - is to use a slotted system - put the detector pair on either side of a slotted disc of some sort (again - you could print out an encoder on plastic transparency, for instance) and monitor that (this is basically how old computer mice worked - if you wanted, you could get parts for such a system from an old PC mouse). You could also count pulses using one or more magnets passing by a reed-switch, or a hall-effect sensor.
Note that if you are using a gearbox on the motor (which you will likely be doing) - that the closer you put the encoder to the output of the motor, the greater the resolution you could potentially obtain - so if your motor needs to rotate 2000 times to make the wheel one revolution - you could monitor the motor shaft output and know that you need to count 2000 pulses for the wheel to have moved one rotation. That said, you would need to write your code properly to count that fast (hint - you would want to use interrupts). In fact, some gear-motors do have encoders already on the output shaft (just be prepared to pay a good amount for them - even surplus). I should also note that there is nothing stopping you from having encoders on both the motor shaft -and- the wheel; you could monitor slip/backlash of your robot drive system that way.
Also note that in the counting of pulses - if you measure the time between pulses, and compare that (in some manner) with your PWM signal - you also get your original speed servo system idea as well (this could also be expanded to a form of slip/traction control if you wanted).
So - you would have this system set up - then to monitor the wheel position - you would turn on your h-bridge (or whatever you are using to control the motor), then start counting the pulses from the encoder system. When your counter reaches the number of pulses for the amount of rotation you need, turn off the h-bridge. That's the basic algorithm (note - in real life this probably won't work perfectly - because motor rotors have mass and inertia - so you might need to create some system to speed up and slow down the motor as you start from and reach the ends of travel - it all depends on how much accuracy you require; for most hobby designs, it is overkill - but, if you want - look into PID control loops).
Finally - those links:
Those are for starters - you can find more via googling... Good luck! :D