Finding the RPM of an Optical Encoder using an Oscilloscope

 

We only need to measure one of the incremental channels in order to calculate the RPM of an optical encoder.  Using an oscilloscope to measure the period of one incremental channel A cycle.

We will need to find the frequency of the incremental signal. Keep in mind that converting from time to frequency is just a simple press of the “one over X” button on a scientific calculator.

Frequency =(1/X time)

Time = (1/X Frequency)

To find RPM Once you have the frequency, Multiply by sixty and divide by the line count.

RPM = (Frequency X 60)/Line count of encoder

 

 

The encoder in the video is a 5000 Line Count encoder.  Channel A is outputting pulses at a frequency of 224.2 Khz

RPM = (224.2Khz X 60)/5000

RPM = (13452000)/5000

RPM = 2690.4 RPM

I often use this method to either verify the speed of a motor controller I have built, or if I know the RPM of the motor, I will sometimes use this as a quick way to verify the line count of an encoder.

You can also use the handy Web-based QDI optical encoder calculator  as well.

 

Jim

Advertisements

Finding the Index Pulse of an Incremental Encoder

The index pulse, often also called “Z” or “Marker pulse”, of an optical incremental encoder is a once per revolution digital pulse that is used for homing or count verification of incremental signals.

In the QD145 and QD200 series of encoders the index pulse fires when the mark on the top cover of the optical incremental encoder and the mark on the encoders shaft are aligned.

This mark also indicates the rising edge of the U channel for commutated optical incremental encoders.  Knowing the location of this edge is useful for the initial rough timing of Brushless DC motors.

Quantum Devices is a leading manufacturer of Optical Incremental Encoders.

Jim can be reached at 608.924.3000 or by e-mail at jmiller@quantumdev.com

Finding the Index on an Incremental Encoder with a DMM

Sometimes you don’t have the right tools to do the job.

Lets say you needed to identify where the index pulse was firing on your incremental encoder, but you left your oscilloscope in your other jacket pocket, and now all you have on hand is a DMM.

Well fear not, finding the index with a multimeter is possible although a bit tedious.

The index fires once per revolution and at higher line counts this makes it VERY easy to miss.  Since there is some delay in a multimeter’s display time, you will need to rotate the encoder very slowly to catch a change in voltage level.

The Blue box has a nine-volt battery inside that I regulated down to 5Vdc for the encoder power.  I have pulled out connections to ground (Black wire) and the index channel (Orange wire). When the index fires, the voltage will go from zero to five volts.

Jim is an Applications Engineer with Quantum Devices Inc. A leading manufacturer of Optical Encoders.

Optical Encoder Waveform Triggering

.

Seeing Encoder Quadrature with a two-channel scope

.

I received an e-mail from a customer concerned about the  “out of control” optical encoder signals he was seeing on his Oscilloscope.

The photo below shows the type of signal he was seeing:

The encoder in question was a 10,000 Line Count optical encoder. I noticed that he was running relatively slowly, about 100 RPM.  At that speed a lot of BLDC motors will show some degree of motor cogging, which is irregularity in rotation due to the magnetic fields in the rotor.

The customer was also triggering on an incremental channel (A&B) and not the index (Z) channel .

I am sure he had omitted the index as he wanted to see if the A&B incremental encoder signals were in quadrature.

I knew that when triggering on an incremental channel, the oscilloscope triggers off of whichever ever edge happens to occur within the scopes timing window.  What the customer was seeing on the oscilloscope was overlapping screen shots of the incremental channels as the motor speed changed.

In other words, he was seeing the encoder report exactly what the motor was doing.

If the customer were to trigger on Optical Encoder channel Z (Index) with one scope channel, they could see a nice steady signal. If they wanted to check quadrature, they could then compare the phasing of A and then the phasing of B relative to where the index channel was located.


That’s a little bit of a hassle, it’s much nicer to see both A and B optical encoder signals on the scope at the same time.  The way to do this with a two-channel scope like the Tektronix TDS 210 we have, is to use the scope’s external trigger and trigger off of channel Z.

The video below compares the optical encoder signals being triggered off of channel A and then being triggered off of channel Z.


Jim is an Applications Engineer for the leading optical encoder manufacturer Quantum Devices Inc. He can be reached via E-mail at jmiller@quantumdev.com.


Understanding Incremental Encoder signals

Which incremental encoder wires should I use?

Channels A & B (Incremental Channels)

Use only A (or only B) for an RPM or counting applications where the rotation is either unidirectional, or where you don’t need to know direction.

Use A and B together to know direction. After two low pulses the next high pulse indicates direction.  This is due to the phasing offset between A and B of 90 electrical degrees, placing the signals in what is known as quadrature.

These signals can also be used to set up an up/down counter

Index pulse, also known as Z, marker, or I

Index pulse is a pulse that occurs once per rotation. It’s duration is nominally one A (or B) electrical cycle, but can be gated to reduce the pulse width.

The Index (Z) pulse can be used to verify correct pulse count

The Incremental Encoder Index pulse is commonly used for precision homing.  As an example, a lead screw may bring a carriage back to a limit switch.  It is the nature of limit switches to close at relatively imprecise points. This only gives a coarse homing point. The machine can then rotate the lead screw until the Z pulse goes high.

For a 5000 line count encoder this would mean locating position to within 1/5000 of a rotation or a precision of .072 Mechanical Degrees.  This number would then be multiplied against lead screw travel.

Commutation (UVW) signals are used to commutate a brushless DC motor. I always like to compare these signals to that of a distributor in a car. The commutation (sometimes called “Hall”) signals tell the motor windings when to fire

You would need to have encoder commutation signals if the motor you are mounting the encoder to has a pole count and there is no other device doing the work of commutation.  It is important to note that commutation signals need to be aligned or “timed” to the motor.


Single ended VS differential

These terms refer not to the waveforms of signals, but instead to the way the signals are wired.

Single ended wiring uses one signal wire per channel and all signals are referenced to a common ground.

TTL and Open Collector are types of single ended wiring.

Differential wiring uses two wires per channel that are referenced to each other.  The signals on these wires are always 180 electrical degrees out of phase, or exact opposites.  This wiring is useful for higher noise immunity, at the cost of having more electrical connections.

Differential wiring is often employed in longer wire runs as any noise picked up on the wiring is common mode rejected.

RS-422 is an example of differential wiring.

.

How to time Optical Encoder commutation channels to a BLDC motor

Optical Encoder Brushless DC Motor timing using Back EMF

The optical encoders we work with have a set of three Commutation tracks (U,V,W) which correspond to the three phases of the motor (R,S,T).

Alignment of the Optical encoder commutation signals to a BLDC motor could be thought of as being comparable to timing the distributor of an auto engine. Just as the distributor tells the spark plugs when to fire, the optical encoder tells the amplifier/drive when to fire the windings in the BLDC motor.

And just like a car engine, if the timing alignment is off,  the motor will not run correctly, will run inefficiently, or will not run not at all.

If two phases are accidentally reversed, the motor may even run backwards.
Keep in mind that you will need to have the information that describes which motor winding corresponds to which encoder commutation signal before trying to align an optical encoder to a BLDC motor.

Basic Steps:

1) One phase of the motor is energized locking the motor into position.

2) The encoder is rotated to a given position, which is usually the start of one of the commutation signals (I.E. leading edge of U). Often times this corresponds with the encoders index pulse.

3) The encoder is assembled to the motor and the shaft is locked in place. (via encoder set screws) The encoder flex mount is not yet secured.

4) The motor winding is de-energized.

5) The Optical Encoder is powered.

6) The motor/encoder is back driven by another motor and the two waveforms are displayed on an oscilloscope. One waveform is back EMF from the motor phase, and the other is the encoder commutation channel.

Back driven motor set up

Below the Motor back EMF and Encoder Commutation (Hall) signals are shown. They have been separated for clarity, when timing a motor you will want them to overlap.

7) While the motor is rotating, the assembly is fine tuned by rotating the encoder body to align the encoder signal to the Motor waveform.

Video of BLDC motor Back EMF to Optical Encoder Hall Phasing

Proper timing typically calls for aligning the zero volt level of the back EMF Sin wave with the edges of the commutation signals.  That level is shown below by the red line.

8 ) Once alignment is achieved, the encoder flex mount is secured, locking in the phase relationship between the motor and encoder.