Page 1 of 1

Centralized assembly loop controller for easy factory design

Posted: Thu Aug 11, 2016 6:34 pm
by gerbi7
AKA I found another use for the starting pistol after it becomes obsolete by making the submachine gun.

Image

So I don't know if anyone's done anything similar to this but after doing a reasonable search I didn't find anything. The nice thing about Assembly Loops is that setting up a factory with them is in theory easy as you just shove all the items any factory would ever need down the same belt and then just put up factories to make the random knickknacks you need. Items like rail signals and mining drills that take a long time to build personally but you don't need to produce in massive volumes. However this doesn't end up being very efficient if you just jam items down the belt without any knowledge of what the factories actually need! You could wire up every belt in the entire system, or come up with a circuit logistic network to do this, but such processes make the factory design more complex when really all you want to do is just plop down an assembler, some inserters, and a chest and call it a day. Wouldn't it be great if you could just have a centralized control unit at the feed point of the belt that optimize the feed rates and then not have to worry about having anything intelligent in the factory section? Well I did exactly that.

The main trick is that I use the starting pistol as a marker, and have it constantly feed through the assembly loop. This gives a regular signal that can be used to define a cycle on the belt. For each cycle I read the items fed into the belt, then subtract the items that make it back out the other end. This gives the number of items consumed by the factories in that cycle, without needing to do anything special with the factories. Then all the feed system needs to do is to output the number of items consumed on the previous cycle, plus a minimum output to ensure that extra items are there to detect additional demand. The only other trick is the feeding system which allows the items to be fed at a smooth constant rate.

I made a quick video showing the design in action with an explanation of the various components on my channel on twitch (same username). I'd post the link but the forum isn't allowing it.

Also I should credit XKnight I believe for coming up with the super awesome 2-combinator memory cell that I used which was waaaay more efficient that what I had come up with. One problem that I did have though is that it doesn't seem to initialize off the single-tick clock signal that I use so that's why you'll see the extra constant combinator for initializing them, just turn it on and then back off if you use the blueprint.

Right now the design is just a proof of concept so I'm more or less just getting this idea out there for you guys to play with and possibly optimize. Let me know what you guys think!

And here's your blueprint string so you can actually play with it yourselves:

Code: Select all

H4sIAAAAAAAA/91d25LiOBL9lQked2HGki/gmGVe5hfmqSc2CBeoqhwNNmub6q6o4N9X5lZIluRMSRhqnjqqjVJW3pR5MiWvyl/W5TJb/7KYf7CiyZuc1fOP
jyLbsPmI/dxWrK4nTZUV9basm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uH7nLLjT1j7gV+QUB3vBHLWxEh8B
JOkJIPuL7ce4DyBaSK39quhwAFwuZfb9OK8XnPCxWjBQI7KPuLgnLEZUFrQ0jN9ES8CnSAL5lL3rfRLt9LMBTH4A56mKs6gpdNJ+sq+XkryZGsqDYClMhz7g
4iIFzHUBPQFs50wLOBSWpSB/2QJVjo9gIvhHNlJ066qq4LMbXpgkZbh5o5NfW9lL6tVezFV1mKmoaCB8FcYQVLrOt9/lYQ5Tx5p6K9uDWuU0h2TOnXL7/e8V
a3ZV8cvid1as/g9r601UDaMAAA==

Re: Centralized assembly loop controller for easy factory design

Posted: Fri Aug 12, 2016 1:21 am
by Sneaker2
I guess if you have the advanced version, I have the basic one,

my idea was simply an endless belt, that knows at any moment how many items are on the belt and replenishes the item-count every time one item gets taken off. It started out quite difficult, which makes this built quite ridiculously bare.

Code: Select all

H4sIAAAAAAAA/9VZf6+aPBT+KoY/35Q3ggqajX2RZSEV6rVJaUkpy4zhu6+ATlEoHOpu3F/3YnlOT8+P52lpKhZMJJgt4uhMuKKKkiI6nznOSOQccKFcJTEv
ciGVuydMOSgXhX5L8Oj8K3K9FTpF7qaqEBCyhkC24Em24DkuXqGUSpI0v/oAtA/20Ad76D15GEDQYQ335y7QCwzwIsOMuYTpAUkTNxeMPMLXNXwFWu7GzuG1
CU6ZItKlvCBS/9Nboat76BolgispWLwnR/yTChmdEyqTkqo4EymJxSEWOZG4eXuFrmOS4DQ+Yp7GNV43WBEpWZKqNsdb27rdvjue8yM6f0hCtAdtH55imkaB
Likds9bdui8pT8mvyEPtMqgU3M0ZVsSp4C04P7S+Hdyzgy9nJ3b7j+Q1Ebme8zmz4322A7fZzioZWyu0HSWZGGkcbccu88nlfbglMNZgoQhhc0rQB5egHRsZ
ycjM8/9IKoboYOKWYW5kjTw7Braa2UpfrKrJ2NdjYCtKsWIzKyK14nAr+TBL+SjaqsbsNjF2Oyjz3nQUbVVnxo38ONqqWOzOIN5zra0hXNi47nUmN9C9Hkkv
4AOVhYoL+sExi87qlNdbb0Uyp2cbXlssFOZK02cishxrrdBmna/10MU04XjPSJzSov4bHTAryJiUoDu/ml/bF2tRipb9OiNJ2lGZzbqqYOqx+9yIbSaHrBOR
noh1Q2oRMr07uNdpDxrBsI0gFLIEIHqyBGiLBr206qm/USDdLc8bN1WwnNNUnxmyN+yqnamrMpLSMjN/TQraGE5kPdTNF+oexO8fQ39Og8P7278hUpLQVOdN
52hPeZ2jp68t/28ayEjJXAzdSqbor5mfVKoSs2vZtIMuwclxuNG+OUiUKi+BtvKT9qbkKj5IkcWUawPtuWhib63/FJt+8h8TV6Hnk1QYdiH6pe+OP24cXIK7
6RWo6xsZJkYPB8GeVXndGvZ2jyA0GALowpaAdXV7Jwh7fX94yw87jyuof5C4d+MSbIFTXcVt0lwhjDieVQCq2Xb74NVfEKDOF6M3lmw4ye8+N2Lvp9gPFBb2
7INLrsXnQ2q6Twfvj7qXV6gNSCssDlRCYVdnYZNBmMf+kMeNkN0cxpKqY0aUJpExER8toputF+m466HbB0vnvxk6PiDWA5caV7ntGTYI7qR8eKAKGrE2WI4P
yZ1ia/NCx5av8+uV8XphuMIXujW5R6fYWr3SsS3EsVGxn3vr/6xcNW3SpGnk87Aw9RnWuPZWQk8/jOw5zlyBvhHYz6JX7MqIfbzmuaLqxV53e5mQpwUTIneq
L5KoUvJF/IXw9DftiMjqASMAAA==
Speicherschleife.png
Speicherschleife.png (3.43 MiB) Viewed 7271 times
this is just a bare example with 3 inlets on the left side and 4 outlets on the top side. the inlets have 2 scanners each, the first one for stopping the items and not doing anything else and the second scanner for "puls scanning" and also not doing anything else (its not possible to get precise counts with just 1 scanner, since the input count gets taken at the entry of the scanner, which can stop up to 4 items that never reach the loop belt. the count will never be wrong, but the items are still stuck there until some other items leave the loop. if one day the scanner gets puls-scanning for exiting items, this would be possible).

the input count goes to the counter via red wire and counts the "in's". the very nice feature about the combinators is this "pro signal" (yellow signal with black star) which gives me the awesome ability to set up 1 counter for any item-type there is in the game. I used to have 1 counter for every different item until i found this signal (although inserters dont need the "pro signal" here, it would be awesome if they would in the future ( so versatile)).

on the top side of the belt are the outlets of the system via inserter. they can be "filter-inserters" if another belt follows or just normal inserters if they feed directly into an assembler (which seems to give a filter command by itself to the inserter). the inserters dont need any activation command but they all need "puls scanning" enabled. This signal goes via green wire to an arithmetic combinator, where it gets multiplied with -1 and fed into the counter (or compairing combinator). the green wire counts the "out's". the counter signals then get fed to the scanners at the entry and make sure that no further item gets put on the belt, than the condition demands on the first scanner.

This system can be extended very easily, as long as the "in's" go to the red wire and the "out's" go to the green wire. Inputs and outputs can be added anywhere.

I dont really know what happens if there are multiple inputs of the same item at different locations, because it could happen that just one input will service the loop as long as there are items left. an alternating select system would be needed ( but I have no idea how to set up one yet) the only thing that needs manual configuration is the item count on the belt and the caution, that the belt doesnt get flooded with more items than it can actually carry. You can get a grid lock then.

This system is good for low to medium demand. anything else needs a direct line from the furnace or assembler or a parallel belt and splitter/cimbinators, that can take the short increase of input until the output decreases it again. A very long belt might also not be good, since it takes a long time until items get taken off, which lowers the through-put.

Re: Centralized assembly loop controller for easy factory design

Posted: Fri Aug 12, 2016 1:36 pm
by gerbi7
That's actually a pretty good approach for a simpler loop controller I think, though I would point out that my main goal for my design was to centralize the controller so that I didn't have to run circuitry throughout the actual loop with the factories.
Sneaker2 wrote:I dont really know what happens if there are multiple inputs of the same item at different locations, because it could happen that just one input will service the loop as long as there are items left. an alternating select system would be needed ( but I have no idea how to set up one yet)
I believe the alternating select system you're looking for is Splitters ;)

Re: Centralized assembly loop controller for easy factory design

Posted: Fri Aug 12, 2016 2:30 pm
by Sneaker2
gerbi7 wrote:That's actually a pretty good approach for a simpler loop controller I think, though I would point out that my main goal for my design was to centralize the controller so that I didn't have to run circuitry throughout the actual loop with the factories.
Sneaker2 wrote:I dont really know what happens if there are multiple inputs of the same item at different locations, because it could happen that just one input will service the loop as long as there are items left. an alternating select system would be needed ( but I have no idea how to set up one yet)
I believe the alternating select system you're looking for is Splitters ;)
not quite, because if they are so far apart, that the lines cant be combined, splitters wont do the trick. there must be a networking solution and I think this one would be useful in many ways.

well, drawing the network as a line along the loop has its disadvantages. you have to be careful not to connect anything my accident to it, or else the counter will run away on you. and it also splits he factorio into 2 sides, which can still be overcome, but you need to be cautious and also have to use more power-poles than you really want. but apart from that, adding stuff gets very simple and reliable.

Re: Centralized assembly loop controller for easy factory design

Posted: Sun Aug 14, 2016 1:42 pm
by neurofish
i have a similar idea, but for 0.12 without counting..

see: viewtopic.php?f=8&t=19609&start=20#p187301

Re: Centralized assembly loop controller for easy factory design

Posted: Sun Aug 14, 2016 7:53 pm
by Gertibrumm
I guess there are many similar designs but one can argue that, anyway my question would be:
Why use the gun as marker when you can just reload the belt with what left the belt and at the same time knowing how many assemblers/chemplants are connected to the grid? This would simplify things terribly, alse personally I think the loop input setup is overly complex. why not just chest with inserter counting and filtering until signals reach 0?

Re: Centralized assembly loop controller for easy factory design

Posted: Tue Aug 16, 2016 9:27 am
by siggboy
Gertibrumm wrote:I guess there are many similar designs but one can argue that, anyway my question would be:
Why use the gun as marker when you can just reload the belt with what left the belt and at the same time knowing how many assemblers/chemplants are connected to the grid? This would simplify things terribly, alse personally I think the loop input setup is overly complex. why not just chest with inserter counting and filtering until signals reach 0?
Yes, I agree. I'm puzzled as well about the complexity of OP's solution.

It's possible to have the Filter Inserter load exactly X items at maximum speed (from a belt), by setting a filter signal of -2^31 and subtracting the desired item count from that. Every loading inserter (belt -> machine) needs to count in pulse mode, and those pulses need to be subtracted from a simple memory register. The result (combined with the -2^31 constant for every desired item type) is used as the filter signal for the unloading inserters (requester chests -> belt). New items need to be added to the counter.

The filter inserters will slightly overload the belt if you're loading from a chest due to stack size bonuses. If the hand read mode is set to "hold" and stuff is loaded from a belt one can even have a count perfect loading. It's probably not necessary in this setup, as slight overprovisioning is desired anyway.

I should probably try this in practice. I've made a test setup, it works really well. Requires 4 combinators, maybe more or less depending on the amount of configuration convenience. I will post a blueprint later.

Re: Centralized assembly loop controller for easy factory design

Posted: Wed Aug 17, 2016 5:37 pm
by Gertibrumm
Ahhhh!! I get it :D your still busy with stack size antibonus. mhh never mind :)

Re: Centralized assembly loop controller for easy factory design

Posted: Wed Aug 17, 2016 9:52 pm
by siggboy
No, I'm not "busy" with it, I'm actively using it in a few cases :).

(BTW you can't say "you're busy with it" in that context, I only understood what you mean by taking it word for word back into German :).

It's necessary in every situation where you need to set the filter and also be able to enable/disable the inserter programmatically, because there's no other way unless you use the "anti-bonus".

Re: Centralized assembly loop controller for easy factory design

Posted: Mon Aug 22, 2016 6:01 pm
by hi_impact
The ability to set recipes in assemblers using circuit network in proposed 0.14 update will "complete" this concept and make it very viable over traditional solutions, such as looong belts with various knicknacks. Right now it's nothing more than a project for the sake of a project (which is great in Factorio!!).

Re: Centralized assembly loop controller for easy factory design

Posted: Sun Aug 28, 2016 5:29 pm
by Gertibrumm
well I am hoping for the best!
Regardless of all joys of future features we have to consider the header "Ideas/Backlog" which as I understand it means they are not prioritizing these log entries. But I dont want to spoil my own enthusiasm for this one heck of a feature!!!
Did they write when they plan to start 0.14 experimental?
Because I have to schedule this yet not finished ultimate factory project.