Page 1 of 3

Smart Furnace - load-balanced, demand-based, and tileable

Posted: Mon May 23, 2016 5:10 am
by NateDangerous
I've recently started a world in Factorio based exclusively around research and development (and at times, mad science). I figured I'd start showing some of the more interesting creations and concepts from that world.

The first one is my take on the idea of a smart furnace. I've seen a few smart furnace designs, but none of them were quite what I was looking for. My requirements were that it be demand-based, lean/efficient, precise, and tileable. What I came up with was a system that smelts exactly what you ask for (assuming you're asking for iron or copper plates) as long as the total demand doesn't exceed the total output of the furnace array. But when the demand exceeds the total output capability of the array, it will load balance, allocating the proper ratio of furnaces to each product. This means that in high demand situations, although the factory throughput may decrease, it will still be balanced, and everything should still be distributed in the correct ratio.

Here's a video of the system where I explain it and give a few demos:
https://youtu.be/UWGQ2QGlIqY

And, here are a couple of screenshots of it, one with details about what the circuits do.

Overview
Furnace array overview
Furnace array overview
overview.png (740.03 KiB) Viewed 13446 times
How it works
How it works
How it works
how-it-works.png (2.42 MiB) Viewed 13446 times

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Mon May 23, 2016 3:21 pm
by Mullematsch
This looks pretty neat. But that are a lot of combinators for what this thing is really doing. Smelting exactly 10 copper plates is nice but you could also just detect it at the end of your belt (storage area). Of course you would always smelt 50 too much but that is not really a problem. I build something similar to this in my modded world and it seems way more practical than this. Not to say that it is better, you got a cool design there but yours seems a bit too clunky for what it is doing. Or am I overlooking something?
Pictures

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Mon May 23, 2016 5:35 pm
by NateDangerous
Mullematsch wrote:This looks pretty neat. But that are a lot of combinators for what this thing is really doing. Smelting exactly 10 copper plates is nice but you could also just detect it at the end of your belt (storage area). Of course you would always smelt 50 too much but that is not really a problem. I build something similar to this in my modded world and it seems way more practical than this. Not to say that it is better, you got a cool design there but yours seems a bit too clunky for what it is doing. Or am I overlooking something?
I don't think you're necessarily overlooking anything. The thing is that practicality isn't my goal; there are much more efficient ways to build a furnace array if your aim is min-maxing.

A lot of the stuff I build is just to see if it can be done, or to meet some restriction I've given myself. For example, I wanted to control exactly what each furnace is doing, I wanted automatic load-balancing, and I wanted to do it without mods. Kinda why I'm considering it to be "mad science". ;)

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Fri May 27, 2016 5:07 am
by NateDangerous
I've put up a new video showing the steel and stone brick "smart" furnace with deadlock prevention.

Video: https://youtu.be/JrKP07SaJxA

Disclaimer: This is not practical in the least. It's an example of the mad science side of my world.

Here's the blueprint string for the furnace:
Steel and Stone Brick Furnace
Here's the blueprint string for the load balancing circuit. This may actually be useful to some people.
Load Balancer Circuit

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Fri May 27, 2016 5:15 am
by NateDangerous
NateDangerous wrote:
Mullematsch wrote:This looks pretty neat. But that are a lot of combinators for what this thing is really doing. Smelting exactly 10 copper plates is nice but you could also just detect it at the end of your belt (storage area). Of course you would always smelt 50 too much but that is not really a problem. I build something similar to this in my modded world and it seems way more practical than this. Not to say that it is better, you got a cool design there but yours seems a bit too clunky for what it is doing. Or am I overlooking something?
I don't think you're necessarily overlooking anything. The thing is that practicality isn't my goal; there are much more efficient ways to build a furnace array if your aim is min-maxing.

A lot of the stuff I build is just to see if it can be done, or to meet some restriction I've given myself. For example, I wanted to control exactly what each furnace is doing, I wanted automatic load-balancing, and I wanted to do it without mods. Kinda why I'm considering it to be "mad science". ;)
I hope you don't mind, I mentioned and linked to one of your videos in my most recent one, showing your much more elegant furnace loader design. Also, sorry if I got the pronunciation of your name wrong.

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Fri May 27, 2016 3:58 pm
by Qon
Not useful for my mega base build, which uses a pretty dumb smart furnace setup that can do copper, iron and steel but has no load balancing or circuits. But it's intresting, which was the goal :)
Subscribed because I want to see how your production makes use of this. And for putting effort into your creation, video and the explanation.

My dumb smart furnace setup is just smart inserters that activate if the logistics network content falls below a limit and for steel an additional extra condition that there's at least 5 plates in the iron plate input chest. No combinators or anything. If it's lacking in all at once then often only one will be produced anyways. But that means whatever is produced will quickly reach the logistics amount and switch to something else soon since I make sure to have enough furnaces to meet the demand of my base. This is actually a feature. When you switch back and forth between steel and iron smelting you lose your productivity bonus progress some since they have different smelting times (prod3 modules in everything). It would not work well if my smelting setup was undersized for my base, so I make sure it isn't so I don't run out of buffer materials. But it is scalable to handle several rockets/minute without doing any modifications at least. Just blueprint and place as much as you need. It will break in 0.13 though when smart/fast inserters lose their stack bonus which the steel prdouction depends on being 5/grab.

I'm not qonvinced that your setup would be smaller with logistics bots since you need 1 chest/input.

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Sun May 29, 2016 10:06 am
by Neotix
I was thinking about that Smart Furnace and got an idea to use Binary Coder.
Overview
Explanation
GIF

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Sun May 29, 2016 11:54 am
by XKnight
Sorry guys, I haven't read this thread for a while but I definitely should share this stuff:
Neotix wrote:I was thinking about that Smart Furnace and got an idea to use Binary Coder.
I believe you can improve your build:
Spoiler
And the main holy-crap part:
Qon wrote:When you switch back and forth between steel and iron smelting you lose your productivity bonus progress some since they have different smelting times (prod3 modules in everything).
I decided to test this because it looks very very important:
Animation.gif
Animation.gif (12.3 MiB) Viewed 12964 times
Math
Result: new process gives (0.2 - 0.192)/0.192 = 4.16% more steel than standard! and takes (2 - 1.8)/1.8 = 11.1% more time.

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Sun May 29, 2016 12:29 pm
by Qon
XKnight wrote: And the main holy-crap part:
Qon wrote:When you switch back and forth between steel and iron smelting you lose your productivity bonus progress some since they have different smelting times (prod3 modules in everything).
I decided to test this because it looks very very important:
Animation.gif
Math
Result: new process gives (0.2 - 0.192)/0.192 = 4.16% more steel than standard! and takes (2 - 1.8)/1.8 = 11.1% more time.
Hey this is an awesome find! Steel and oil is the biggest resource sinks in rocket production and steel->LDS suffers from a very short production chain where a big part of it is in 2 module slot furnaces. Using this process to increase productivity is definitly worth doing in large scale. Now I just need to understand how you did it. A bit cryptic and the loop cut in the gif is qonfusing me. Mind blown. Should have investigated further myself before just assuming it wasn't possible to take advantage of it :o I was considering the possibility but dismissed it way too early. Going to see that the math checks out and then do this in large scale for my high speed rocket launching factory if possible. I need 6.3k steel/rocket so every bit helps.

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Sun May 29, 2016 12:38 pm
by Neotix
XKnight can i ask for blueprint or explanation because i'm staring on it for a while and have no idea what you did.

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Sun May 29, 2016 1:15 pm
by XKnight
Neotix wrote:XKnight can i ask for blueprint or explanation because i'm staring on it for a while and have no idea what you did.
Sure, why not.
blueprint
Forgot to mention, using smelting switching + productivity modules it is even possible to convert resources from one to another:
4 iron ore + 1 copper ore = 4 iron plates + 2 copper plates. x2 copper!
20 iron plates + 1 copper ore = 4 steel + 5.2 copper plates. x5 copper!
So, if you don't have copper/iron/stone, but have tons of other resource - you know what to do ;)

*Edit: fixed const array in blueprint

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Sun May 29, 2016 2:22 pm
by Neotix
OMG it's so simple :shock: Entire 2^n calculation and binary coding is not necessary. Just signals comparison and sum. ()
It's not improvement, it's total overhaul
And big advantage is that it's easily scalable for more resources.

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Sun May 29, 2016 5:14 pm
by Qon
XKnight wrote: Forgot to mention, using smelting switching + productivity modules it is even possible to convert resources from one to another:
4 iron ore + 1 copper ore = 4 iron plates + 2 copper plates. x2 copper!
20 iron plates + 1 copper ore = 4 steel + 5.2 copper plates. x5 copper!
So, if you don't have copper/iron/stone, but have tons of other resource - you know what to do ;)
You did it again :o
That is a nice discovery. You are pretty good at this. I'm impressed.

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Sun May 29, 2016 6:48 pm
by Neotix
Minor issue with that setup. It can't be turned off. If all input signals are 0 then all lamp in bottom row are on. It can be fixed by adding condition to transmit signal from constant combinator in 3rd column only when any input signal is > 0.
Image

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Sun May 29, 2016 8:08 pm
by MeduSalem
The conversion between resources works only between Iron Ore and Copper Ore. It doesn't work for Steel.

For steel the furnace is keeping its own individual progress bar for productivity modules. That's at least the case with 0.12.33 which I am playing.

I guess that the conversion of Copper into Iron Ore (and vice versa) by abusing productivity modules isn't intended either and is rather an oversight, which I expect to be fixed somewhen in the future if someone actually reports it.

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Sun May 29, 2016 8:52 pm
by Qon
MeduSalem wrote:The conversion between resources works only between Iron Ore and Copper Ore. It doesn't work for Steel.

For steel the furnace is keeping its own individual progress bar for productivity modules. That's at least the case with 0.12.33 which I am playing.

I guess that the conversion of Copper into Iron Ore (and vice versa) by abusing productivity modules isn't intended either and is rather an oversight, which I expect to be fixed somewhen in the future if someone actually reports it.
It does work, it just becomes 5 times smaller when you go from the 3.5 second recipe to the 17.5 second recipe. The reason you get 5 copper/iron plates from one ore after making 4 steel plates is because it goes to something like 400% bonus progress when it become 5 times bigger in the other diretcion. So the conversion works even if it doesn't look like it.

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Mon May 30, 2016 2:14 am
by Qon
XKnight wrote:Standard process:
0.4 iron + 0.8 iron =[*from 2 eq]=> 0.4 iron + 0.192 steel

Result: new process gives (0.2 - 0.192)/0.192 = 4.16% more steel than standard! and takes (2 - 1.8)/1.8 = 11.1% more time.
0.8 irons gives 0.8*1.2*1.2/5 steel in the standard process. Which is 0.2304. Too bad, no extra productivity :/

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Mon May 30, 2016 6:24 am
by XKnight
Qon wrote:
XKnight wrote:Standard process:
0.4 iron + 0.8 iron =[*from 2 eq]=> 0.4 iron + 0.192 steel

Result: new process gives (0.2 - 0.192)/0.192 = 4.16% more steel than standard! and takes (2 - 1.8)/1.8 = 11.1% more time.
0.8 irons gives 0.8*1.2*1.2/5 steel in the standard process. Which is 0.2304. Too bad, no extra productivity :/
0.8 iron gives 0.8*1.2/5 steel = 0.192
0.8 ORE gives 0.8*1.2*1.2/5 steel

in my original post "iron = iron plate", "ore = iron ore".

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Mon May 30, 2016 9:21 pm
by kann_
I tried your circuit XKnight. It is...simple ;)
Just needed a similar fix to turn it off as already suggested.

One steel, iron, copper tile is 3x10. So not much smaller than the combinator version, but I like the simplicity and I can use belts with it
furnace.png
furnace.png (132.31 KiB) Viewed 11778 times

Re: Smart Furnace - load-balanced, demand-based, and tileable

Posted: Mon May 30, 2016 11:54 pm
by XKnight
XKnight wrote: And the main holy-crap part:
Qon wrote:When you switch back and forth between steel and iron smelting you lose your productivity bonus progress some since they have different smelting times (prod3 modules in everything).
I decided to test this because it looks very very important:
The attachment Animation.gif is no longer available
Math
Result: new process gives (0.2 - 0.192)/0.192 = 4.16% more steel than standard! and takes (2 - 1.8)/1.8 = 11.1% more time.
In-game proof:
Builds
Test: 600 iron ore in input, only steel in output.

Results in the end:
simple process - produced 172 steel
advanced process - produced 180 steel (4.6% more steel)

Results at the same moment in time:
simple process - 172 items
advanced process - 158 items (8.1% slower)
Animation