Go Down

Topic: DC motor optical encoder: how to tell forward from reverse (Read 2 times) previous topic - next topic

defwheezer

Feb 24, 2013, 04:13 am Last Edit: Feb 24, 2013, 05:24 am by defwheezer Reason: 1
I have an optical encoder (16 segment) on a DC motor from an animatronic toy (the new 2012 furby) that I want to control with an Arduino (Uno). The encoder is easy enough to read directly from the carrier board via the blue and white wires when energized with 3-5 v (red/black wires).  However, how can I discriminate between the forward and reverse directions?

Encoder board (encoder wheel not shown):


Oscilloscope traces:


I assume there is some way of telling apart the pulses with high leading edge VS pulses ending with high leading edge... but I have no clue how to do this with an Arduino.  Any help would be greatly appreciated!  

[edit: the chip shown is a Texas Instruments CD74HC14 chip that contains six inverting Schmitt triggers]

-cb

johnwasser

I think you are expected to know which direction you are driving the motor.
Send Bitcoin tips to: 1L3CTDoTgrXNA5WyF77uWqt4gUdye9mezN
Send Litecoin tips to : LVtpaq6JgJAZwvnVq3ftVeHafWkcpmuR1e

retrolefty

Quote
However, how can I discriminate between the forward and reverse directions?


Well it's built into the encoder in that there is a offset from the channel A and B beams such that the rotating grid will interrupt one channel before the other in one direction and of course when the direction is changed the channel seeing interrupt first will reverse. If it happens to not be correct, simply rewiring the channel wires will correct the situation.

This also relates to the direction the motor turns via the H-drive polarity allied to the windings, so there are basic set ups you have to test for and correct if needed, but it's usually just swapping two wires so all the phase relationships are correct.

Lefty


defwheezer


Quote
However, how can I discriminate between the forward and reverse directions?


Well it's built into the encoder in that there is a offset from the channel A and B beams such that the rotating grid will interrupt one channel before the other in one direction and of course when the direction is changed the channel seeing interrupt first will reverse.

Lefty




Correct me if I am wrong, but there is only one channel for this encoder (one set of trans/rec)- you can see them on the back of the board (the side with no IC) and of course the encoder wheel travels between them.

retrolefty



Quote
However, how can I discriminate between the forward and reverse directions?


Well it's built into the encoder in that there is a offset from the channel A and B beams such that the rotating grid will interrupt one channel before the other in one direction and of course when the direction is changed the channel seeing interrupt first will reverse.

Lefty




Correct me if I am wrong, but there is only one channel for this encoder (one set of trans/rec)- you can see them on the back of the board (the side with no IC) and of course the encoder wheel travels between them.


Well if the sensor is a single channel then it's not an encoder at all but rather just a speed sensor. I can't tell from the rather small picture if it's a single channel speed sensor or a two channel quadrature encoder. Four wires should be enough for a full two channel quad encoder with, power, ground, channel A, and channel B wires?


Lefty

Go Up