Object Sorting via PLC

Thread Starter

ClimateController

Joined Dec 23, 2012
19
I am trying to do object sorting using PLCs as my final year project. It is a very simple design. Image processing isn't really a requirement. Just an approach I am comfortable with. Anyway, I would like you to please look at how the system works first and then I will explain what I am having trouble with and what I would like you to kindly help me with.


This is what it looks like:
- Our system uses the shape of incoming objects to identify whether they need to be on the conveyor belt or not.
- This is achieved using image processing techniques.
- The camera springs into action - it takes a picture - whenever the proximity sensor at the feed end is triggered.
- The camera processes the picture to see if it conforms to a known shape or pattern. It does the necessary image processing and saves the result in an array. This is all happening in real time. The array reads 1 if the object needs to be discarded. It reads 0 otherwise.
- There is another proximity sensor at the opposite end. It is used to see if the Separator Arm needs to be activated.
- The Separator Arm uses the array earlier to see what it needs to do; it is activated if the array reads 1 and it remains off when the array says 0.
- The Separator Arm is initialized at array index number 0 by default which means it will continue to use the result saved at array index number 0 until the proximity sensor is first activated. This is because the two proximity sensors are at opposite ends and there is a delay between a particular object being processed and it reaching the Separator Arm. So the Separator Arm cannot read the array in real time.

Here's the whole thing in code form. The basic algorithm.

int i = 0;
int j = 0;
int res, separator;
int x[100]; //assuming we are dealing with 100 objects.

while(1)
{

if(eventA == 1) //eventA is the proximity sensor at the feed end.
{
res = image_processing();
x[j] = res;
j = j + 1;
}
else
{
//do nothing.
}

if(eventB == 1) //eventB is the proximity sensor at the separator end.
{
separator = x;
activate_arm(separator);
i = i + 1;
}
else
{
//do nothing.
}
}

So it is apparent we need some sort of an object tracking mechanism. Obviously, the arm cannot discard objects willy-nilly. It needs to know what shape it is dealing with and how the camera responded to it. Is my approach good enough or do I use optical encoders? How would I do that exactly? I tried looking up how to use optical encoders in conjunction with PLCs but I could not really make sense of the results.

Looking forward to your replies. Thanks for all the help in advance. :)
 

MaxHeadRoom

Joined Jul 18, 2013
28,576
Not sure I understand completely, it seems simple enough, if the defective object is recorded in an array, surely then it should be easy to determine when the particular item reaches the separator to eject etc.
There should be ample time from detection to ejection?
This is a very common arrangement on many assembly/inspection lines.
Max.
 
Top