Continue to Site

Welcome to our site!

Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

  • Welcome to our site! Electro Tech is an online community (with over 170,000 members) who enjoy talking about and building electronic circuits, projects and gadgets. To participate you need to register. Registration is free. Click here to register now.

Rotation speed measurement of DC motor

Status
Not open for further replies.

hantto

Member
Hi!

I recently bought a line following robot FK1108 made by Future Kit. See attached manual and photo. The stock circuit is works ok, but I thought about making an enhanced circuit with H-bridges and microcontroller and so on.

To make a speed controller I would need to measure the rotation speed of the DC motors. I thought about detecting the noise of the brushes, but that won't work reliably because I intend to use PWM to controll the speed.

The obvious solution would be to put photodiodes and leds at each side of the wheels and use the spokes as optical interrupters. That would probably work well, but the measurement rate would be quite low, especially at low speeds. The ideal situation would be to measure the rotation speed of the motor shafts directly. The problem with that is that the only portion of the shaft that is accessible of the motors is about 0.5 mm long at the back. That is too short to attach an optical interruptor disk. I thought about maybe using a hall-sensor to detect the changes in the magnetic field, but because it is a DC motor, the magnet field is stationary. So I don't think that would work either.

Do you have any ideas over how I could measure the rotation speed with a decent measurement rate?
 

Attachments

  • fk1108e.pdf
    240.9 KB · Views: 722
  • fk1108.jpg
    fk1108.jpg
    66.3 KB · Views: 491
Last edited:
I came up with a solution that is not as good as measuring the rotational speed of the motor axises, but is probably good enough. That is to increase the amout of "spokes" on the wheel by attaching an optical disks to them (fairly obvious...). I attached some templates to this post if someone else needs them.
 

Attachments

  • optical disk.png
    optical disk.png
    48.4 KB · Views: 1,065
  • optical disk vector form.zip
    13.3 KB · Views: 346
I spoke too soon. It tried attaching an optical disk to the motors' shafts, and it worked beautifully. I just had to print on a thicker paper to get enoug rigidity. Then I pushed a pin through the paper and fitted it on the 2 mm axle and applied a drop of super glue.

I tested it and got a rotation speed of 38 Hz, or 2300 RPM.

Any thoughts?
 

Attachments

  • encoder.png
    encoder.png
    707.8 KB · Views: 548
  • signal.png
    signal.png
    5.5 KB · Views: 463
Last edited:
Hi there,

Robotics is one of my hobbies, and I have had similar experiences to you trying to make an affordable DC motor based platform with encoders. I used to enter micromouse competitions, and would like to release an open source cheap robot platform design at some point. Anyway...

Your signal swing looks almost sine like, and is very small in amplitude. How have you set your photo diodes up? Got a schematic?

Also you maybe able to get decent resolution from encoders at the wheels if you use what is known as a quadrature encoder. You can scavenge quadrature encoders (LED and Sensor) and their matching encoder discs from old mechanical ball mice. Two sensors are placed 90 degrees out of the phase (note two "sensors"/photodiodes are placed in the same physical package), which allows you to not only to detection direction (by seeing what phase leads), but also allows for a x4 improvement in resolution as you now have 4 edges to detect in one encoder "click" (2 positive going edges and 2 negative going edges) so to speak. Decoding the quadrature signals reliably into pulses and direction will add a bit of complexity to your robot mind...

Another thing to consider is something I have seen done in the past. Disassemble the motor, and drill a hole in the casing away from the permanent magnets but such that you could see the motor poles. Paint the rotor pole ends with white paint, and then direct a reflectance sensor through the holes to detect the poles moving past and count them.

Most DC motors like those have 3 poles, so you would have 3 ppr at the motor, but those gearboxes typically have substantial reduction ratios > 100:1 so you would still have respectable resolution at the wheel, i.e. >= 300 ppr.

BTW You have measured the frequency over the period of two cycles there, so double your 38 Hz and RPM.
 
Hi, thanks for the reply.

The signal I posted was got by connecting a phototransistor to ground through a resistor and monitoring the voltage at the resistor-transistor junction. I was just holding the setup in front of the optical disk with my hands, without any lightsource except the light comming through the windows and ceiling lights. So it is no surprise that the signal is quite bad. It was just a "proof of concept" test.

The quadrature encoders from old computer mice was a interesting idea. I could use that in some project. I'm trying to measure the speed of the motors as easily as possible. I measured the gear ratio, it was about 1:49. By using an optical disk with 24 black/white sector pairs on the wheels would yield 24 pulses per revolution. I think I can fit 3 back/white sector pairs on the motor optical disks, which would yeld 147 pulses per wheel revolution (or the double amount if both edged are counted), which is an resolution enhancement of about 6 times (or 12).

The dissection of the motor sounds interesting too. I'm afraid it is a bit too cumbersome for this project. If I fit 3 sector pairs on the disk, the resolution woud be the same.

I'm measuring the period over two cycles because the optical disk I used has two back/white sector pairs, so two cycles equals one rotation.
 
Makes sense - I have a habit of measuring one cycle and calculating from there. Not quite sure why but I assumed everyone else did the same :eek:

This maybe of use if you try the old computer mice route at some point

All the best with your project!
 
Status
Not open for further replies.

Latest threads

New Articles From Microcontroller Tips

Back
Top