Need Help with Determining RPM

That is a link to the encoder I wish to buy inorder to determine the running actual speed of an AC motor.

And my question is how could I configure the circuit to give an accurate reading on the speed of the motor. Part of me is thinking that just using the single to count the time difference between channels A's square wave then dividing that in a time gear equation (once I can determine the counts that exist in a cycle) and using the results in order to determine the RPM. The RPM doesn't actually have to be accurate to high accuracy as it is a woodlathe and will only be running in one direction or lengthy periods of time.

So I guess my question is how would I write a could that could perform this task?

Any help would be awesome!

Thanks

Nick

Here is the proposal of my project:

The rotary encoder you linked to produces 360 pulses per round, so at the limit of the spec this produces 18000 pulses per second. To count them you should use an external interrupt. You could then just count the pulses for some time and get the RPM that way or measure the time between two pulses to get an estimation. The later is not as accurate as the former but is updated much more often.

And you're right, that if you don't need the direction information, counting pulses just of the A output is enough to determine the RPMs.

I watched your video and it didn't answer my questions.

  • (1) How fast do you need to update your RPM value? when using an incremental encoder like you have referenced, you can calculate the "instantaneous" RPM by measuring the time between degree pulses from the encoder. However, if your application can tolerate an RPM update every revolution, you can get by without an encoder and just measure the duration of one revolution using a Hall effect or variable reluctance sensor. If you have a gear that always rotates at a fixed ratio of motor speed, you could monitor the teeth on it to calculate RPM, as well. That brings up question number 2.
  • (2) Does any thing else in your application require the one degree of angular rotation precision that your encoder provides? If so, I recommend using an encoder that provides an index pulse (once per revolution) as well as the degree tracks. If not, and if once per revolution is a fast enough update period, then I recommend you consider an approach as in question 1.

The speed range is between 200 RPM - 3000 RPM, updates I would like every second (not over done but still pretty fast to changes in regards to human sensing ability; that information will be exported to a display. So HALL effect is something I'm going to investigate any suggestions of where to start?

Nothing else requires angular precision that the encoder will provide.

Thanks again for the feedback

nicksek:
The speed range is between 200 RPM - 3000 RPM, updates I would like every second (not over done but still pretty fast to changes in regards to human sensing ability; that information will be exported to a display. So HALL effect is something I'm going to investigate any suggestions of where to start?

Nothing else requires angular precision that the encoder will provide.

Thanks again for the feedback

At 200 RPM the effect on update time will probably be due to the time necessary to make the calculation, probably not very long. At 3000 RPM, the calculation is likely to take longer than one revolution but still not likely to affect update times. What you need to evaluate carefully is how the different ways to sense the time of a revolution will affect the entire system. For example, if you choose to sense the speed sensor via an interrupt service routine... tempting... then you need to think about what effect higher RPM will have on the calculation/update times.

I would start with a search for Hall effect speed sensors that are easy to mount and designed to sense in a way practical to your application, maybe one designed for an automotive application. For example, some Hall effect sensors are designed to sense a projection like a gear tooth or an embedded rod or a depression like the slot for a set screw. That type is sometimes referred to as magnetically biased. Others are designed to sense a magnet somehow placed on the rotating part... maybe not so practical. I wouldn't necessarily rule out variable reluctance pickups as they usually have a threaded mount and are easy to adjust. Conditioning their output can be easily done with an analog comparator, sometimes one of the included peripherals of your microcomputer.