I've lost track of what type of encoder you are reading but don't forget that 
the slotted optical sensors have what is called Hfe.

http://isocom.com/wp-content/uploads/2017/09/DD93222-H21Ax_H22Ax-100817.pdf

As an example look at the above data sheet.  With a forward current through the 
emitting LED of 20mA the minimum current you can expect is 1mA through the 
collector of the photo transistor at 5V.  No maximum is specified.

Now assume they've designed the circuit for 5V to 24V so to limit current 
through the LED to no more than about 30mA at 24V they use a 750 ohm series 
resistor through the emitting LED.  That's only 5mA at 5V.

Even with 30mA through the emitting diode the Hfe means you can expect 1mA at 
5V on the outputs.  So a pull up resistor of 4.7K to 5V should give you a nice 
clean signal out and 10K would probably be even better.  Although now it's very 
sensitive to noise since it's a very high impedance circuit. 

On the receiving side this isn't close enough to run an opto isolator diode.  
You'd have to read this with TTL inputs instead or even better CMOS.

Way back in 2007 I built a few little modules like this when I was looking at 
adding a multiline encoder to my South Bend Heavy 10L.  A commercial encoder 
with that size bore (2") was in the hundreds of dollars and the idea of a 
toothed belt coupling to a 1/2" shaft encoder wasn't much better.  Times have 
changed.

Anyway to interface to surplus slotted sensors lifted from old dot matrix 
printers resulted in the circuits in the link below.  Click on the photos for a 
larger image.

http://www.autoartisans.com/ELS/OptoSpindle.htm

The last photo shows a small DC motor, PWM (555 Timer) based speed control and 
the slotted sensor.  The circuit created nice clean edges transmitted via 
differential RS485.

John Dammeyer



> -----Original Message-----
> From: Gene Heskett [mailto:[email protected]]
> Sent: November-18-20 9:36 AM
> To: [email protected]
> Subject: Re: [Emc-users] couple Q's on PID's
> 
> On Wednesday 18 November 2020 11:50:26 Chris Albertson wrote:
> 
> > Your encoder is likely just a bare phototransistor.  You might need a
> > 10K pull-up.     THat might be enough
> 
> [...]
> 
> > Disconnected from the bob, it does do a
> > > rail to rail swing with a rise or fall time in the very low
> > > microsecond range.
> 
> Read this last sentence again Chris, the rise time is just a microsecond
> when disconnected from the BoB, Connected to the BoB, fall time is
> unchanged, but rise time looks like it having to charge a .1uf cap.
> Tested now with 3 Sainsmart BoB's.  I can see a change in the curve as
> it goes above the opto's on point at about 2 volts, the rc curve
> suddenly gets extended to about double.
> 
> I can still see the change in the shape of the curve at the output of the
> encoder with a 1500 ohm pullup. It gets about 10x faster with a 1500 ohm
> pullup, but how much can it sink?
> 
> Its nice and square just driving the scopes 10x probes. This is beginning
> to look as if I am going to have to pull the optos out of the sainsmart
> BoB's.
> 
> Its a PITA, but I've done it before. And I normally install a couple
> 1n914's as rail snubbers to protect the gates of the HCT stuff on the
> card.
> 
> So I may as well get to it.
> 
> Thanks Chris.
> 
> > > Thanks all.
> > >
> > > Cheers, Gene Heskett
> > > --
> > > "There are four boxes to be used in defense of liberty:
> > >  soap, ballot, jury, and ammo. Please use in that order."
> > > -Ed Howdershelt (Author)
> > > If we desire respect for the law, we must first make the law
> > > respectable. - Louis D. Brandeis
> > > Genes Web page <http://geneslinuxbox.net:6309/gene>
> > >
> > >
> > > _______________________________________________
> > > Emc-users mailing list
> > > [email protected]
> > > https://lists.sourceforge.net/lists/listinfo/emc-users
> 
> 
> Cheers, Gene Heskett
> --
> "There are four boxes to be used in defense of liberty:
>  soap, ballot, jury, and ammo. Please use in that order."
> -Ed Howdershelt (Author)
> If we desire respect for the law, we must first make the law respectable.
>  - Louis D. Brandeis
> Genes Web page <http://geneslinuxbox.net:6309/gene>
> 
> 
> _______________________________________________
> Emc-users mailing list
> [email protected]
> https://lists.sourceforge.net/lists/listinfo/emc-users



_______________________________________________
Emc-users mailing list
[email protected]
https://lists.sourceforge.net/lists/listinfo/emc-users

Reply via email to