E-mail on Creating a Post Quad Encoder signal

Below is an e-mail response I sent to someone who was asking about how to calculate the sampling rate they needed to 4X encoder signals.  4Xing or “Post Quad” is a way to use the fundamental A and B encoder pulses to get a higher line count.

I wasn’t sure if he was under the assumption that by sampling at a 4X rate he could essentially get 4X the signal, so I felt a long winded reply was needed.

The blue bulleted lines are his original questions.

Hi Stan,

I didn’t see it in this e-mail train, but I understand that your are looking to get 80,000 counts from the 20,000 line count encoder.

Here is my take on your questions which I have highlighted in Blue:

  • One rotation per second would give me 20KHz from each phase (A&B)

This is correct.

  • In a perfect world, I would need to sample the phases at 4 times this rate
  • But there is a 10% tolerance on phase to phase, so I need to increase this rate by a factor of 1/.9 or a total 4.4 times the phase frequency

You must be going after the 2X rule as it applies to anti-aliasing, then since there are two channels multiplying that by two. Then I see that you are also adjusting for phase shift.

Your math appears to be right on track, but I am going to go into detail here with some pictures as it is easier for me to communicate my meaning this way.  Besides, I was in AutoCad anyway…..

Below is a pictorial representation of sampling at 4X the fundamental frequency of A (or B) . The blue lines are sampling points and the red square waves are the A&B waveforms. The thickness of the blue line may not be appropriate as sampling will take a certain amount of time, so the lines could potentially be thicker, but the idea will be the same.Sampling

The points at which the blue lines cross the red square waves will define the high and low points, In the photo below they are circled.


Removing the Blue and Red lines indicates the data points as seen by the computer/sampling device.


Then connecting the dots….


We see that this sampling rate essentially correctly “maps” the waveform, introducing some phase shift error.  Depending on where sampling occurs this error may be as high as just under 90 electrical degrees, but does not directly give you 4X the frequency.

You may already be aware of all of this and are just asking “How low of a sampling frequency can I get away with ?”   My answer would be 4X will be more than enough, as 2X the Max freq. on each channel is all that is really necessary.   Even the extra amount you added for phase shift may not be necessary, as any phase shift does not change the underlying frequency.

I just wanted to make sure that it was clear that sampling at 4X the rate is not the same as 4Xing the signal.

In practice 4Xing the fundamental signal is usually done by applying some sort of one shot or monostable circuits that are triggered off of the rising and falling edges on both channel A and Channel B, then using an AND logic gate to combine the two into one signal.

The duration of this pulse will be  constant regardless of speed, as it is programmed into the one shot, but the “low time” between pulses will vary with rotational speed.

This is the hardware way to do it, it and sounds like you may be approaching it via software.

Let me know if you have any other questions,



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:

WordPress.com Logo

You are commenting using your WordPress.com 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: