Unload 2 solid blue belts /wagon, balanced, compact, simple

Smart setups of railway stations, intelligent routing, solutions to complex train-routing problems.
Please provide - only if it makes sense of course - a blueprint of your creation.
teenkertoy
Inserter
Inserter
Posts: 37
Joined: Fri Nov 11, 2016 5:03 am
Contact:

Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by teenkertoy »

Sorry about the mess below. Here is the original content.
the blueprint
So think of the left and right sides of the two belts as four different zones, each fed by three inserters. Each set of three inserters has one combinator. Each inserter along with the associated chest it is pulling from and the single piece of belt it is depositing onto I will call a "lane".

Now the super popular method is taking the contents of all the chests and dividing by the number of chests to get an average amount of ore per chest, then enabling each inserter only if the chest it is pulling from has more in it than the average value. But because the way upstream inserters get priority when depositing ore onto a belt, some inserters empty slower than others and one will always empty the slowest, making the other 11 inserters halt for a bit while the slow inserter catches up, but it never really does.

In my setup, I use the same concept but I chopped it into four zones as mentioned earlier (left and right sides of two blue belts). Also, now I'm comparing the average value of ore in the 3-chest zone with the entire "lane" of each inserter, I mean amount of ore not just remaining in the chest that the inserter is pulling from, but the amount of ore remaining in the chest, *and* in the inserter's hand, *and* on the piece of belt it is depositing onto. This means the other inserters will trigger on as the slowest "lane" starts to deplete when the slowest inserter starts to drop items onto the belt and move out into the rest of the system, and not *only* when the slowest inserter picks up a load from the chest which is the problem with the popular method.

My first version of this, which is no longer posted here, worked great but did not unload evenly when there was any back pressure in the belts. This newer method works assuming one small thing: the two belts are balanced well so that the left and right sides of both belts are used equally. If that is not the case, then the four zones in my unloading solution will get out of balance with eachother over time.

I'm not sure how to keep the elegance and reliability while also keeping my four zones from running ahead of one another.
factorio-train-unloading.jpg
factorio-train-unloading.jpg (147.49 KiB) Viewed 12723 times
GIF42.gif
GIF42.gif (6.88 MiB) Viewed 12719 times
Last edited by teenkertoy on Mon Jul 03, 2017 3:28 am, edited 9 times in total.

teenkertoy
Inserter
Inserter
Posts: 37
Joined: Fri Nov 11, 2016 5:03 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by teenkertoy »

I may have spoken too soon.

This setup (the old setup) works great if the belt is allowed to flow without any back pressure. If the belt slows down, then this doesn't work as intended. I'll keep working at it though.

edit: the new version is now in the first post
Last edited by teenkertoy on Sun Jul 02, 2017 4:56 am, edited 2 times in total.

SQLek
Inserter
Inserter
Posts: 45
Joined: Tue Jun 28, 2016 10:23 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by SQLek »

Maybe using average?
  • Get total number of item in station
  • Divide by negate number of chests
  • Enable inserter if own chest bigger or equal average
  • Four red belts of profit
Two car example
Two car example
Screenshot_20170610_144402.png (2.28 MiB) Viewed 13535 times
Blueprint

zerohourrct
Inserter
Inserter
Posts: 28
Joined: Sun Apr 10, 2016 2:57 pm
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by zerohourrct »

You're on the right track having the inserters cycle, but using their hand capacity and fighting upstream priority is unreliable. You would want them to pulse hand contents, turn that pulse into a 1, and add it to a memory combinator to count 0,1,2. Enable inserter only when its number is called, starting inside to outside like you have done. This way whenever an inserter grabs a fresh handful, it will allow the next inserter to do so, but will also wait its turn if the hand is not empty. I will try to wire this up right now :D.

zerohourrct
Inserter
Inserter
Posts: 28
Joined: Sun Apr 10, 2016 2:57 pm
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by zerohourrct »

Well the cycling is going well, but there's always a swing delay hangup on the low-priority inserter. I think the chest averaging method may work just as well.

zerohourrct
Inserter
Inserter
Posts: 28
Joined: Sun Apr 10, 2016 2:57 pm
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by zerohourrct »

So there are two problems here; having enough belt-space downstream of the inserter to allow a full unload without conflicting with other inserters (and then belt merging to get your desired output belts), and that of sequencing inserters when backpressure occurs to get a balanced unload.

You have elegantly solved problem #1 by using timing the inserters perfectly to coincide with swing-time gap, but not the real problem which is #2. Hopefully I can find a way to solve both problems :P

The way I used to balance inserters was by using the chest average method, but that uses more wire then the second method using an incremental combinator.

teenkertoy
Inserter
Inserter
Posts: 37
Joined: Fri Nov 11, 2016 5:03 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by teenkertoy »

I think I solved it. I edited my first post to show the new version.

Xtrafresh
Fast Inserter
Fast Inserter
Posts: 103
Joined: Mon Jun 12, 2017 4:57 pm
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by Xtrafresh »

Super nice designs! I'll come back soon™ with my own take on it. This wouldn't be factorio if some smartass didn't have things to improve ;)

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by aaargha »

I think you should probably include an input balancer as if you're only pulling from the left lanes only half of the boxes will be unloaded. Alternatively that could be left as an exercise for the reader.

User avatar
Odhrean
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Mon Sep 15, 2014 7:49 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by Odhrean »

Question Off-Topic: How do you create the nice animated gif out of factorio?

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by impetus maximus »

Odhrean wrote:Question Off-Topic: How do you create the nice animated gif out of factorio?
a better question is why are you still using GIF? don't bother learning GIF making. learn how to webm.

teenkertoy
Inserter
Inserter
Posts: 37
Joined: Fri Nov 11, 2016 5:03 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by teenkertoy »

I made that one using GifCam. I also used one of the time-control mods to play the game at 15fps (half-speed) so the gif would be easier to see and also smaller in size.

Of if you want to be pretentious, you can look into webm.

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by aaargha »

teenkertoy wrote:Of if you want to be pretentious, you can look into webm.
That's a strange way of spelling "being considerate to users on mobile/data caps". The two GIFs you have posted use more than 80% of the bandwidth of the whole page.

User avatar
Odhrean
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Mon Sep 15, 2014 7:49 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by Odhrean »

impetus maximus wrote:
Odhrean wrote:Question Off-Topic: How do you create the nice animated gif out of factorio?
a better question is why are you still using GIF? don't bother learning GIF making. learn how to webm.
Thank you. I learned about webm and found a Tool for recording webm Videos: https://github.com/TheTarkus/WebMCam/releases
This is a test:
test.gif
test.gif (705.21 KiB) Viewed 12891 times
I tried to upload a .webm File but that was not animated here, just a normal download. The webm bbcode did not help.

Sorry for using this thread for this... :?

teenkertoy
Inserter
Inserter
Posts: 37
Joined: Fri Nov 11, 2016 5:03 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by teenkertoy »

aaargha wrote:
teenkertoy wrote:Of if you want to be pretentious, you can look into webm.
That's a strange way of spelling "being considerate to users on mobile/data caps". The two GIFs you have posted use more than 80% of the bandwidth of the whole page.
My apologies for using all of your limited data allowance. I have adjusted my post to be easier on your budget.

In the meantime, you might reconsider your criticism since the first post of your own thread linked in your signature contains about 50mb worth of images.
viewtopic.php?f=194&t=46855

User avatar
Odhrean
Long Handed Inserter
Long Handed Inserter
Posts: 76
Joined: Mon Sep 15, 2014 7:49 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by Odhrean »

teenkertoy wrote:
aaargha wrote:
teenkertoy wrote:Of if you want to be pretentious, you can look into webm.
That's a strange way of spelling "being considerate to users on mobile/data caps". The two GIFs you have posted use more than 80% of the bandwidth of the whole page.
My apologies for using all of your limited data allowance. I have adjusted my post to be easier on your budget.

In the meantime, you might reconsider your criticism since the first post of your own thread linked in your signature contains about 50mb worth of images.
viewtopic.php?f=194&t=46855
Please restore your OP.
Nobody wanted to criticize negatively. It was positive criticism with suggestions how to make it better. You do not have to. And I am very sorry that I startet it. I just wanted to know how it works.... :?

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by aaargha »

teenkertoy wrote:
aaargha wrote:
teenkertoy wrote:Of if you want to be pretentious, you can look into webm.
That's a strange way of spelling "being considerate to users on mobile/data caps". The two GIFs you have posted use more than 80% of the bandwidth of the whole page.
My apologies for using all of your limited data allowance. I have adjusted my post to be easier on your budget.
[pouring fuel on the fire]That sure is a very constructive and mature response to criticism teenkertoy, you sure showed me :roll: [/pouring fuel on the fire]

To be clear: I had no issue with any of the content that was in the OP, it was merely used as an example, if you wanted to remove any "offending content" you should have gone with the text I initially quoted ;)

Even though I was being unnecessarily snarky in my earlier post, this one seems to be on a better level :P , I'll stick with the point of it. Just because data caps are not an issue for you or me it is, unfortunately, the reality in many developing countries. It's not like you're blind to the issue, I mean part of the reason you ran the game slower was to reduce the filesize of the GIF, so I don't really understand why you'd disregard more efficient options. (Yes, you can get GIFs pretty compressed, it's just that few tools actually do that.)
teenkertoy wrote:In the meantime, you might reconsider your criticism since the first post of your own thread linked in your signature contains about 50mb worth of images.
viewtopic.php?f=194&t=46855
See this would have been a great comeback if all the images were bitmaps or ppm and I was arguing that JPEG or PNG was pretentious. If you'd said something like "You've got these needlessly large images, X, Y, and Z should be moved to the grey background instead of concrete", or "Perhaps you should add a warning in the title as the first page is about 50MB of images", then it couldn't just be dismissed as you being grumpy as you'd actually make a valid point. It would have been a much better comeback as those are certainly things that can be improved.

Anyway, I apologize for continuing the derailment of this thread. If you want to continue this discussion we should probably do so via PM so this poor thread can get back on track once you restore the OP :)
Odhrean wrote:Thank you. I learned about webm and found a Tool for recording webm Videos: https://github.com/TheTarkus/WebMCam/releases
This is a test:
test.gif
I tried to upload a .webm File but that was not animated here, just a normal download. The webm bbcode did not help.

Sorry for using this thread for this... :?
I think the bbcode only works when the webm is uploaded somewhere else just like the img code. You could try hosting it on imgur or gfycat or something and then link that one. If it works it should be visible correctly in the preview I think.

teenkertoy
Inserter
Inserter
Posts: 37
Joined: Fri Nov 11, 2016 5:03 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by teenkertoy »

Fair enough. I stand by my use of the word pretentious since the "unwarranted, or exaggerated importance" of how large an animated gif is that is being posted to a forum that routinely uses animated gifs to display a concept in-use while playing is not a surprising thing nor a trap for anyone with bandwidth concerns. If one has a data cap due to living in an area with such restrictions (or simply using a cell phone with a limited data plan) then they should be familiar enough with this forum to realize they should be cautious here. It's like making a big deal about shooting a gun at a firing range and being concerned that people won't have earplugs handy, and it just doesn't make sense to me to make such a big deal about it while I was trying to present something as a form of "paying it back" to the community here that I have learned so much from.

So, enough of that since it is more fun to be constructive.

How does one make a compressed animated gif? I'm familiar with the "save for web" optimizations that Photoshop can do for optimizing file sizes of still images, but I've never seen a feature like that for what we're talking about.

aaargha
Filter Inserter
Filter Inserter
Posts: 329
Joined: Wed Dec 07, 2016 8:35 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by aaargha »

Disagreement accepted, at least for my part :)
teenkertoy wrote:How does one make a compressed animated gif? I'm familiar with the "save for web" optimizations that Photoshop can do for optimizing file sizes of still images, but I've never seen a feature like that for what we're talking about.
Honestly, I haven't looked looked too much into it myself just seen some results and seen it mentioned. That said googling "gif compression" yields a bunch of different tools, many of them online, I can't say how they compare to what Photoshop does, but from some small tests it they seem to be able to offer different compression options, among them is lossy encoding which is what is mostly used for video AFAIK. I'm afraid that is about as useful as I can be, I'm really not familiar with the subject, but hopefully you can find something that is useful.

teenkertoy
Inserter
Inserter
Posts: 37
Joined: Fri Nov 11, 2016 5:03 am
Contact:

Re: Unload 2 solid blue belts /wagon, balanced, compact, simple

Post by teenkertoy »

The original content to the first post is restored.

Sorry for the mess.

Post Reply

Return to “Railway Setups”