PLC Based Object Sorting

Join Date
Nov 2014
Location
Lahore
Posts
12
I am trying to make an object sorting system using PLCs for university. The system uses the shape of incoming objects to figure out if they need to be on the conveyor belt. It's very simple. We are just looking for one shape: a circle. All other shapes are to be discarded. I am gonna be using a simple spring-loaded diverter at the other end to get rid of "bad" objects.

I am using a camera + an FPGA DSP kit to do the image processing. The camera takes a picture every time the proximity sensor at the feed end is triggered, it does the appropriate image processing and saves the result in an array. The array reads 1 if the object is "bad". It reads 0 otherwise. The array is updated in real time. The PLC is supposed to read this array to perform object sorting but it cannot happen in real time because there is a distance between the feed end and the diverter.

So I am wondering if I should use an optical encoder to keep track of objects and basically figure out when to activate the diverter?

Is this how I should go about it? Suppose it takes 20 pulses for an object to reach the diverter. Do I get the PLC to read the array earlier at every 20th pulse?

- I start a counter based on the optical encoder's pulses every time the proximity sensor is triggered.
- It counts up to 20 pulses and then it reads the array.
- So if an object is "bad" the diverter can remove it.
- The PLC starts right at the top of the array for the first object and it keeps progressing down the array for subsequent objects. It does this at every 20th pulse.

Will this work? I already have the image processing algorithm/code etc. figured out. Just need an object tracking mechanism.

Please help. Thanks in advance. :)
 
Bump. It's just a very simple deal at the moment. It assumes that the conveyor belt will not be tampered with and the power is never going to go out. I just want the system to start working. I will make adjustments as I go.
 
You did not mention the plc type. But you want to create a Shift Register not a counter. To create a shift register you can Multiply a DINT by 2 and store the results in the same DINT. Then look at the DINT in its Binary Format. If you set bit 0 of the DINT the value of that DINT = 1.
in Binary 10000000000..... multiply by 2 the DINT = 2
in binary 01000000000..... multiply by 2 the DINT = 4
in binary 00100000000..... you get the idea.
So use your pulse to one shot the multiplication and your reject status to set bit 0. Then when bit DINT.20 is true you reject. The only other thing you will need to do is reset next bit after the reject station. This will limit the Shift Register to that length and keep you DINT Values correct.
So every pulse Multiply and reset the end bit. This method will also work tracking multiple rejects. If value of DINT = 4 and you set bit 0 then DINT = 5
in binary 10100000000..... multiply by 2 the DINT = 10
in binary 01010000000.....

P.S. Welcome to the Forum and good luck with your project.
 
Last edited:
Thanks, cwal. My ultimate goal is to implement the system on the Simatic S7-300.

I see how you're using a DINT to create a shift register.

So something like this then?


- I calculate how many pulses of the optical encoder are needed for an object at the feed end to reach the diverter at the other end.
- I set the size of my shift register accordingly.
- I use a proximity sensor to get my camera to take pictures and do the necessary image processing.
- I save the result of the processing - a 1 if the object is bad and a 0 if the object is good - in the shift register.
- I use the pulses of the optical encoder to shift the bits in the shift register.
- And finally, I use the output of the shift register to control the diverter.

96xe5E
 
Last edited:
yes. just make sure to one shot your results and pulse. you only want them to be true for 1 scan cycle. The PLC will multiply every scan while true and 1's will be flying thru the Shift Register.
 
I have another question. I have been using the camera head that came with the DSP kit for image processing but my professor expects me to use a proper "machine vision" camera in the final version. I understand there are two options available based on resolution and sensitivity - CMOS or CCD cameras. Which one should I go for and could you please point me to a model you personally have experience with?
 
These industrial cameras are available from many suppliers. At various costs.
In most cases a camera system is price based.
One range to look at is Omron. There is also Cognix. And others.
There are a few that can talk to Siemens by Profibus.
I am confused with the need for an encoder.
How many diverters? You usually pulse the shift register as each part good or bad goes past. The. When the bad part is known to be at the diverter it functions.
 
You can use a timing pulse to trigger the shift register but an encoder is a more robust approach. Time based pulses can be affected by the scan time of the PLC. Encoder tracking does not have these issues.
 
Your right - I don't use timed pulses.
But a pulse from the conveyor or an encoder.
One pulse being cheaper
This is always project and cost dependent
 

Similar Topics

I am trying to use tag based alarms in Studio 5000. It seems really great at making alarms automatic. I have a few alarms that require...
Replies
0
Views
1,062
I got a problem concerning the change of coins from a vending machine plc based, i use the rs logic starter lite with Rs emulate 500 along with...
Replies
5
Views
2,082
Dear Members, I am new to S5 series PLC, In one of my application, I need to communicate S5 6ES5942-7UA12/ or S5 6ES5941-7UA12 PLC with HMI(PC...
Replies
6
Views
2,188
How can I get a rough estimate of how much memory I will need for a controller if the code is not written yet, but I know how much I/O it will be...
Replies
10
Views
3,387
Greeting, I am doing some investigations on which driver(s) support tag based addressing (eg. Pump001_Running) rather than DB or Modbus based...
Replies
4
Views
3,744
Back
Top Bottom