OSR, me, and my photoeyes

Addohm

Member
Join Date
Apr 2012
Location
Little Rock, AR
Posts
27
Okay, so I have to admit something.. I never use OSR's, OSF's, or ONS's. Simply because the logic in using them eludes me. In my current small but extremely useful project, I am sure that a OSR could serve to fix my current dilema. Keep in mind this project is put together with spare parts. It wasn't done with the luxury of fast L/D and built in timer photo eyes. These are just basic retro-reflective photo eyes.

---PE1 [/]--------------------------TON1----

---PE2 [/]--------------------------TON2----

---TON1 [ ] ---TON2 [/]------------TON3----
----------------------------------|--------|
---------------------------TON3 [DN]--(OTL1)-

---OTL1 [ ]------------------------TON4----
----------------------------------|--------|
-----------------------------------TON5----

---TON4 [ ]---TON5 [/]-------------(OTE)---

---TON4 [DN]---TON5 [DN]---------(OTU1)---


I tried real hard :) If I have to screen shot it I will. At any rate, this is a part kick-off. If the bottom PE is made but the top PE isn't, it extends the cylinder.

The problem is the trailing edge of the part is not the same as the leading edge of the part, creating problems with my program.

Any suggestions?
 
Not completely sure of your problem but my first thought is if Time delay PE can fix your problem then the PLC Can.
Just Add Blocked and Clear Timers.

PE Timers.jpg
 
Ok, So if you set The Blocked Timer to 1/100 of a sec it will be done on leading edge. Then Set The Clear Timer to Time Value That the PE needs To Be Clear before you Decide you are done.

Not sure what L- >D PE Does. Please define.
 
What is it you are trying to "remember"?

I see some logic with 5 timers, but I don't know what your goals are in real world terms.

It looks like you are trying to latch a fault bit when PE1 is blocked and PE2 is not with TON3 allowing for tolerance, is this a fault detection type of thing? Or, is it just a timed sequence?




Describe what you are doing please.
 
At any rate, this is a part kick-off. If the bottom PE is made but the top PE isn't, it extends the cylinder. . .The problem is the trailing edge of the part is not the same as the leading edge of the part, creating problems with my program.
Apparently you tried to detect the TRAILING edge, but would rather use the LEADING edge. The program attached runs on LogixPro to detect the TRAILING edge. Adjust the timers as needed for time between detection and kick, and the time needed to extend the cylinder. This all assumes that your kick can be done before the next part arrrives. If not, then you have to set up some type of part tracking or bit shift to track each part from detection to the kick cylinder.

PS: If you had rather detect the LEADING edge, switch Rung 000 PE1 to a XIC and PE2 to a XIO. I may have AssUMed the wrong set-up. If you could draw a sketch (side view) of your PEs and kicker, that might be more useful to determine what logic you really need.

Addohm's Cylinder Extend Problem.JPG
 
Last edited:
Here is the logic I've already been using. It works great for the leading edge detection. I need it to ignore the trailing edge detection.

kologic.png


The timer presets are preset based on some math done against current drive frequency of the conveyor, so that if the conveyor speed gets changed by an operator, the KO will speed up and trigger earlier with it.

CWAL61: If I can avoid doing it that way, I am going to. Part size\contour\shape varies, as does conveyor belt speed, and I would have to change those numbers for each parts and\or incorporate more logic for adjusting it based on conveyor speed and part type.
 
Last edited:
Picture of the two KO's using this logic. Ignore the cylinder KO, that's going to be changed to an air burst.

Resized for Lancie's 1024x768 view :)



 
Last edited:
The timer presets are preset based on some math done against current drive frequency of the conveyor, so that if the conveyor speed gets changed by an operator, the KO will speed up and trigger earlier with it.
That, and the first two debounce timers, sort of explains why you have 5 timers instead of 2. It seems that T4:41 and T4:51 could be combined into one timer.

If you are looking for leading edge detection, do you really need the debounce timers T4:45 and T4:46? It seems that if a photoswitch output goes on at all, it is probably going to stay on at least .02 seconds. Are these timer presets also changed depending on speed?
 
Last edited:
That, and the first two debounce timers, sort of explains why you have 5 timers instead of 2. It seems that T4:41 and T4:51 could be combined into one timer.

If you are looking for leading edge detection, do you really need the debounce timers T4:45 and T4:46? It seems that if a photoswitch output goes on at all, it is probably going to stay on at least .02 seconds. Are these timer presets also changed depending on speed?


Those timers are there because the bracket that the PE's were initially mounted on was flimsy and I was trying to find a way to deal with the PE's not being made at exactly the same time.
 
I was trying to find a way to deal with the PE's not being made at exactly the same time.
Effectively, your Rung 016 is only going to look at the status of I:4/14, the bottom PE. The other PE could be on or off, it would not matter and you would get the same result if you removed Rung 015. If you want to always consider the status of BOTH PEs within some time period, that will need something different. If PE2 trails PE1, then it seems to consider BOTH, you might need 1 timer wired like this (using ony T4:45 to trigger your Knock-Off Latch):
 
| BOTTOM PE +-----------+ |
|---+---|/|--------------+----| TON T4:45 |----|
| | | | | |
| | TOP PE T4:45/TT | | | |
| +---|/|----| |-------+ +-----------+ |

 
Last edited:
Maybe something like this. This Logic requires kickoff to be done and Reset before next part detection.

Bad Detect.jpg
 
Looking at Addohm's Photoeyw pictures, there really is no deliberate leading or trailing PE. Both appear to be vertically in-line. Maybe what you need is to look for either Normally Closed PE within some time window, then see if BOTH go on for some minimum time during that time window. Whichever PE is slightly ahead starts the time window, then you look to see if both go on sometime during that window. If so, latch your Knock-Off relay. Maybe something like this would work:

Addohm's Knock-Off Latch.JPG
 
Last edited:
I think Lancies last example most concisely accounts for the photo proof and overlap, but you need to stick another timer in there to account for the physical offset distance (calculated from speed command or feedback) to the blow off nozzle.

Actually, just insert his code in front of your rung 17.

I normally have debounce timers set up to phase shift a signal for debounce of false inputs (set to zero for a latch) and then a delay off time to trigger the first action in the program, then cascade a second timer from the done bit of the first. As your rung 17 is written, both timers start together, so the duration of the output actually being turned on is the difference between the two. I would cascade the timers, start the succeeding timer with the DN bit from the preceding, and seal aroudn that DN bit with the TT bit for itself to ensure it times fully (for things like contactors and solenoid valves, you want a guaranteed minimum firing time). By doing so, you can adjust the delay without affecting the duration and vice versa.
 
Last edited:

Similar Topics

Hi all. Simple as simple can be, I don't understand what's happening. I'm toggling he OSR on, GX_LUB_PUMP1_LEAD should switch. It doesn't. The...
Replies
27
Views
621
Just wondering if i can make my code look a little nicer and sharing storage bits like below https://imgur.com/a/SMNxOPu does this work or does...
Replies
9
Views
1,575
Hello, I am having an issue with an OSR bit starting a rotary indexer. Running AB studio5000 on a 5069 L320ER v32.1 I have 13 inputs before an...
Replies
9
Views
2,364
We have a vendor that loves ONS logic. It does ok as long as things run as expected. Well we all no nothing runs as expected for very long. If the...
Replies
3
Views
1,335
I'm looking at an offline copy of a program that has these two rungs, in this order (see attachment). B3:16/3 is a OSR in the first rung and an...
Replies
9
Views
2,386
Back
Top Bottom