2
\$\begingroup\$

In the following you can see the channel A ( above ) and the Channel B ( middle) output of an optic encoder that is connected on a rotating shaft.

enter image description here

My questions is: Does the impulse width impact the way you need to count the distance? To me , it seem that channel A is in advance from channel B therefore I just need to add distance to my current total distance ( convention A in avance on B = increment in position)

Could you see it as the distance going back and forward therefore explaining the larger pulse on channel A and smaller pulse on channel B?

[EDIT] Here is the link to the encoder that will be used

Encoder Datasheet

\$\endgroup\$
1
  • 1
    \$\begingroup\$ Yes, it moves fwd and bkw on the picture. You can count at each transition of A or B, in literature is named as 4x mode. \$\endgroup\$ Commented Oct 10, 2015 at 17:50

3 Answers 3

2
\$\begingroup\$

You need to count edges. Between them you are below resolution, so you don't know anything more accurately than counted edges. On your image the encoder moves two counts forward and two backwards.

\$\endgroup\$
1
\$\begingroup\$

If you are actually getting the output you show, while the shaft is turning in one direction, you have a faulty encoder and should replace it. Compare your drawing to the waveforms in the data sheet. For rotation at uniform speed the two traces should be square waves with a 90 degree phase shift, and this is nothing like what you show.

\$\endgroup\$
2
  • \$\begingroup\$ Well the speed is variable \$\endgroup\$
    – MathieuL
    Commented Oct 10, 2015 at 22:56
  • \$\begingroup\$ @MathieuL - Then the waveform stops being a nice square wave, but the sequence of edges remains the same. If your output looks as you say it does, you have a bad encoder. \$\endgroup\$ Commented Oct 10, 2015 at 23:23
0
\$\begingroup\$

A link to the encoder data sheet could and more details to this answer. You typically do not measure Pulse Width with an encoder.

There are many types of encoders; Absolute Position, Incremental, etc.

They also have many options; A Channel, B Channel, Z Channel, Quadrature, Pulses Per Revolution (PPR), etc.

Typically you have the encoder attached to something, a wheel, a gear, the actual motor. From the PPR you can calculate the angular change, multiply that by the "distance per angle" and you have the actual linear distance. There can be many factors that affect the accuracy of this calculation; Slip, backlash etc.

With a quadrature encode you can detect direction (CW or CCW) with A leading B or B leading A.

\$\endgroup\$

Your Answer

By clicking “Post Your Answer”, you agree to our terms of service and acknowledge you have read our privacy policy.

Not the answer you're looking for? Browse other questions tagged or ask your own question.