IS501 sensor -- my solution

Tony Duell ard at p850ug1.demon.co.uk
Tue Oct 5 12:56:58 CDT 2010


> > > Your solution to the waveform is interesting. You added the capacitor
> > > to fix the problem caused by the 74LS14. The problem is that the
> > > hysteresis of the LS14 is so large that it eats up the phase
> > > margines of the roughly sine/cosine from the optical sensors.
> >=20
> > I don't think this is the same problem. Without the capacitors=2C and wit=
> h=20
> > the 470R resistors=2C I was getting waveforms with roughtly 1:1 mark-spac=
> e=20
> > ratio=2C and while not exactly in quadrature=2C pretty darn close. The on=
> ly=20
> > problem was that every so often (perhaps 1 in every 10000 pulses)=2C ther=
> e=20
> > would be a glitch in one of the waveforms. It's not supply relateded=2C a=
> nd=20
> > I couldn't repodcude it by=2C say=2C jiggling the encoder disk.
> >=20
> > But that glitch was taken by the elctronics as a valid pulse which upset=
> =20
> > things.=20
> >=20
> > AAdding the capacitors hasn't noticeably changed the mark:space ratio or=
> =20
> > the phasing. But it's got rid of the glitches.=20
> >=20
> > A lot of optical mice use the '14 and the output signals look pretty good=
> =20
> > to me.=20
> >=20
> > -tony
> >=20
> 
> Hi Tony
>  It looks good as long as you are going one direction. Try one tick
> backwards and you'll understand=2C right after the other input has
> flipped. You'll get and error count. I won't happen all the time=2
> just when it stops in that small window of the cycle.

Now, let's think about this..

Firstly, the time constant of a 470R resitor and 1nF capacitor is 
aroundhalf a microsecond. The periods of the quadrature signals are 
measured in milliseconds. Therefoe, the capacitor has little effect on 
the timing mark:space ratiom,. etc, of these signals. It just removes 
very narrow glitches.

There is always a potential probklem when you reverse the direction of 
rotation of aquadrature encoder. The simple scheme for getting a clock 
and direction signal, shown in an awful lot of books, and used in 
some lesser devices, has a bug IMHO. Basically, no matter how perfect the 
signals are, you may end up with the direction signal beign in the wrong 
state for the first clock pulse. FWIW, the logic in this printer is 
considerably more complex, and I don't think it sufferes from this problem.

Your thoguhts are based on the assumption that the output form the 
photosensor is sinusoidal. That, I think assumes that the size of the 
photosenseor is the same as the slit width in the encoder disk. This is 
the case for some good encoders (the HP ones I've worked with, for 
example), I don't think it applies here. The output looks more like a 
poor square wave -- sloping sides and a long flat high or low section. 
This would suggest that the slit is much larger than the sensor. Given 
that sort of output waveform, it doesn't really matter where on the edge 
you take as the threshold, the transistion time is short compared to the 
period of the waveform. So the hysteresis of the comparator doesn't 
really make that much difference.


>  And=2C yes=2C I know a lot of mice use the LS14. I've even tinkered a
> few into working with them in them. Those that have a LM339 or

I'm harldy and expert on mice, but of the ones I've seen : 

Modern ones (like the PS/2 mouse I took the  dual phototransistor from) 
just feed the imputs into some microcontroller thing. I have no idea what 
the input characteristics are, and there's no trivial way to measure them 
[]1]. So no idea what the hysteresis is.

[1] One way to do it would be to feed a pair of quadrtature signals into 
the chip with said chip connected to a host expecting a PS/2 mouse, and 
adjust the high and low levels of each signal in turn until it just stops 
working. Rather more work than I want to do for this :-)

Older ones, which used chips I can recognise, and for whcih I may even 
have official schematics/service manuals use some kind of TTL or 
4000-series CMOS schmitt trigger chip. I[ve not seen one that doesn't. 
The '14 in variosu forms is common. Maybe it is a bad design really 
(althohgh as I said, I think that depends on the outputs of the sensors) 
but it seems to work well enough.

> similar work fine. It should have about 10% or less hysteresis
> feedback. Most LS14s are in the order of 30% or more. Try
> the LM339 and resistors.

_If_ I havr problems, then that's what I'll do. So far it seems to be 
working fine. I have now alinged the carriage [2] and it prints as well 
as I'd expect a Sparkjet ot print. In other wods it's legible, but 
nowhre near letter quality.

[2] You need to get the axis of the ink cartirdge level with the top of 
the paper guide electrode, and a consistent distance from it across the 
paper. If the cartridge is far too low, it doens't print at all. If it's 
just to lwo, the ink scatters from f the edge of the guide onto the paper 
and it looks weird. If its' mucth too high, you get ink depositied o nthe 
front of the cartridge, and the printing fades out after a frw lines.

What I did was make a special tool. A 4mm rod (same diameter ad the glss 
tube in the ink cartridge) with a point on one end (point on the axis of 
the rod, obviously).I fitted that into the carriage in place of the 
cartridge (printer power off and casing removed) and adjusted the 
position of the carirage rail assembly so that the point was just running 
among the top of the elecrode, and just touching a sheet of paper fed 
round the platten. On the second attempt, it printed fine....

-tony



More information about the cctalk mailing list