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.

As described here...

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.

  • \$\begingroup\$ Have you thought about speed calculation based on mathematical model of the machine? In such a case you don't need speed sensor but you will still need armature current sensor and armature voltage sensor. \$\endgroup\$ – Steve Feb 10 at 11:31
  • \$\begingroup\$ @Steve Yes, this is what I mean. I won't need to measure speed directly, but rather count rotations of the motor. From this I can calculate distance and speed based on elapsed time and circumference of the wheels etc. \$\endgroup\$ – user1751825 Feb 10 at 13:08
  • \$\begingroup\$ @user1751825 I don't think that it's a good idea to relay on the mathematical model for measuring distance. Say the wheel slips for an instance, or that collides with something. Well, it depends on the application... but do you consider an accelerometer? \$\endgroup\$ – thece Feb 10 at 14:06
  • \$\begingroup\$ @thece Those are valid points. However for the project I have in mind, these shouldn't be a significant problem. It will mostly be a learning toy for my kids. I'm hoping to have it traverse mazes and that kind of thing. I've designed it to do gradual start/stop to reduce the possibility of wheel spin and skid. It will use ultrasonic sensors for collision avoidance, so hopefully shouldn't often bump into things. \$\endgroup\$ – user1751825 Feb 10 at 14:18
  • 1
    \$\begingroup\$ Use an optical mouse to discover how much you've moved in x or y. You're always better off measuring where you are (via correlation of images - which is what the mouse does) rather than integrated velocity. You won't be able to teach stuff about control with motors to the kids because the correct way is to use a motor with an encoder. \$\endgroup\$ – D Duck Feb 10 at 18:48

Theoretically, it is possible to use brush noise of a DC motor to assess rotational speed. Brush noise is AC, so a high-pass filter plus an envelope detector would give you a pulse for every commutation.

However, these pulses will vary in amplitude and duration, so counting them will be a challenge. The character of the noise will be constantly changing as microscopic defects in the brushes wear out, while new irregularities get exposed. Any dirt on the collector will induce arcing as well, generating extra pulses you'll have to find a way to ignore. At higher speeds such pulses will overlap, making counting practically impossible. Plus, this method will be incompatible with traditional PWM motor control, because you will be feeding your DC motor with AC in the first place.

A related (albeit different) concept called Brushed-Motor Ripple Counter can be applied to motors where brushes are large enough to short two poles together, and the detection is based on changes in inductance rather than switching noise. That method appears to be reliable enough to be useful (but if you go though the experimental results you will see that the detection sometimes skips a position or two), but it most likely won't work with hobby-grade motors.

  • 1
    \$\begingroup\$ Thanks, this was the conclusion I was starting to draw as well. I've figured out that the closest thing to what I was looking for is called a "Brushed-Motor Ripple Counter". These are apparently used in automotive applications, for mirror and seat positioning motors. These applications though use constant speed motors, with a constant DC supply voltage, not variable PWM... So I might forget this idea, and instead try to figure out some creative way to use inexpensive optical counters. \$\endgroup\$ – user1751825 Feb 11 at 10:43
  • \$\begingroup\$ @user1751825 Thanks, googling for that term gave me some interesting reading material. Apparently, this concept works well with motors where brushes are large enough to short two poles together, and the detection is based on changes in inductance rather than switching noise. That would indeed be more reliable, though it likely won't work with hobby-grade motors. \$\endgroup\$ – Dmitry Grigoryev Feb 11 at 11:32

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service, privacy policy and cookie policy

Not the answer you're looking for? Browse other questions tagged or ask your own question.