Go Down

Topic: Encoder, how do I??? (Read 1 time) previous topic - next topic

imrobc


Quote
I have a few Opto-endstops, "optical interrupter's" and would like to use them along with my mill to make a nice Encoder for a Lathe Spindle.

I am not sure you can do this.

Do you need to detect the motion in two directions or just one.
One is easy you just count the number of pulses, maybe even with an interrupt.
To what purpose do you want to put the count information you get?


I'd only need one direction to start, really just something simple.

I want the count for threading, the lathe I'm thinking about adding this to is a "Unimat-3" either that or I build something.

So I'm probably safe assuming that there is much more to the circuit, but for the purpose of learning and "re-inventing the wheel" I'm just looking for a simple .dxf of an encoder wheel maybe 100mm in dia, and a simple sketch for the Opto-interupter.

Thanks again for any and all help.
http://whatisacnc.com
The frustration of a CNC

Grumpy_Mike

No need for a dxf file, it is just a disc with a hole in it.
The sketch to is trivial, either use the standard interrupt count example or simply count the pulseIn the relevant part of the sketch.

imrobc


No need for a dxf file, it is just a disc with a hole in it.
The sketch to is trivial, either use the standard interrupt count example or simply count the pulseIn the relevant part of the sketch.


I'd like the DXF so I can cut the disk using a mill.

The sketch I'm thinking of using is the one provided here: http://www.google.ca/url?sa=t&rct=j&q=&esrc=s&source=web&cd=1&ved=0CDQQFjAA&url=http%3A%2F%2Fplayground.arduino.cc%2FMain%2FRotaryEncoders&ei=deblUN2VJMbNqQGqiYGYAQ&usg=AFQjCNFYFGDoduwUvVsnz9KbekdcgDfjuQ&bvm=bv.1355534169,d.aWM

Just, how do I adjust the sketch to suit the 100mm encoder disk?

Also the Opto won't work without breaking the beam, so I'm pretty sure the disk needs a number of breaks/ holes, and the sketch counts the number of interruptions to determine shaft location.
Is this correct?

Thanks again for the help.
http://whatisacnc.com
The frustration of a CNC

Grumpy_Mike

You don't have to do anything to adjust the sketch for any size encoding disc, you are counting revolutions. You only need one hole in the disc, having more gives more pulses per revolution.
I'm not sure what you are having difficulties with, you might be over thinking things.

imrobc


You don't have to do anything to adjust the sketch for any size encoding disc, you are counting revolutions. You only need one hole in the disc, having more gives more pulses per revolution.
I'm not sure what you are having difficulties with, you might be over thinking things.


Seriously! Just one hole?

Maybe I am over thinking things, I've just seen more complex encoder disks when searching online.

How does the arduino know the location of the disk with just one slot?

I'll give it a try, thanks Mike.
http://whatisacnc.com
The frustration of a CNC

Go Up