Maker Pro
Maker Pro

Rotational Encoders

M

Michael

Jan 1, 1970
0
Hi,

I've picked up a trackball with two (what I presume to be) rotational
encoders.

They have four wires coming from each, two power (red and black) and an
orange and yellow.

I presumed that as I moved the ball the orange and yellow wires would go low
(they're high when 5V is applied to the power wires) however connecting it
up to a darlington array driving a LED doesn't seem to affect the brightness
at all(I realise this is a crude way but it's all I had available at the
time)

Could please someone give me some idea as to how to interface this to a uC?
Or what I should be expecting to happen?

Cheers,

Michael
 
B

Bob Myers

Jan 1, 1970
0
I presumed that as I moved the ball the orange and yellow wires would go
low (they're high when 5V is applied to the power wires) however
connecting it up to a darlington array driving a LED doesn't seem to
affect the brightness at all(I realise this is a crude way but it's all I
had available at the time)

Have you looked at these lines on a scope, or just put
a meter on them? The way most rotational encoders work
is by putting out a pair of pulse trains or "square-wave"-
looking signals, and you watch the phase relation between
the two and count the number of pulses to figure out
how far the thing has moved and in which direction. A
simple meter might easily read these lines as a steady
5V or thereabouts, and you wouldn't necessarily see
anything on an LED, either (the pulses are too fast, if
you're moving at anything like normal speeds).

Bob M.
 
M

Michael

Jan 1, 1970
0
Bob Myers said:
Have you looked at these lines on a scope, or just put
a meter on them? The way most rotational encoders work
is by putting out a pair of pulse trains or "square-wave"-
looking signals, and you watch the phase relation between
the two and count the number of pulses to figure out
how far the thing has moved and in which direction. A
simple meter might easily read these lines as a steady
5V or thereabouts, and you wouldn't necessarily see
anything on an LED, either (the pulses are too fast, if
you're moving at anything like normal speeds).

Bob M.

I havn't got a scope to hand. However the meter stays at 5V (or
thereabouts). I havn't yet seen it change when the ball is moved.

Surely there must be a point where you can leave it and it stays low as
light is being blocked/let through?

Michael
 
I have played many times with arcade trackballs by happ controls and
Betson Imperial. if you rotate the ball at slow speeds, you should be
able to see the pulses as the lines go low. You can directly connect
them to a uC but the trick is in the programming software. Try to look
for freeware for your micro that pertains to rotary encoders. you might
need pullup resistors but it sounds like they are already there. As a
previous poster pointed out..its a phase relationship that determines
direction and pulse speed for velocity.

Good Luck --eric
 
another possibility is that the LED that illuminates the photo
transistor in the encoder is bad. Thats one of the big reasons they
(the whole trackball) get replaced. Lack of illumination will cause
the transistor to never switch on causing a logical low state.
 
M

Michael Black

Jan 1, 1970
0
Michael" ([email protected]) said:
I havn't got a scope to hand. However the meter stays at 5V (or
thereabouts). I havn't yet seen it change when the ball is moved.

Surely there must be a point where you can leave it and it stays low as
light is being blocked/let through?

Michael
I suspect you are looking at it wrong.

For the encoder, you need two signal lines. Both will output pulses,
but one will lead the other, and which one leads depends on the direction
of the physical encoder.

This is how direction is derived from the device. If you just had a series
of pulses out of one lead, you'd never know which direction it was going, just
how far.

Thus unless this is an odd encoder, the two non-power lines are not
signal and ground, which is what it sounds like you are expecting, but
signal and signal. You may not see a signal if you are looking across
those leads. You need to look at one lead to ground.

Michael
 
M

Michael

Jan 1, 1970
0
Michael Black said:
I suspect you are looking at it wrong.

For the encoder, you need two signal lines. Both will output pulses,
but one will lead the other, and which one leads depends on the direction
of the physical encoder.

This is how direction is derived from the device. If you just had a
series
of pulses out of one lead, you'd never know which direction it was going,
just
how far.

Thus unless this is an odd encoder, the two non-power lines are not
signal and ground, which is what it sounds like you are expecting, but
signal and signal. You may not see a signal if you are looking across
those leads. You need to look at one lead to ground.

Michael

Michael,

No, I had it wired correctly. But just tried it again this time powering
both encoders at the same time and it seems to be working. When you use two
LEDs you can see the change in pulses really clearly.

Still don't get why it wasn't working before....the wires from each encoder
are completely seperated.....

Cheers,

Michael
 
J

jasen

Jan 1, 1970
0
Hi,

I've picked up a trackball with two (what I presume to be) rotational
encoders.
They have four wires coming from each, two power (red and black) and an
orange and yellow.

Assuming genuine Atari (R) Trackball (TM)
It sounds like the one I once looked inside of
I presumed that as I moved the ball the orange and yellow wires would go low
(they're high when 5V is applied to the power wires) however connecting it
up to a darlington array driving a LED doesn't seem to affect the brightness
at all(I realise this is a crude way but it's all I had available at the
time)

IIRC the main PCB has circuitry that conveters the signals from the encoders
to something TTL compatible.
Could please someone give me some idea as to how to interface this to a uC?
Or what I should be expecting to happen?

Look closely at how the encoders were connected in the original device.
If you can't find th original boards look at jow the photosensors in a
ball-mouse are wired.

Bye.
Jasen
 
B

BobG

Jan 1, 1970
0
In general, you can get a count and direction determination by paying
attention to one edge of A, both edges of A, or both edges of A and B.
If the encoder has 16 A cycles per rev, this witll give counts per rev
of 16, 32 or 64. When the edge int hits, you look at the state of the
other input and inc or dec accordingly.
 
Top