I need to control the speed of a DC motor precisely. I also need to know the total angle that the spool has turned, which I can do by integrating in software if I know precisely the speed at all times.
So I need to know either the speed or the positon of the motor shaft precisely, and rapidly. I suppose either will do.
Are there motors that have this functionality? Or some kind of encoders I could put inline with the motors that will read this out? If I had to, I could use a disk of cardboard and punch holes in it and use breakbeam sensors....but that would be really annoying and bulky.
You need an encoder for this. I can't give you a specific example because it depends on the motor/shaft/gear that you mount the encoder on... But what you are looking for is an encoder.
Some motors come with built in feedback, which really means built in encoders attached to opposite side of their shafts (not where you would usually put the gear/whatever, but on the opposite side of the motor)
I'm having a hard time finding any encoders, though. The only solution I can think of is making and printing off my own encoder disk and using IR to implement my own encoder. I was kind of hoping sparkfun would have some convenient easy-to-implement encoder that would be plug-and-play, but apparently this kind of thing isn't as common as I would have thought. I would have figured robotics people would need this all the time, but It seems like they must use steppers when they need control, but my needs are less positional and more high-speed.
I made a pie chart in a spreadsheet program with 60 wedges and photographed the screen with a large format camera. I developed the film and cut the image of the pie chart out of the negative with scissors and now I have an encoder wheel with alternating transparent and opaque wedges (hopefully; I should use litho film). Not exactly compact, but if it works it should work well and be pretty cheap. Not the greatest angular resolution either.