How to Use a Rotary Encoder with an MCU

Thread Starter

@vajra

Joined May 2, 2018
154
I have gone with this link https://accautomation.ca/plc-programming-example-shift-register-conveyor-reject/. I'm not familiar with PLC. I have knowledge of microcontroller. I want to interface Rotary Encoder with 8051

I did google for a rotary encoder, An encoder can be used to determine position, count, speed, or direction

Looking the information for the encoder in given link

https://www.ebay.com/p/Domino-14828-Rotary-Shaft-Encoder-5000ppr-W-Marker-Pulse/1806191069

Is this encoder able to reject the big product on a conveyor with variable speed
 

JSCV

Joined Oct 3, 2015
23
Depending on the rotatianal speed, you can calculate how many pulses per second you need to process.
In case of quadrature decoding for which you can use graycode encoding.
With this you can calculate if you are able to do this in a microcontroller or if its better to offhand this to a specialized IC connected to a microcontroller.
 

MaxHeadRoom

Joined Jul 18, 2013
30,562
5000p/rev is an extremely high resolution, particularly if using x2 or x4 resolution.
Is this really needed for this application, it also places a high reading capability on the processing device, especially where an kind of relatively high rpm is used.
Do you need accurate positioning for a conveyor or is positioning even needed?
Some Picmicro's have a quadrature encoder module.
Max.
 

Sensacell

Joined Jun 19, 2012
3,769
[QUOTE="MaxHeadRoom,
Some Picmicro's have a quadrature encoder module.
Max.[/QUOTE]

Which make the task easy compared to other approaches!
 

Thread Starter

@vajra

Joined May 2, 2018
154
5000p/rev is an extremely high resolution, particularly if using x2 or x4 resolution.
Is this really needed for this application, it also places a high reading capability on the processing device, especially where an kind of relatively high rpm is used.
Do you need accurate positioning for a conveyor or is positioning even needed?
Some Picmicro's have a quadrature encoder module.
Max.
I have only one choice to use encoder mention in a link

Have you looked at the encoder mentioned in given link?

Can we interface that encoder to any microcontroller such as PIC ATMEL?
 

Thread Starter

@vajra

Joined May 2, 2018
154
5000p/rev is an extremely high resolution, particularly if using x2 or x4 resolution.
Is this really needed for this application, it also places a high reading capability on the processing device, especially where an kind of relatively high rpm is used.
Do you need accurate positioning for a conveyor or is positioning even needed?
Some Picmicro's have a quadrature encoder module.
Max.
Yes, I need accurate positioning for a conveyor. I'm totally confused about an encoder. I don't understand how it will help to reject product on the conveyor

Encoder can be used to determine position, count, speed, or direction

I don't understand what's the logic of counting pulse to reject product on the conveyer belt?
 

LesJones

Joined Jan 8, 2017
4,511
The logic of the system is simple. You sense the object as point A (This may be a photo sensor or maybe a TV camera with image recognition) Further down the conveyer (A known distance.) there is an air jet controled by a solenoid valve. The encoder will give a known number of counts per cm of movement of the belt. (Lets say for example 10 counts per cm. This will depend on the size of the roller in contact with the belt that drives the encoder.) If the air jet is 50 cm from the sensing point then it will reach the air jet when 500 counts have occured. So the controller just has to count 500 counts after the sensor senses the object and then trigger the air jet.
What is the background to the question. Are you just trying to create the EXACT system in the link for some reason or are you building the system for a specific purpose in a factory. Also why do you need to use this specific encoder. People can give you more help if you tell them exaclly what you are trying to do.

Les
 

Thread Starter

@vajra

Joined May 2, 2018
154
The logic of the system is simple. You sense the object as point A (This may be a photo sensor or maybe a TV camera with image recognition) Further down the conveyer (A known distance.) there is an air jet controled by a solenoid valve. The encoder will give a known number of counts per cm of movement of the belt. (Lets say for example 10 counts per cm. This will depend on the size of the roller in contact with the belt that drives the encoder.) If the air jet is 50 cm from the sensing point then it will reach the air jet when 500 counts have occured. So the controller just has to count 500 counts after the sensor senses the object and then trigger the air jet.
Many many thanks Les

What is the background to the question. Are you just trying to create the EXACT system in the link for some reason or are you building the system for a specific purpose in a factory. Also why do you need to use this specific encoder. People can give you more help if you tell them exaclly what you are trying to do.

Les
I'm a student of electronics, My uncle told me about this project He said, Can you make something like the given in link But I have to use a particular part for the project like the encoder mentioned

My big doubt, Can we interface that encoder with PIC or Any MCU?

If I make this system I can earn some money.
 
Last edited:

LesJones

Joined Jan 8, 2017
4,511
Weather any particular microcontaller is capable of reading the output of that encoder will depend on how many RPM it is being rotated at. (Max has allready told you this in post #5) You seem to be starting from the wrong place. You need to calculate how many pulses you need to count between the sensor and the air jet. You will need the following information to calculate this. 1 - The size of the object. 2 The speed of the conveyer. 3 -The diameter of the roller driving the encoder. I would aim for about 5 counts for the object to pass a point. I think that should be enough to make sure that you don't miss it. I suspect you will not need a 5000 line encoder. Encoders with a few hundred lines will be much cheaper so you get the same resolution by driving it with a smaller roller.

Les.
 
Last edited:

Thread Starter

@vajra

Joined May 2, 2018
154
Weather any particular microcontaller is capable of reaging the output of that encoder will depend on how many RPM it is being rotated at. (Max has allready told you this in post #5) You seem to be starting from the wrong place. You need to calculate how many pulses you need to count between the sensor and the air jet. You will need the following information to calculate this. 1 - The size of the object. 2 The speed of the conveyer. 3 -The diameter of the roller driving the encoder. I would aim for about 5 counts for the object to pass a point. I think that should be enough to make sure that you don't miss it. I suspect you will not need a 5000 line encoder. Encoders with a few hundred lines will be much cheaper so you get the same resolution by driving it with a smaller roller.

Les.
Many thanks Les

I'm just at the starting stage, reading useful information on the internet

so we can say encoder is used to reject product at any place by counting the pulses

if the speed of the conveyer belt is variable then is it possible to reject the product?
 

MaxHeadRoom

Joined Jul 18, 2013
30,562
Yes, I need accurate positioning for a conveyor. I'm totally confused about an encoder. I don't understand how it will help to reject product on the conveyor
Encoder can be used to determine position, count, speed, or direction
I don't understand what's the logic of counting pulse to reject product on the conveyer belt?
You may need accurate positioning of the conveyor, but 5000p/rev is Way overkill for this application, and also places a very high demand on the reading frequency of system.
You must have a way of operating the reject mechanism and for this the position has to be known.
So although using an encoder is possible, most industrial conveyors of this type such as ones I am used to installing and maintaining use a simple L.S. for conveyor position at the reject station position.
One of these was soft drink or beer bottling plants and these used conveyor reject stations and were based around simple L.S. positioning.
If insisting on a encoder, I can see an encoder on the conveyor drive itself and no more than 500 count encoder should be needed, especially as many controllers can read x2 or x4 of the basic resolution.
Max.
 

Thread Starter

@vajra

Joined May 2, 2018
154
Like the others have said if you really need high resolution encoder counts for tracking over distances then a controller with a dedicated QEI modules is the best way to go.
I agree with all members. There are many suitable encoders available in market but the client requires that only.

That's a reason I'm asking continuously. Is it possible to interface that encoder with PIC or Any MCU?

If it's not possible then I have to leave this project
 

ericgibbs

Joined Jan 29, 2010
21,394
hi v,
It would help if you could explain what you are trying to do with this project in more detail.
You say:
Is this encoder able to reject the big product on a conveyor with variable speed.

Query:
What are the objects, how big, how many and the speed of the passing 'products'.??

E
 

MaxHeadRoom

Joined Jul 18, 2013
30,562
I agree with all members. There are many suitable encoders available in market but the client requires that only.

Is it possible to interface that encoder with PIC or Any MCU?
If it's not possible then I have to leave this project
"but the client requires that only."

What reason does the client give for requiring this?
Is he involved in the design process?
If forced to use it, you could look at the PIC2331/4431 that has a QEI module, there are other PIC's that include one also. As post #14 etc.
Max.
 
Top