question

Aditya S2 avatar image
0 Likes"
Aditya S2 asked Eric M commented

Merge control based on photoeye status

Hi,

Is it possible to control merge logic using a photoeye? I've attached a sample model, where if the photoeye is blcoked I want the merge to priority release and stop all other slugs while at it. Once the photoeye is clear, the merge should work as regular. Can you help with this?

merge_with_photoeye.fsm

FlexSim 21.1.1
photo eyemerge controller
· 1
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Eric M avatar image Eric M commented ·

Hi @Aditya S2, was my answer helpful? If so, please click the red "Accept" button at the bottom of the answer. Or if you still have questions, add a comment and we'll continue the conversation.

If we haven't heard back from you within 3 business days we'll auto-accept an answer, but you can always unaccept and comment back to reopen your question.

0 Likes 0 ·

1 Answer

Eric M avatar image
0 Likes"
Eric M answered Eric M commented

Hi @Aditya S2, I added some code to the Release Strategy that seems to do the trick (see image below). Each time the code loops, it will first check if the photo eye is blocked and that the lane is clear for it to release. If those conditions are met, it will release the slug.

1625840764024.png

I also changed the photo eye's Block Time in its properties to 2 (meaning it must be covered for 2 seconds to enter its blocked state. This is a value you can play around with to see what best fits your needs.

merge-with-photoeye_1.fsm


· 2
5 |100000

Up to 12 attachments (including images) can be used with a maximum of 23.8 MiB each and 47.7 MiB total.

Aditya S2 avatar image Aditya S2 commented ·

Great. It seems to be working with the specific photo eye position in the file. If I move the photo eye further upstream (new model attached below), it gives me an error:

"time: 49.184097 exception: FlexScript exception: MODEL:/MergeController48>variables/strategyTrigger".

To Clarify, I'm trying to work the merge logic in way where it will always prioritize releasing the slug (on which the photo eye is on on the upstream) that will clear the photo eye, in case of backup. So the slug on the top should always try to release first and other slugs can be stopped if needed, to maintain the photoeye as "clear" state.

Anything I am missing to add in the code?

photoeye position change.fsm

0 Likes 0 ·
Eric M avatar image Eric M Aditya S2 commented ·

The error is happening because the logic is trying to release a slug from the top lane when there aren't any items that have accumulated in the slug yet. This is happening for two reasons that I can see. The first, is that the block time of the photoeye is set to 0s which means any time any item passes it will register as blocked. If the merge controller is trying to send a slug at the time an item passes the photoeye, it will register as blocked and try to send the top lane (even if there are no items in the slug). Even increasing this time to 1s will ensure that the photoeye is only blocked when items are backed up.

The second problem is the bottle neck that occurs at the first turn. The speed of the curved conveyor is 1 ft/s while the feeding conveyor is 10.67 ft/s. This is causing the photoeye to be blocked even if there are no items at the slug. Fixing those two things seems to solve the problem.

photoeye-position-change_1.fsm

0 Likes 0 ·