|
Re: Need help with shaft encoders
Grayhill and US Digital both have reasonably priced options.
Make sure whatever you get uses 5VDC power, and you'll need quadrature output to get direction as well as speed. Also make sure you don't get anything with a CPR (counts per revolution) too high (>1024 or so), or you can crash the RC.
As for programming with encoders, Kevin's code will let you read things like encoder counts, velocity, etc., but you need to figure out what you want to do with it in order to use that data. For example, if you need to drive 10 feet and stop, you could either wait until you count up to however many ticks equals 10 feet and then kill the power, or you could use a feedback controller to precisely reach the exact position you want down to a fraction of an inch.
It all depends on what you need it for, how much precision you need, and the ability of your programmers.
|