Belt saturation detector/counter

This board is to show, discuss and archive useful combinator- and logic-creations.
Smart triggering, counters and sensors, useful circuitry, switching as an art :), computers.
Please provide if possible always a blueprint of your creation.
Binoculars
Long Handed Inserter
Long Handed Inserter
Posts: 79
Joined: Wed Dec 02, 2020 6:17 pm
Contact:

Belt saturation detector/counter

Post by Binoculars »

Hello factorian friends,

The text below will be translated from French to English on Google Translate.

I created a belt saturation detector. It can be connected to a simple detector or a somewhat special counter. The latter only activates if the belt is not saturated. in order to better understand what this can be used for, I suggest two tests. One with six spaced inserters that release twelve items at regular intervals and the other with six glued inserts that release four items at regular intervals.

It is possible to configure less inserters freeing twelve items. All you have to do is change the number within the counter. 32 for 2 inserters, 48 ​​for 3, 64 for 4, 80 for 5, 96 for 6 ...
12-12 or 4-4.jpg
12-12 or 4-4.jpg (591.83 KiB) Viewed 8770 times
Test n° 1


Test n°2


Belt saturation detector book :


This creation allows a good number of possibilities. For example, I use it to control the routing on part of a belt so that each of the two resources remains perfectly equal, even when the belt is full.
1-2.jpg
1-2.jpg (416.58 KiB) Viewed 8770 times

oyunbagimlisi
Fast Inserter
Fast Inserter
Posts: 182
Joined: Mon Aug 31, 2020 10:09 pm
Contact:

Re: Belt saturation detector/counter

Post by oyunbagimlisi »

I was so excited when I read the title, I've been looking for this for a long time. But as an intermediate (even novice) player, the system is too complicated for me.

15 for yellow belt; 30 for the red belt; Blue requires a system that controls 45 items.

I need this the most when I'm doing belt upgrades. because when I raise a whole line (belt stage), sometimes there are bottlenecks in the old low stage that the hand cannot reach. ie example; all red belt, but in one frame there is an overlooked yellow belt. This breaks the flow. I need a counter that will detect these blockages before I look for and find the blockage visually. For example, when x<30 from where 30 item/s should be, an alarm should sound... Is it possible to do this? Greetings, good game.
viewtopic.php?f=33&t=105093
Beacon domain & Cable access area coloring (Color Tone variations)

asheiduk
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Sat Dec 05, 2020 9:46 am
Contact:

Re: Belt saturation detector/counter

Post by asheiduk »

oyunbagimlisi wrote:
Sun Oct 24, 2021 11:28 am
I need this the most when I'm doing belt upgrades. because when I raise a whole line (belt stage), sometimes there are bottlenecks in the old low stage that the hand cannot reach. ie example; all red belt, but in one frame there is an overlooked yellow belt. This breaks the flow. I need a counter that will detect these blockages before I look for and find the blockage visually. For example, when x<30 from where 30 item/s should be, an alarm should sound... Is it possible to do this? Greetings, good game.
It would be very clumsy to insert such a device into many places just to measure full belts as you'd like to do.

But there is a much easier way for upgrading and checking belts: Use Debug Mode (F4 and F5) and enable "show-transport-line-gaps". This makes even small gaps visible. And a red or yellow belt after a blue belt WILL make gaps :-)

asheiduk
Long Handed Inserter
Long Handed Inserter
Posts: 73
Joined: Sat Dec 05, 2020 9:46 am
Contact:

Re: Belt saturation detector/counter

Post by asheiduk »

Binoculars wrote:
Mon Jul 05, 2021 8:32 pm
I created a belt saturation detector.
I would not call this nice thing a "saturation detector" but a "back pressure detector": It triggers when the sink of the belt does not keep up with consuming a full belt.

A "Saturation detector" would detect if a belt is not full (i.e. has gaps) which means that the source cannot fill a complete belt (assuming that the sink wants to consume a full belt).

That nitpick aside -- I was looking for a back pressure detector anyway -- so TNX :-]

Tertius
Filter Inserter
Filter Inserter
Posts: 900
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Belt saturation detector/counter

Post by Tertius »

asheiduk wrote:
Sun Oct 24, 2021 3:47 pm
A "Saturation detector" would detect if a belt is not full (i.e. has gaps) which means that the source cannot fill a complete belt (assuming that the sink wants to consume a full belt).
If you just want to see if a belt is saturated or not, you can use a simple line of lamps:
out.gif
out.gif (3.47 MiB) Viewed 8369 times


If you use the blueprint and see for yourself (sandbox mode with cheat mode recommended for the infinity chests), you will see the top line will flicker strongly, the mid line flickers with the top lamp only, and the bottom line is completely saturated.

It works by simply counting the number of items on a belt. 8 = full. If there is flicker, there are not always 8 items, so it's not saturated. Look into the on/off condition of the top lamp.
Screenshot 2021-10-24 175915.png
Screenshot 2021-10-24 175915.png (64.05 KiB) Viewed 8369 times

mrvn
Smart Inserter
Smart Inserter
Posts: 5795
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Belt saturation detector/counter

Post by mrvn »

asheiduk wrote:
Sun Oct 24, 2021 3:36 pm
oyunbagimlisi wrote:
Sun Oct 24, 2021 11:28 am
I need this the most when I'm doing belt upgrades. because when I raise a whole line (belt stage), sometimes there are bottlenecks in the old low stage that the hand cannot reach. ie example; all red belt, but in one frame there is an overlooked yellow belt. This breaks the flow. I need a counter that will detect these blockages before I look for and find the blockage visually. For example, when x<30 from where 30 item/s should be, an alarm should sound... Is it possible to do this? Greetings, good game.
It would be very clumsy to insert such a device into many places just to measure full belts as you'd like to do.

But there is a much easier way for upgrading and checking belts: Use Debug Mode (F4 and F5) and enable "show-transport-line-gaps". This makes even small gaps visible. And a red or yellow belt after a blue belt WILL make gaps :-)
You can just connect a speaker to a number of belts set to read content/hold and set the speaker to go of if the belts aren't compressed (enough). Try it with a full belt and a number of tiles to see how many items it should be and then set the speaker to go of if it's less.

Or set an upgrade planer to upgrade only yellow belt -> red belt. Then select everything where you should have 30 item/s. Any forgotten belt will show up as "going to upgrade: N yellow belts" at the bottom of the selection. If you release the mouse buttons it gets marked for upgrade with a yellow circle. Then bots will fix it or you have an extra indicator where the yellow belt is hidden. You have no construction network but a personal roboport? Just stand on the belt and when you go past the yellow belt the personal construction bots will fix it.

But usually a left over yellow belt is easy to spot. Everything before it is compressed. Everything after it is half full or less. So not quite seeing the problem spotting the yellow belt.

oyunbagimlisi
Fast Inserter
Fast Inserter
Posts: 182
Joined: Mon Aug 31, 2020 10:09 pm
Contact:

Re: Belt saturation detector/counter

Post by oyunbagimlisi »

asheiduk wrote:
Sun Oct 24, 2021 3:36 pm
oyunbagimlisi wrote:
Sun Oct 24, 2021 11:28 am
I need this the most when I'm doing belt upgrades. because when I raise a whole line (belt stage), sometimes there are bottlenecks in the old low stage that the hand cannot reach. ie example; all red belt, but in one frame there is an overlooked yellow belt. This breaks the flow. I need a counter that will detect these blockages before I look for and find the blockage visually. For example, when x<30 from where 30 item/s should be, an alarm should sound... Is it possible to do this? Greetings, good game.
It would be very clumsy to insert such a device into many places just to measure full belts as you'd like to do.

But there is a much easier way for upgrading and checking belts: Use Debug Mode (F4 and F5) and enable "show-transport-line-gaps". This makes even small gaps visible. And a red or yellow belt after a blue belt WILL make gaps :-)

Thanks a lot, it was a really simple solution. It's bad not to know English... :(
viewtopic.php?f=33&t=105093
Beacon domain & Cable access area coloring (Color Tone variations)

oyunbagimlisi
Fast Inserter
Fast Inserter
Posts: 182
Joined: Mon Aug 31, 2020 10:09 pm
Contact:

Re: Belt saturation detector/counter

Post by oyunbagimlisi »

Tertius wrote:
Sun Oct 24, 2021 4:15 pm
asheiduk wrote:
Sun Oct 24, 2021 3:47 pm
A "Saturation detector" would detect if a belt is not full (i.e. has gaps) which means that the source cannot fill a complete belt (assuming that the sink wants to consume a full belt).
If you just want to see if a belt is saturated or not, you can use a simple line of lamps:

out.gif



If you use the blueprint and see for yourself (sandbox mode with cheat mode recommended for the infinity chests), you will see the top line will flicker strongly, the mid line flickers with the top lamp only, and the bottom line is completely saturated.

It works by simply counting the number of items on a belt. 8 = full. If there is flicker, there are not always 8 items, so it's not saturated. Look into the on/off condition of the top lamp.

Screenshot 2021-10-24 175915.png

Man, you are such a wonderful person, thank you very much.

These 8 item/s caught my attention in my own efforts. But I guess I misinterpreted that there are 8 items in all (full) generations. (Oh my head..!) I also focused on numbers like 15/30/45 or multiples. Anyway...

--> I DON'T UNDERSTAND, why is there a pause in the second case (middle circuit)? just missing a belt of the same color? Logically, belt length should not affect it. What can't I see?
viewtopic.php?f=33&t=105093
Beacon domain & Cable access area coloring (Color Tone variations)

Tertius
Filter Inserter
Filter Inserter
Posts: 900
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Belt saturation detector/counter

Post by Tertius »

oyunbagimlisi wrote:
Sun Oct 24, 2021 11:15 pm
--> I DON'T UNDERSTAND, why is there a pause in the second case (middle circuit)? just missing a belt of the same color? Logically, belt length should not affect it. What can't I see?
This is an interesting thing. Perhaps a bug, but I didn't report it, because I'm quite certain such behavior was already reported long ago and dismissed as not important or even unable to fix.

All inserters put 12 items on the belt in a batch. Such a batch extend over 4 tiles. 2 on the 2nd half of it the 1st tile, 4 in the 1st splitter, 4 in the 2nd splitter and 2 on the tile that merge both lanes. It seems the shuffling within the 2 cascaded splitters sometimes stall 1 item for a tiny moment, so there is a gap created within the splitter, and in front of the splitter entrance the inserter is stalled for 1 item, and swings back for the next batch 1 or 2 ticks too late to catch up. This inserter stalling is the cause for the gap in the end - it's not the stalling within the inserters (this resolves later). The inserter swings not fast enough to make up the time lost while stalling.

In the bottom case it doesn't happen - in this case, I extended the initial belt part by 1 tile, so only 1 splitter is involved in handling the batch of 12 items from the inserter. And the glitch only happens if the 2 inserters in front of the same splitter are in sync, i. e. swing identically. To provoke this, switching off and on the constant combinator can be used. The glitch doesn't happen, if the inserters are not in sync, so it somehow only happens if the splitter has to shuffle the items at the exact same positions on the belt. You can make them swing independently by taking off pieces out of one lane but not from the other, and as if it was magic, the belt is suddenly fully compressed even for the second case. But it reverts to glitching as soon as the inserters stop and are restarted in sync.

mrvn
Smart Inserter
Smart Inserter
Posts: 5795
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Belt saturation detector/counter

Post by mrvn »

You can pair them and make one swing when the other reports 0 items in hand. They will alternate and stay that way.

oyunbagimlisi
Fast Inserter
Fast Inserter
Posts: 182
Joined: Mon Aug 31, 2020 10:09 pm
Contact:

Re: Belt saturation detector/counter

Post by oyunbagimlisi »

mrvn wrote:
Mon Oct 25, 2021 1:06 am
Onları eşleştirebilir ve diğeri elinizde 0 ürün rapor ettiğinde bir vuruş yapabilirsiniz. Değişecekler ve öyle kalacaklar.
I did not understand.

Why is there a small gap in the mechanism (middle) in case 2? Same as the 3rd one... after the bulk loaders there is 1 unit of belt instead of 2, does belt length affect loading speed?
viewtopic.php?f=33&t=105093
Beacon domain & Cable access area coloring (Color Tone variations)

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Belt saturation detector/counter

Post by disentius »

Inserter timing, belt buffers, and splitter buffers. all inserters leave gaps on the belt when swiniging to collect the next load. the combination of all these movements can lead to this kind of "glitches"

Here are the exact numbers for items moving on belts:
boskid wrote:
Sun Oct 17, 2021 9:36 am
I am not sure what is the question here, but i can give you some numbers.

- All transport lines use fixed point positions with a resolution of 1/256.
- Inner corner has length of 106/256, Outer corner has length of 295/256. Straight belt has length of 1. Splitter input line has length of 179/256 and splitter output line has length of 0.5. Splitters are tricky as part of the input length is a buffer (51/256).
- Distance between items is set to 64/256.
- Yellow belt has a speed of 8/256 per tick, Red belt has speed of 16/256 per tick, blue belt has speed of 24/256 per tick.

If you know the length to travel and belt speed you can compute the amount of ticks.

oyunbagimlisi
Fast Inserter
Fast Inserter
Posts: 182
Joined: Mon Aug 31, 2020 10:09 pm
Contact:

Re: Belt saturation detector/counter

Post by oyunbagimlisi »

Tertius wrote:
Mon Oct 25, 2021 12:45 am
oyunbagimlisi wrote:
Sun Oct 24, 2021 11:15 pm
--> I DON'T UNDERSTAND, why is there a pause in the second case (middle circuit)? just missing a belt of the same color? Logically, belt length should not affect it. What can't I see?
This is an interesting thing. Perhaps a bug, but I didn't report it, because I'm quite certain such behavior was already reported long ago and dismissed as not important or even unable to fix.

All inserters put 12 items on the belt in a batch. Such a batch extend over 4 tiles. 2 on the 2nd half of it the 1st tile, 4 in the 1st splitter, 4 in the 2nd splitter and 2 on the tile that merge both lanes. It seems the shuffling within the 2 cascaded splitters sometimes stall 1 item for a tiny moment, so there is a gap created within the splitter, and in front of the splitter entrance the inserter is stalled for 1 item, and swings back for the next batch 1 or 2 ticks too late to catch up. This inserter stalling is the cause for the gap in the end - it's not the stalling within the inserters (this resolves later). The inserter swings not fast enough to make up the time lost while stalling.

In the bottom case it doesn't happen - in this case, I extended the initial belt part by 1 tile, so only 1 splitter is involved in handling the batch of 12 items from the inserter. And the glitch only happens if the 2 inserters in front of the same splitter are in sync, i. e. swing identically. To provoke this, switching off and on the constant combinator can be used. The glitch doesn't happen, if the inserters are not in sync, so it somehow only happens if the splitter has to shuffle the items at the exact same positions on the belt. You can make them swing independently by taking off pieces out of one lane but not from the other, and as if it was magic, the belt is suddenly fully compressed even for the second case. But it reverts to glitching as soon as the inserters stop and are restarted in sync.

I just noticed this message. @merv I thought you replied directly to me. Thank you for your detailed explanations. But my brain stopped, "google translate" is not enough to understand. I think it's a very "sensitive/difficult" subject anyway. All I think is that while the train is unloading, combining the first tiles forward (not scattering) after 1 tile, with the same logic, should increase the efficiency, according to this logic. Anyway: factorio will drive me crazy!
viewtopic.php?f=33&t=105093
Beacon domain & Cable access area coloring (Color Tone variations)

mrvn
Smart Inserter
Smart Inserter
Posts: 5795
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Belt saturation detector/counter

Post by mrvn »

The solution is simple: don't require fully compressed belts. Don't put 48 electric furnaces on a blue belt. Use 47. The belt will back up and compress itself. Any tiny holes eliminate themself and no furnace runs dry. Every 47 furnace lanes you have to build one extra. But overall the number of furnaces remains the same. If you play with trains then every 47 smelters you build one extra to compensate for the shorter furnace lanes. That is not going to make a difference but makes the stations so much simpler by avoiding those hidden bugs.

oyunbagimlisi
Fast Inserter
Fast Inserter
Posts: 182
Joined: Mon Aug 31, 2020 10:09 pm
Contact:

Re: Belt saturation detector/counter

Post by oyunbagimlisi »

mrvn wrote:
Wed Oct 27, 2021 2:13 am
The solution is simple: don't require fully compressed belts. Don't put 48 electric furnaces on a blue belt. Use 47. The belt will back up and compress itself. Any tiny holes eliminate themself and no furnace runs dry. Every 47 furnace lanes you have to build one extra. But overall the number of furnaces remains the same. If you play with trains then every 47 smelters you build one extra to compensate for the shorter furnace lanes. That is not going to make a difference but makes the stations so much simpler by avoiding those hidden bugs.
in this case, ''max rate calc.'' etc. It is better not to establish the input=output (0=0) equality in mode calculations??? So I guess it's more accurate if the input value is positive?
viewtopic.php?f=33&t=105093
Beacon domain & Cable access area coloring (Color Tone variations)

Tertius
Filter Inserter
Filter Inserter
Posts: 900
Joined: Fri Mar 19, 2021 5:58 pm
Contact:

Re: Belt saturation detector/counter

Post by Tertius »

mrvn wrote:
Wed Oct 27, 2021 2:13 am
The solution is simple: don't require fully compressed belts.
I actually developed the above examples for train unloading. Not specific for furnaces, but for everything. However, my main issue with unloading stations are uneven unload between belt lanes, not saturation. One lanes stalls, the other lane runs fully, this common case makes the chests unload unevenly. I bet half of the early forum and reddit is full of threads with this topic, but I wanted to explore it myself - in the end, this is what the game is for: solving technical puzzles and challenges yourself.

You need to merge the output from 2 stack inserters to fill one one blue lane, and you need to merge 2 lanes to make one full blue belt.
So to make a blue belt full, you need 2 * 2 stack inserters.

To make unload even, you need to use a splitter and sideload from both sides.

This boils down to 3 obligatory operations and 1 constraint: a) merge lanes (to merge 2 single lanes), b) merge output of 2 inserters (to get enough items onto the belt), c) sideload (to make unload even). The constraint is that every lane and every inserter has to be handled 100% equal, which is not as easy as it sounds.
Most unloading stations I saw in videos and guides skip lane balancing and only do the merging. Unfortunately, this is also what all the balancers never do: they keep lane balance and do only belt balance. Some stations also don't handle every inserter input 100% equal, so chests unload unevenly even if the factory down the belt was able to consume evenly.

I discovered the operations are commutative.
You can first merge lanes, then sideload, then merge inserters, as in my 1st example. This works, but wastes space.

The smallest variant I found is the middle example. The 1st pair of splitters does inserter merging. With the splitters, it's smaller than using sideload from 2 sides and guarantees that both inserter lanes are handled 100% equal. It creates 2 saturated single belt lanes. The single inserter and sideloading belt performs lane balancing and lane merging at the same time. (up to this stage everything runs on the right lane and the left lanes stay empty).
The interesting thing was that the belt wasn't completely saturated. Lane and chest unload balance was perfect, but not saturation.
So I extended the input by 1 belt (bottom example) to be able to help me debug what is happening between inserters and splitters, but to my surprise the belt became saturated.

If I can make fully saturated belts with such a tiny modification, I will happily do this. On a common train unloading station, there is space. You can fit it in the common 8-tile gap you have between the rails on unloading stations. At least my unloading stations are spaced this way.

mrvn
Smart Inserter
Smart Inserter
Posts: 5795
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Belt saturation detector/counter

Post by mrvn »

I just attach wires to the chests and inserters and set them to unload until the chest has less than the average. That then easily creates gaps when the chests are unbalanced for whatever reason. But if you consume less than a full belt then the little gap here or there doesn't matter.

And you basically always have unbalanced chests. A train wagon full of goods isn't usually divisible by 72, 6 stack inserters with stack size 12 (or 144 for double sided unloading). So some chests get more items than others per train.

Note: if you merge the output from 6 stack inserters you also fill the belt better.
Note2: I balance across e.g. 6 wagons and 36 inserters. Nothing you want to balance with splitters.

oyunbagimlisi
Fast Inserter
Fast Inserter
Posts: 182
Joined: Mon Aug 31, 2020 10:09 pm
Contact:

Re: Belt saturation detector/counter

Post by oyunbagimlisi »

Image

For an experienced eye (observation), I did not find it necessary to write (translate) the question. What should I do?
viewtopic.php?f=33&t=105093
Beacon domain & Cable access area coloring (Color Tone variations)

User avatar
disentius
Filter Inserter
Filter Inserter
Posts: 694
Joined: Fri May 12, 2017 3:17 pm
Contact:

Re: Belt saturation detector/counter

Post by disentius »

@tertius: There are other solutions possible, this is one of them. equal unload and a lane balancer at the end.

Works with all belt types in vanilla.
2021-11-10 18_40_03-Window.png
2021-11-10 18_40_03-Window.png (1.23 MiB) Viewed 7662 times

mmmPI
Smart Inserter
Smart Inserter
Posts: 3569
Joined: Mon Jun 20, 2016 6:10 pm
Contact:

Re: Belt saturation detector/counter

Post by mmmPI »

oyunbagimlisi wrote:
Tue Nov 09, 2021 6:34 pm
For an experienced eye (observation), I did not find it necessary to write (translate) the question. What should I do?
Isn't that the question ?

I'm not sure there is a level of experience that allow one person to guess what another person has in mind. Maybe i just don't have it. Here's my attempt :
blueinbluesout.png
blueinbluesout.png (515.4 KiB) Viewed 7647 times


I'm not sure what you want to achieve, the presented setup consume the full blue belt of iron ore with minimum amount of furnace. Output is split equally onto 2 belts.

Now you can make it more complex to handle unbalanced consumption between the 2 lane of each belt by adding this :
1bluein15bluesout.png
1bluein15bluesout.png (866.79 KiB) Viewed 7647 times
It ouput 1/2 saturated blue belt, and the rest is equally balanced on the remaining lane of output. still consuming the full blue belt of iron ore.

But maybe what you want is 1 saturated blue belt, and the excess due to prod modules be outputed on a secondary blue belt and in this case it would be like this :
1blueout.png
1blueout.png (401.42 KiB) Viewed 7647 times

Post Reply

Return to “Combinator Creations”