Maker Pro
Maker Pro

HP quadrature decoder?

J

Jim

I have salvaged a lot of HP Deskjet printers lately, and have come on a part
in all that I would like more information on. It is obviously a print head
position sensor, and looks somewhat like a wide photo-interrupter. It is
located inside the print head/cartridge carrier.......the part that moves
back and forth when printing......and has an optical interruper strip that
runs through it.

Most have part numbers like Q9874 and Q9864, the HP logo, and the part has 4
leads, a lens, etc.

Is this a quadrature detector/direction decoder or just simply a
photo-interrupter? I can't seem to find a data sheet or any other info on
this part. If it is a quadrature direction decoder, I would like to know,
'cause I have a project where I would like to use it.

Thanks
 
P

PolyVinalDistillate

Hey there.

I have also aquired a couple of HP printers with the very same sensors.
One (Q9864) is used for the striped strip running behind the print-head

for position sensing, while the other (Q9845) is used in a similar
fasion
for a similarly encoded disk to gauge the paper position by the
rotation
of the rollers. I intend to use them for positioning in a CAD system,
and have also been looking for datasheets without success.

I have decided that I will figure them out datasheet or not, as they're

too useful looking to be sat around doing nothing! I'll happily tell
you
what I learn if your still looking for information when I've done some
fiddling about with the oscilloscope. So far I've only had a visual
inspection of the components and contemplated their use. I'm fairly
sure of the power connections from this first investigation, but can
only
guess at the function of the other two pins! I'd like to think one
pulsed
for left movement and the other for right... but that may be too much
to
hope! Perhaps it's more along the lines of the sensor system in a
mouse, where extra circuitry is required to decode direction from the
order of the beam interruption.

I have to show my ignorance and admit I have no idea what a
'quadrature' direction decoder is :) But I assume it's effectively a
device
that provides ready-decoded left and right outputs. Or perhaps it has
some bearing on sensitivity??

so far what I have is:


_________
| | 1: -ve
| | 2: ?
| | 3: +ve
---------- --------- 4: ?
|___________________|
| | | |
1 2 3 4

Not sure of the voltage, but I'd guess 5v *crosses fingers*

Please let me know if you've got more information than this!

Thanks :)
 
L

Lostgallifreyan

I have to show my ignorance and admit I have no idea what a
'quadrature' direction decoder is :) But I assume it's effectively a
device
that provides ready-decoded left and right outputs.

You got it. It's not entirely ready as a simple one-bit flag might be for
direction, but that's what it does. Not sure about this actual part, but it
probably is one. Two sensors, placed so that slots making a 50% duty cycle
will place a leading edge on one sensor when the second sensor is still 25%
behind, hence quadrature, a phase shift of a quarter cycle. A circuit can
test which sensor is trailing, regardless of speed, and get direction from
that.
 
P

PolyVinalDistillate

Of course :) I should've guessed that's where the quadrature came from!
*thinks back to his degree... QPSK and the like* Cheers for that :)

It could well be one of those, but the strip passing between the source
and the sensor is encoded somewhere in the order of 1/4 to 1/2 mm, so
it would need some fairly fancy optics within... The sensor is simply a
chunk of silicon around 3mm square under a protective plastic cover.
Looking at it now, it seems to me the only way it could possibly be a
reliable component is if the source is a laser-diode, and the strip
acts as a diffraction-grating, effectively being magnified by the
formation of interference fringes that can be readily detected when
they fall and move across the sensor. This would also mean there's a
possibility that the intervals the sensor can detect would be smaller
than those on the strip - but now I'm really just guessing :)
 
L

Lostgallifreyan

Of course :) I should've guessed that's where the quadrature came from!
*thinks back to his degree... QPSK and the like* Cheers for that :)

It could well be one of those, but the strip passing between the source
and the sensor is encoded somewhere in the order of 1/4 to 1/2 mm, so
it would need some fairly fancy optics within... The sensor is simply a
chunk of silicon around 3mm square under a protective plastic cover.
Looking at it now, it seems to me the only way it could possibly be a
reliable component is if the source is a laser-diode, and the strip
acts as a diffraction-grating, effectively being magnified by the
formation of interference fringes that can be readily detected when
they fall and move across the sensor. This would also mean there's a
possibility that the intervals the sensor can detect would be smaller
than those on the strip - but now I'm really just guessing :)

Without seeing it I can't say for sure, but two things to think about:
1. The sensors don't have to be at 0.25mm apart to read this
regular pattern, they could be 1.25, 2.25, so long as that fraction is
correct.
2. If you look at a cheap ball-type mouse you'll see slotted wheels that
are that finely spaced, it's not expensive tech now.

Usually the sensor surface will have two tiny slots in it. If yours really
is a single window, it might be something different. Maybe a two-element
detector that sees the shadow passing between two halves, determining
direction that way.
 
P

PolyVinalDistillate

I have used the sensors from these mice in the past, and figured out
circuitry to decode direction. However with such fine spacing on the
encoded strip with the printer sensors, and the 3mm gap between the
sensor and the source, I think there would be issues with light
diffraction were the light not coherent. By the time light from a
noncoherent source reached the sensor through the strip, it is quite
believeable that the encoding would be lost and undetectable, though I
can't be sure without a proper test of the strip back in the optics
labs to gague it's pitch properly.Under magnifying lens and with the
calipers I counted 5 lines per mm.

I also studied the sensor surface under the magnifying lens, and it
appears to be made up of many sensors on the same axis as the encoded
strip. suggesting it may well be more advanced than simply a
two-element sensor. Certainly there are not two slots on it's surface.

Cheers for the thoughts, you're pushing me closer to digging out a PSU
and firing up the ol' valve-oscilloscope to do some probing of a more
electrical nature!
 
L

Lostgallifreyan

I have used the sensors from these mice in the past, and figured out
circuitry to decode direction. However with such fine spacing on the
encoded strip with the printer sensors, and the 3mm gap between the
sensor and the source, I think there would be issues with light
diffraction were the light not coherent. By the time light from a
noncoherent source reached the sensor through the strip, it is quite
believeable that the encoding would be lost and undetectable, though I
can't be sure without a proper test of the strip back in the optics
labs to gague it's pitch properly.Under magnifying lens and with the
calipers I counted 5 lines per mm.

I also studied the sensor surface under the magnifying lens, and it
appears to be made up of many sensors on the same axis as the encoded
strip. suggesting it may well be more advanced than simply a
two-element sensor. Certainly there are not two slots on it's surface.

Cheers for the thoughts, you're pushing me closer to digging out a PSU
and firing up the ol' valve-oscilloscope to do some probing of a more
electrical nature!

Any motivation to use an oscilloscope is good motivation. :)

That sensor is interesting me a lot now, if it has several sensors built
in. It's possible they depend on equal spacing to make the same detection
as each other, in a way to reduce noise by taking a mean average or
something. Also, I don't know if the light has to be coherent, it might be
enough to be very narrow bandwidth. Some LED's are almost monochromatic, I
had a few from Hewlett Packard that were like that. Coherence can bring
troubles of its own, mainly speckle, which dramatically increases noise.
 
P

PolyVinalDistillate

I've had the sensor hooked up to 5v. Get a pretty, dull red glow from
the source, and pins 2 and 4 are indeed quadrature outputs almost
exactly 90 degrees out of phase (judging from the poor trace on my
valve oscilloscope). Direction encoded like so:

Strip Direction:1->2->3->4. 2 is 90 degrees before 4

The outputs appear to be TTL compatible (I have hooked them up to the
pushbutton circuit to a little micro for pulse counting through a
74LS148), and the device hasn't burned out on 5v :) I've also rigged up
the vernier caliper with the strip running through the device. Due to
my setup, I only have 1cm translation in which to measure pulses, but
after moving back and fourth 4 times through 4 cm, I've clocked up 237
pulses. This works out to around 0.17 mm per pulse, and a 50/50 duty
judging from the oscilloscope readout. The quadrature output seems to
push the accuracy to under 0.1mm... I like these parts, they have
potential :)

I'd overlooked speckle... though I'm not sure of it's impact were there
a narrow enough beam of light emmitted... Cretainly it appears to be
general illumination in the near-infrared that is emitting from the
source, and not a beam, which would fit in with it being relatively
monochromatic as opposed to coherent. Were it coherent, I'd have
expected the sensor to be yet more sensitive :)

Looks like I've got enough information to use the sensor myself now -
hope it's useful to others cannibalising HP inkjets!

And just to ensure my pinout is useful, here it is again (even though
it'll be all out of alignment when it's posted):

Top View

______
| -> | Phase1 leads Phase2 90deg
| <- | Phase2 leads Phase1 90deg
_____| |_____
|_______________|
| | | |
1 2 3 4
1: GND
2: Phase1
3: +5v
4: Phase2
 
L

Lostgallifreyan

I've had the sensor hooked up to 5v. Get a pretty, dull red glow from
the source, and pins 2 and 4 are indeed quadrature outputs almost
exactly 90 degrees out of phase (judging from the poor trace on my
valve oscilloscope). Direction encoded like so:

Strip Direction:1->2->3->4. 2 is 90 degrees before 4

The outputs appear to be TTL compatible (I have hooked them up to the
pushbutton circuit to a little micro for pulse counting through a
74LS148), and the device hasn't burned out on 5v :) I've also rigged up
the vernier caliper with the strip running through the device. Due to
my setup, I only have 1cm translation in which to measure pulses, but
after moving back and fourth 4 times through 4 cm, I've clocked up 237
pulses. This works out to around 0.17 mm per pulse, and a 50/50 duty
judging from the oscilloscope readout. The quadrature output seems to
push the accuracy to under 0.1mm... I like these parts, they have
potential :)

Nice, basic part, a good module to have. It rules out the more complex
business of handling analog differences, as you say it's already close to
TTL level switching.
I'd overlooked speckle... though I'm not sure of it's impact were there
a narrow enough beam of light emmitted... Cretainly it appears to be
general illumination in the near-infrared that is emitting from the
source, and not a beam, which would fit in with it being relatively
monochromatic as opposed to coherent. Were it coherent, I'd have
expected the sensor to be yet more sensitive :)

Coherence would have been a real problem I think, not a benefit. The
narrower the beam, the worse it gets. If you have a focussable laser
module, try focussing to a pinpoint at two feet, then drawing the spot
across a white wall, or even a fine white ceramic to show how even the
finest surfaces make huge noise. The jumps in apparent brightness will be
fierce, far worse than if you spread the light in a 3mm spot and try the
same thing.
Looks like I've got enough information to use the sensor myself now -
hope it's useful to others cannibalising HP inkjets!

And just to ensure my pinout is useful, here it is again (even though
it'll be all out of alignment when it's posted):

Top View

______
| -> | Phase1 leads Phase2 90deg
| <- | Phase2 leads Phase1 90deg
_____| |_____
|_______________|
| | | |
1 2 3 4
1: GND
2: Phase1
3: +5v
4: Phase2

I recognise it now, I've seen them in various boards I've salvaged in the
past. Some have the sensors on one side, as in this case, others have a
slot between two projections to work by transmission instead of relection,
and I think most have the same 4 wire connecting plan.
 
P

PolyVinalDistillate

I've no such laser module at my disposal to experiment with, but I
imagine you're correct. It would make sense :)

The only versions of these sensors I've seen before the inkjets were
the same style as those in ball-mice, with two clearly visible slits
and one light emitter. These ones are far snazzier than any of the
others in my collection! Also, these are the first I've had that are so
friendly they even save you the trouble of a couple of transistors and
schmidtt triggers to convert to TTL :)
 
P

PolyVinalDistillate

I have thrown together a little decoder for the sensor to give me
left/right pulses at minimum spacing possible. This has given me an
accuracy of 600 devisions-per-inch (approx. 1/24 mm). The kind of
number I'd have expected if I thought about it for any length of time
:)

I think that's all there is to say about this little device now, except
mebbe 'I want more of them' :) Thanks for all the motivation to stop me
being a lazy arse, and actually bother to figure it out! I'm awfully
pleased - it's just the thing I wanted for a CAD Milling machine. Now I
just have to build the milling machine... heh
 
L

Lostgallifreyan

Thanks for all the motivation to stop me
being a lazy arse, and actually bother to figure it out!

It keeps me going too. Got to draw on anything I can to motivate me, on
some things... I'm trying to re-aqquaint myself with some trigonometry to
rotate an array of points. Interesting distractions are as helpful as
trying to focus, and definitely more fun.
 
Top