Using an Optical Encoder to show RPM on a PLC


I have interfaced a 200 line count QD145 optical encoder to a DL06 PLC.  The PLC’s inputs are set up in high speed mode to receive the incremental quadrature pulses coming from the optical encoder.


CT174, the designated high speed up/down counter is used to interface to the encoder.  By default  inputs X0 and X1 are used for the A& B incremental signals, without having to code them to the counter.  Input X2 is designated as the reset, and may normally be connected to the index pulse of the encoder.

For an RPM application we will not be needing X2.

To calculate RPM with  an optical rotary encoder we use this formula:

RPM = (Frequency X 60)/ Line Count

Since frequency is “cycles per second” we set up our high speed timer on rung three to give us a count total every second;  this is our frequency.

Rung four is where all the heavy lifting happens:

After the high speed timer has timed out to one second, we load the PLC’c accumulator with the value from the counter (CT174). This will be our frequency, or the number of optical encoder counts that we have accumulated in one second.

We then multiply that value by 60, which uses our one second total to convert to the number of pulses occurring in a minute.

And we divide that total by 200, the line count, to get the RPM of the optical encoder.

We move the value to V2500, a location that we can pick up with the screen.

C3 is then used to reset the timer and counter and start the process over again.



Optical encoders that can be used to find RPM can be found at

For help with optical encoders in your application,  E-mail the author at



About Quantum Devices Inc.
Quantum Devices, Inc. (QDI) Barneveld, WI, was established as a Wisconsin corporation in October 1989, as an outgrowth of activities in the general area of optoelectronics. The main goal of QDI is to provide customers with a complete source for all stages of product design and development, starting from concept to a marketable commodity. These products include application specific Silicon Photodiodes, Optical Encoders and Light Emitting Diodes (LED) for commercial, industrial and medical applications. QDI's photodiodes and LED's are used in instrumentation for photosynthesis and photobiological research, biomedical and medical instrumentation for measuring blood sugar levels (glucometer), oxyhemoglobin and pulse rate (pulse oxymeter). One of the most dramatic products developed at QDI was the application of LED lighting systems for use as the light source for Photodynamic Therapy (PDT). Sales of QDI products include both domestic and international markets. Quality and reliability are very important concepts in maintaining our company wide commitment to overall product performance. Quality simply means continuous process improvement. We are committed to continually increasing our product excellence through increased quality and reliability. Quantum Devices, Inc. is ISO 9001 certified and the ISO Standard will provide the guidance for the vital function of maintaining our commitment to constantly improve our product quality. Quantum Devices is now proud to introduce it's new line of rotary encoders. Incorporating QDI's patented sensor technology, our QPhase™ Family of Encoders feature high resolution, increased frequency response and superior reliability over temperature (0 to 120 degrees C). QDI incremental and absolute encoders set a new standard and are backed by a 2 year factory warranty. We invite you to request an evaluation unit, additional information or price quotations. Mission Statement Quantum Devices is dedicated to the principle that light provides the power for all life on earth. We believe the quality, delivery and control of light is essential to the wellness of man and his advancement into the future.

Leave a Reply

Fill in your details below or click an icon to log in: Logo

You are commenting using your account. Log Out / Change )

Twitter picture

You are commenting using your Twitter account. Log Out / Change )

Facebook photo

You are commenting using your Facebook account. Log Out / Change )

Google+ photo

You are commenting using your Google+ account. Log Out / Change )

Connecting to %s

%d bloggers like this: