Page 1 of 1

Signal / Circuit network troubles (Solved)

Posted: Sun Apr 19, 2020 12:28 pm
by Anthlon
Hallo, i would like to ask somebody for different point of view, i have this easy goal to reach, but i struggle with putting it to work and i can't figrue it. First i do assume that i do not understand something right, here it is.
factorio_setup.png
factorio_setup.png (933.57 KiB) Viewed 1790 times
both sides are feeding same item from bottom to the two main chests, nothing else, still same item.

Here are things that happens:
factorio trable_size.jpg
factorio trable_size.jpg (478.29 KiB) Viewed 1790 times
Here is my question:
How to setup those two inserters to work only if one of chests contains more than the other one. No logistic conditions are involved.
Please do not suggest different solution, i know that there will be plenty, but my goal is to understand why it is not working even it should.
And i know that if that would work probably it ends by rotating some small count of items in that loop, but that is as i mean it.

For assuming whole situation - lets take its as nothing else is incoming at the moment, and (because of fully filled output belt) there is nothing going out, so we do have stable sum of items in both chests.

I did several homeworks and here is why I am asking.
  • I tried to conect both inserters with red wire from left & green wire from right and added condition "to work" only if Red>Green and on the other side opposite Green>Red signal, but that didnt work (on the chest is no other option than read contents so there should be no mistake made)
  • I tried both chest run to comparator, and if condition R>G / G>R then comparator sends signal to one particular inserter "to work" (= two comparators with opposite conditions each leading to one inserter with its output)

Re: Circuit network troubles

Posted: Sun Apr 19, 2020 12:51 pm
by Loewchen
Wire colors have nothing to do with color signals.

Re: Circuit network troubles

Posted: Sun Apr 19, 2020 1:10 pm
by Pi-C
Anthlon wrote:
Sun Apr 19, 2020 12:28 pm
  • I tried to conect both inserters with red wire from left & green wire from right and added condition "to work" only if Red>Green and on the other side opposite Green>Red signal, but that didnt work (on the chest is no other option than read contents so there should be no mistake made)
  • I tried both chest run to comparator, and if condition R>G / G>R then comparator sends signal to one particular inserter "to work" (= two comparators with opposite conditions each leading to one inserter with its output)
Where do you get R and G from? Just because you read something via the red or green wire doesn't mean that the signals R/G exist! Instead, if both chests contain, for example, iron plates, you will have the iron plates signal on the red channel and on the green channel. If the red and the green wire go into a combinator, what the combinator will see is one signal only: the sum of iron plates from the red and the green wire.

You need to convert the "iron plates" signal from the left and the right chest to two distinct signals, then you have something you can compare. So, hook up one arithmetic combinator to the left chest, multiply "Each" with 1, and output the result as signal "A". Connect another arithmetic combinator to the right chest, also multiply "Each" with 1, and output the result as signal "B". Feed the output from the combinators to the inserters and set "A>B" or "B>A" as condition on which the inserter is enabled.
(Not quite sure if that will really work, as I'm currently not on a computer that has Factorio installed. That doesn't change the gist of this post: you'll need to generate two distinct signals that can be compared.)

Re: Circuit network troubles

Posted: Sun Apr 19, 2020 1:16 pm
by astroshak
You would actually need several combinators to get this to work.

As stated above, you would need to put the two chests on separate channels. You would then need to feed the signal to several decider combinators, each one checking for one of the three conditions (L > R, R > L, R = L). Each combinator would then output a different signal (set to 1). Have the proper inserters set to operate only when its signal = 1.

Combinator logic can be troublesome to wrap one’s head around. Its troublesome for me, anyway - I have a hard time getting AAI Stuff to work. Single step stuff like this, though, the hardest part would be in splitting the left Iron Plate signal from the right Iron Plate signal (or w/e item you’re using).

Re: Circuit network troubles

Posted: Sun Apr 19, 2020 1:26 pm
by DaveMcW
You need to use an arithmetic combinator to convert the identical item signals into 2 different signals. In my blueprint, I also added a constant combinator with 10 imaginary items, to discourage infinite loops.



2-chest-balancer.jpg
2-chest-balancer.jpg (129.33 KiB) Viewed 1768 times

Re: Circuit network troubles

Posted: Sun Apr 19, 2020 2:51 pm
by Anthlon
Thank you very much for replies, i will dig through,i was wrong mostly about signals
"If you connect it by wire does not mean signal exist"
is an important lesson! Thank you!!

Re: Circuit network troubles

Posted: Sun Apr 19, 2020 2:57 pm
by Anthlon
Pi-C wrote:
Sun Apr 19, 2020 1:10 pm
Anthlon wrote:
Sun Apr 19, 2020 12:28 pm
  • I tried to conect both inserters with red wire from left & green wire from right and added condition "to work" only if Red>Green and on the other side opposite Green>Red signal, but that didnt work (on the chest is no other option than read contents so there should be no mistake made)
  • I tried both chest run to comparator, and if condition R>G / G>R then comparator sends signal to one particular inserter "to work" (= two comparators with opposite conditions each leading to one inserter with its output)
Where do you get R and G from?
Red was going from one chest, G from other, and what i assumed was wrong as you explained, that was helpful, and as expected, i was understanding wrongly how it behaves.
Pi-C wrote:
Sun Apr 19, 2020 1:10 pm
You need to convert the "iron plates" signal from the left and the right chest to two distinct signals, then you have something you can compare. So, hook up one arithmetic combinator to the left chest, multiply "Each" with 1, and output the result as signal "A". Connect another arithmetic combinator to the right chest, also multiply "Each" with 1, and output the result as signal "B". Feed the output from the combinators to the inserters and set "A>B" or "B>A" as condition on which the inserter is enabled.
(Not quite sure if that will really work, as I'm currently not on a computer that has Factorio installed. That doesn't change the gist of this post: you'll need to generate two distinct signals that can be compared.)
Thats it probably :-D

Re: Circuit network troubles

Posted: Sun Apr 19, 2020 3:21 pm
by Anthlon
DaveMcW wrote:
Sun Apr 19, 2020 1:26 pm
You need to use an arithmetic combinator to convert the identical item signals into 2 different signals. In my blueprint, I also added a constant combinator with 10 imaginary items, to discourage infinite loops.




2-chest-balancer.jpg
Learnt a lot from that! Thank you, and it works, basicaly for me now - If i get it(?), value set/produced on constant combinators define maximal tolerated difference between those two chests, and each created excess of that value executes one balance half-cycle of stack dose by one inserter on particular side.

solved, thank you :-D