Let's Make Robots!

Encoders for servo mounted wheels

Picture_004.jpg
 
 
I have 2 questions, 
 
- First, when using a C-stamp (programmed using MPlab) is it possible to track the movement of a continus rotating servo so that I dont need to add encoders to know how  much the wheel has turned?  
 
This is an example of coding that makes 2 servos turn(if it helps):
 
void goforth(BYTE lp, BYTE rp, WORD t)
{
  WORD i;

  for(i = 0; i < t; i = i + 1){
    PULSOUT(lp, 800, 1, 1);
    PULSOUT(rp, 400, 1, 1);
    PAUSE(17);
  }
}
 
-Second, if it is either difficult to use the method above are there encoders designed for these wheels(top picture), I am asking because there are evenly spaced alternating grooves on the wheel, so I am guessing it must be for some type of encoder. 
 
 

Comment viewing options

Select your preferred way to display the comments and click "Save settings" to activate your changes.

So paint the holes black, when you think about it it does make more sens. 

What sensor would you recommend to detect the changes ?   

You can get a range of custom sensor packages, but if you want something small and simple the QRD1113/QRD1114 IR sensors are popular and cheap. The sensitivity and maximum frequency are both good, and the short range isn't an issue in this case =)

Here's an example of the QRD1114 in use.

The manufacturer site suggests "Just paint in every other stripe pocket, and you're ready to go!"

I think that agrees with Rudolph.

Not to thread hijack, but...

Two have commented on painting the high spots black. It seems to me that painting the low-lying parts black would make more sense. They're already farther away from the sensor, making them black would then appear "infinite" while the closer white parts would be more likely to trigger the sensor (as compared to farther away white spots). I have zero experience with this though so please slap me if I'm mistaken. And then tell my why I'm mistaken please :)

The low spots are harder to get to with a marker or paint brush =)

Aha, that makes sense ;)
So, final verdict paint the high lying parts black and use a QTR-1A reflectance sensor to detect the changes? This seems like a good solution, it will be a bit time consuming to paint the high bits but well worth it at the the end! Thank you all for the help!
Yes, the intention is to color in every other stripe for optical encoders. Specifically WheelWatcher, but other sensors will probably work fine.     http://www.solarbotics.com/products/sw/     http://www.nubotics.com/products/ww01/index.html
Those sensors do seem very interesting! But at 50$ a pair I am going to have to try the cheaper option first.  

No there is no way to determine how far the servo has rotated as there is no feedback mechanism. The timing method won't work either as the speed of the servo will change slightly with ambiant temperature.

If you don't need high resolution then the holes in the wheel are perfect for encoding otherwise Rik has the best answer.

One other posibility is to use the camera IC from an optical mouse to look at the encoder pattern on the wheel. Since this link was originally found by Rik I would say Rik is 2 for 2 on this subject.