question

Will R avatar image
0 Likes"
Will R asked Felix Möhlmann commented

Merge Controller and Photo Eye Override

Hi!


I am trying to create a merge controller with standard logic, with one exception. When there is only volume flowing down one entry lane to the sawtooth lane, I want to avoid the slug building requirements and pass through volume, but when there is volume flowing down two (by triggering two photo eyes at two merges to be considered blocked (0.5 second block time)), I want the regular slug building logic to occur. I've attached a simple model which has a floating merge controller with my attempted code as comparison.


MergeControllerTest.fsm


Thanks!

FlexSim 22.1.2
photo eyemerge controller
5 |100000

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

1 Answer

Felix Möhlmann avatar image
1 Like"
Felix Möhlmann answered Felix Möhlmann commented

The logic of whether or not slug is built is connected to the respective conveyors. As far as I know the merge controller only reacts to a slug becoming ready or clearing a lane or the merge conveyor.

As such, my approach is to set the slug builder options of the conveyors depending on the state of the other photo eyes. This happens in their 'On Cover' trigger.

If all other photo eyes are free, the current one sets its conveyor's slug to be considered ready at a fill percent of 1 (so after a single item). The other conveyors are set to built slugs according to the quantity and time settings. So they will stop the first item that arrives while another conveyor is set to 'pass through' all items.

If any of the photo eyes is blocked, the triggered photo eye will then also set its conveyor to build according to quantity and time.

As a result, a single lane will allow all items to immediately pass until items arrive at the end of another lane. Then they all operate in 'slug' mode, until once again, only a single photo eye is blocked, which will cause it to go into 'pass though' mode.

(I modified the sources to demonstrate the behaviour more clearly)

mergecontrollertest_fm.fsm

Edit: The reset trigger on the lane conveyors resets their initial behaviour to 'pass-through'


· 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.

Will R avatar image Will R commented ·

This worked great for my situation, thank you! For those of you out there using this thread, what I realized in the responder's code is that the:

conveyor.setVariable("isSlugReadyByFillPercent", 1);

conveyor.setVariable("isSlugReadyByTime", 0);

conveyor.setVariable("isSlugReadyByItemCount", 0);

That these are toggle on/off, not setting the parameter themselves to 0 or 1 for example.


Out of curiosity, is there a way to manipulate what the value is of those parameters?


0 Likes 0 ·
Felix Möhlmann avatar image Felix Möhlmann Will R commented ·

Yes, you can look up the name of the variable nodes in the conveyors tree. Most should be pretty self-explanatory. The ones for the values of the slug release conditions are 'slugFillPercent', 'slugReadyTime' and 'slugItemCount'.

1654875352926.png

1 Like 1 ·
1654875352926.png (3.8 KiB)