Pages: [1]   Go Down
Author Topic: Encoder, how do I???  (Read 1011 times)
0 Members and 1 Guest are viewing this topic.
Wiscon
Offline Offline
Newbie
*
Karma: 1
Posts: 22
Admin whatisacnc.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Hi,

Just wondering if anyone can direct me down the proper path, I'm looking to build an Encoder.

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.

Any suggestions greatly appreciated.

I need help with the Sketch and encoder wheel, I've downloaded a couple DXF models but not sure how to code the Arduino.

Thanks for any and all help everyone.
Logged

http://whatisacnc.com
The frustration of a CNC

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 620
Posts: 33991
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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?
Logged

0
Online Online
Shannon Member
****
Karma: 206
Posts: 12092
Arduino rocks
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Accuracy? Speed?  What access is there to the shaft, shaft diameter, etc etc.
Logged

[ I won't respond to messages, use the forum please ]

South Texas
Offline Offline
Edison Member
*
Karma: 8
Posts: 1025
View Profile
 Bigger Bigger  Smaller Smaller  Reset Reset

Don't know how many counts per revolution you want...

But for the simplest encoder - you would want a segment  (paper of thin sheet metal) attached to the spindle that would block the optos for 180 degrees of rotation. place the 2 optos 90 degrees apart. This wold give you 4 transistions per revolution - 00 - both off. 01 - A on B off. 11 - Both On. 10 - A off B on. and repeat.

The important thing is that however many counts you want that you can get the 00, 01, 11, 10 pattern out of your encoder.

What kind of lathe are you using this on? Using it for speed control or threading?
Logged

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 620
Posts: 33991
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
The important thing is that however many counts you want that you can get the 00, 01, 11, 10 pattern out of your encoder.
You only need two outputs like that if you want to detect direction. If it is just the number of turns a simple single output sensor will suffice.
Logged

Wiscon
Offline Offline
Newbie
*
Karma: 1
Posts: 22
Admin whatisacnc.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

http://whatisacnc.com
The frustration of a CNC

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 620
Posts: 33991
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Wiscon
Offline Offline
Newbie
*
Karma: 1
Posts: 22
Admin whatisacnc.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

http://whatisacnc.com
The frustration of a CNC

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 620
Posts: 33991
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

Wiscon
Offline Offline
Newbie
*
Karma: 1
Posts: 22
Admin whatisacnc.com
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

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.
Logged

http://whatisacnc.com
The frustration of a CNC

Manchester (England England)
Offline Offline
Brattain Member
*****
Karma: 620
Posts: 33991
Solder is electric glue
View Profile
WWW
 Bigger Bigger  Smaller Smaller  Reset Reset

Quote
Seriously! Just one hole?
If you want to know how many turns the shaft has made then yes only one.

Quote
How does the arduino know the location of the disk with just one slot?
It doesn't know the position of the shaft it just knows how many rotations it has made to the nearest rotation, If you want to know how many to the nearest quarter turn then have four holes. Encoders like this are incremental, that is to say they only tell you about the movement of the shaft but then I think this is all you need for your project.

If you want to know the angle of your shaft then you need something like an absolute shaft encoder. These are very expensive if they are optical. Hoverer there is a cheap magnetic one:-
http://uk.farnell.com/austriamicrosystems/as5040-assu/encoder-magnetic-rotary-10bit-16ssop/dp/1630800
But I don't think you need that at all.
Logged

Pages: [1]   Go Up
Jump to: