I'm looking to build a small robot using inexpensive DC micro gear motors. I would like to be able to measure the speed (count rotations) of the motors for accurate positioning etc. I'm aware that they have the encoder versions of these motors, with hall effect or optical sensors connected. However I started wondering if there might be smarter ways to be able to detect the rotations without having to purchase more expensive encoder motors.
- Is it possible/practical to be able to somehow measure the pulses generated by the switching of the armatures?
- Is this something that could possibly be detected by measuring variations in the current being drawn by the motor?
I'm aware that DC motors create a lot of electrical noise from the commutation of the brushes, which requires capacitors etc. to suppress. It seems that it aught to be possible to use some of this "noise" to detect the rotations of the motor.
edit: I've realised the title of the question perhaps is not quite accurate. I don't need to detect the actual speed of the motor directly, but rather to just detect and count rotations, or more accurately, the angular displacement. From this I can calculate everything else I need to know, speed, distance travelled etc.
After a bit more googling, it seems it is possible to calculate the speed of a DC motor, by measuring the back-EMF. The calculation is quite complex, and depends on knowing various characteristics of a particular type of motor.
There is even Arduino code provided. In my case though, despite the incorrect title, I am actually mostly interested in measuring (or calculating) the angular displacement, to find out exactly how far each wheel of the robot has travelled, to then be able to determine orientation and position.
I'm not sure this EMF technique will provide the accuracy I'd need for that.
Anyway this does give me a bit more confidence that what I'm wanting to do may be possible.