OCD-safe count-perfect smart belt mixer

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.
Optymistyk
Long Handed Inserter
Long Handed Inserter
Posts: 52
Joined: Sun Jun 14, 2020 9:41 pm
Contact:

OCD-safe count-perfect smart belt mixer

Post by Optymistyk »

I made a thing, maybe someone can find a use for it.
mixer.gif
mixer.gif (7.96 MiB) Viewed 5706 times
What it does:
sends a number of different items every X seconds over a single belt
Currently it's set to send 120 Blue Circuits, 80 Electric engines, 60 Low Density Structures, 50 Efficiency 2 Modules, 50 Speed 2 Modules every 12 seconds.
Items per second must not exceed maximum belt throughput

User avatar
eradicator
Smart Inserter
Smart Inserter
Posts: 5206
Joined: Tue Jul 12, 2016 9:03 am
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by eradicator »

Nice. But..that gap between item types is not OCD safe - you're wasting bandwidth! ;)
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: ζ—₯本θͺž, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.

foamy
Filter Inserter
Filter Inserter
Posts: 432
Joined: Mon Aug 26, 2019 4:14 am
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by foamy »

What happens if the drain jams? Or runs at half speed?

Optymistyk
Long Handed Inserter
Long Handed Inserter
Posts: 52
Joined: Sun Jun 14, 2020 9:41 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Optymistyk »

foamy wrote: ↑
Thu Nov 26, 2020 8:42 am
What happens if the drain jams? Or runs at half speed?
Items per second cannot exceed max belt throughput. This applies to slower belts as well as jammed belts. If this happens it is not going to send all the items in the desired timeframe. Some items might also get stuck on the unconnected ends of splitters as they can't be placed on the belt fast enough (though this could be prevented by using a more complex splitter array). The contraption works with an assumption that a sufficient belt throughput is provided at all times. Failing to provide that might affect the quantity and the ratio of items sent

User avatar
Impatient
Filter Inserter
Filter Inserter
Posts: 880
Joined: Sun Mar 20, 2016 2:51 am
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Impatient »

Optymistyk wrote: ↑
Thu Nov 26, 2020 9:02 am
... Some items might also get stuck on the unconnected ends of splitters as they can't be placed on the belt fast enough ...
You can prevent this in particular by simply setting a priority and filter of an item that is NOT used (like fish) to the output of the splitter, where no item should go.

User avatar
Deliberate Grief
Burner Inserter
Burner Inserter
Posts: 12
Joined: Mon Nov 16, 2020 7:09 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Deliberate Grief »

Needs improvements.

Optymistyk
Long Handed Inserter
Long Handed Inserter
Posts: 52
Joined: Sun Jun 14, 2020 9:41 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Optymistyk »

Impatient wrote: ↑
Thu Nov 26, 2020 5:31 pm


You can prevent this in particular by simply setting a priority and filter of an item that is NOT used (like fish) to the output of the splitter, where no item should go.
That is true, didn't think of that

Binoculars
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed Dec 02, 2020 6:17 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Binoculars »

I finalized this recently. More difficult to configure than your creation, it nevertheless allows you not to waste bandwidth.

I think it would take a mix of our two creations to come up with a few practical and easily configurable things.

Also, it doesn't work with blue conveyor belts, which I can't explain ...
20210106160442_1.jpg
20210106160442_1.jpg (747.54 KiB) Viewed 5262 times

quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by quyxkh »

Here's mine, in two different layouts. Set the ingredient counts in the constant combinator, set the ingredient items in the <0 enables, turn on the constant combinator. Supply a nonzero Z on the red wire or turn off the constant combinator to stop after the next complete recipe batch.




Binoculars
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed Dec 02, 2020 6:17 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Binoculars »

quyxkh wrote: ↑
Wed Jan 06, 2021 7:22 pm
Here's mine, in two different layouts. Set the ingredient counts in the constant combinator, set the ingredient items in the <0 enables, turn on the constant combinator. Supply a nonzero Z on the red wire or turn off the constant combinator to stop after the next complete recipe batch.
I created the same thing but more compact.
A very useful creation, although very different from the basic idea here.

Binoculars
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed Dec 02, 2020 6:17 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Binoculars »

quyxkh wrote: ↑
Wed Jan 06, 2021 7:22 pm
Here's mine, in two different layouts. Set the ingredient counts in the constant combinator, set the ingredient items in the <0 enables, turn on the constant combinator. Supply a nonzero Z on the red wire or turn off the constant combinator to stop after the next complete recipe batch.
Your creation seems to work perfectly with blue transport mats. Could you tell me what for why my setup does not work with these?

quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by quyxkh »

I haven't stared at it hard enough to be certain, but I'm betting it's that you reset to zero for every batch and don't remember strays, and your logic can't keep up, blue belt traffic comes at 2-3 tick intervals, your logic probably takes three ticks to react so it lets extras through sometimes and when it resets the counter, it gets off track.

Binoculars
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed Dec 02, 2020 6:17 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Binoculars »

quyxkh wrote: ↑
Wed Jan 06, 2021 8:15 pm
I haven't stared at it hard enough to be certain, but I'm betting it's that you reset to zero for every batch and don't remember strays, and your logic can't keep up, blue belt traffic comes at 2-3 tick intervals, your logic probably takes three ticks to react so it lets extras through sometimes and when it resets the counter, it gets off track.
I had thought of this. So the only way to get an accurate result on blue conveyor belts is a constant combiner with negative values?

quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by quyxkh »

Binoculars wrote: ↑
Wed Jan 06, 2021 8:20 pm
quyxkh wrote: ↑
Wed Jan 06, 2021 8:15 pm
I haven't stared at it hard enough to be certain, but I'm betting it's that you reset to zero for every batch and don't remember strays, and your logic can't keep up, blue belt traffic comes at 2-3 tick intervals, your logic probably takes three ticks to react so it lets extras through sometimes and when it resets the counter, it gets off track.
I had thought of this. So the only way to get an accurate result on blue conveyor belts is a constant combiner with negative values?
I think it's the pulse-feeding-a-direct-feedback-accumulator setup that's necessary, the downstream belts' "have" pulses show up on the "want"+"have" sum circuit in that one tick, with the accumulator output, and the accumulator carries it forward. Want more, pulse a -ve of how many more you want. Have more, pulse a +ve of how many more you have, the running sum tells the circuitry which way perfection lies. But I really am guessing about your circuit, it's much easier for me to understand the direct item signals than the `A`s and `B`s there.

Binoculars
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed Dec 02, 2020 6:17 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Binoculars »

quyxkh wrote: ↑
Wed Jan 06, 2021 9:04 pm
Binoculars wrote: ↑
Wed Jan 06, 2021 8:20 pm
quyxkh wrote: ↑
Wed Jan 06, 2021 8:15 pm
I haven't stared at it hard enough to be certain, but I'm betting it's that you reset to zero for every batch and don't remember strays, and your logic can't keep up, blue belt traffic comes at 2-3 tick intervals, your logic probably takes three ticks to react so it lets extras through sometimes and when it resets the counter, it gets off track.
I had thought of this. So the only way to get an accurate result on blue conveyor belts is a constant combiner with negative values?
I think it's the pulse-feeding-a-direct-feedback-accumulator setup that's necessary, the downstream belts' "have" pulses show up on the "want"+"have" sum circuit in that one tick, with the accumulator output, and the accumulator carries it forward. Want more, pulse a -ve of how many more you want. Have more, pulse a +ve of how many more you have, the running sum tells the circuitry which way perfection lies. But I really am guessing about your circuit, it's much easier for me to understand the direct item signals than the `A`s and `B`s there.
Thank you so much.

Binoculars
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed Dec 02, 2020 6:17 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Binoculars »

quyxkh wrote: ↑
Wed Jan 06, 2021 7:22 pm
Here's mine, in two different layouts. Set the ingredient counts in the constant combinator, set the ingredient items in the <0 enables, turn on the constant combinator. Supply a nonzero Z on the red wire or turn off the constant combinator to stop after the next complete recipe batch.
I'm wondering, how is it that in your two creations the combiners output the value x2?
Is it not possible to enter exact numbers and get this result as an output?

quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by quyxkh »

Binoculars wrote: ↑
Thu Jan 07, 2021 4:24 pm
I'm wondering, how is it that in your two creations the combiners output the value x2?
Is it not possible to enter exact numbers and get this result as an output?
That's the response delay, the decision to ask for more takes a tick, applying it takes a tick, so the tick after it decides to ask for more, the request hasn't shown up yet, it'll still make the same decision. The ask-for-more logic is (actually, it's the don't-ask-for-more logic) Anything < -2 β‡’ Z=1, and the actual deliver-the-request logic is Z=0 β‡’ Everything=Input.

The gate=0 β‡’ output everything trick is baseline for composing complex circuits in my book, I don't know of another way to build but that's at least as likely as not just me.

Binoculars
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed Dec 02, 2020 6:17 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Binoculars »

quyxkh wrote: ↑
Thu Jan 07, 2021 8:45 pm
Binoculars wrote: ↑
Thu Jan 07, 2021 4:24 pm
I'm wondering, how is it that in your two creations the combiners output the value x2?
Is it not possible to enter exact numbers and get this result as an output?
That's the response delay, the decision to ask for more takes a tick, applying it takes a tick, so the tick after it decides to ask for more, the request hasn't shown up yet, it'll still make the same decision. The ask-for-more logic is (actually, it's the don't-ask-for-more logic) Anything < -2 β‡’ Z=1, and the actual deliver-the-request logic is Z=0 β‡’ Everything=Input.

The gate=0 β‡’ output everything trick is baseline for composing complex circuits in my book, I don't know of another way to build but that's at least as likely as not just me.
Very well thank you.

I'll use your idea to make my idea work with the blue conveyor belts. If I want to get back to sleep, I have no choice but to do so.

Binoculars
Long Handed Inserter
Long Handed Inserter
Posts: 83
Joined: Wed Dec 02, 2020 6:17 pm
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by Binoculars »

quyxkh wrote: ↑
Wed Jan 06, 2021 7:22 pm
Here's mine, in two different layouts. Set the ingredient counts in the constant combinator, set the ingredient items in the <0 enables, turn on the constant combinator. Supply a nonzero Z on the red wire or turn off the constant combinator to stop after the next complete recipe batch.



Forgive me, but is it possible to add an arithmetic combinator which divides the input by two so as not to have to divide by two when entering the constant combiner ?

quyxkh
Smart Inserter
Smart Inserter
Posts: 1027
Joined: Sun May 08, 2016 9:01 am
Contact:

Re: OCD-safe count-perfect smart belt mixer

Post by quyxkh »

Binoculars wrote: ↑
Sat Jan 09, 2021 3:14 pm
is it possible to add an arithmetic combinator which divides the input by two so as not to have to divide by two when entering the constant combiner ?
Sure, but lots of recipes have ingredient counts like 3 and 5, and belts have two lanes. This is engineering-land, you're not going to get perfect. Don't get me started on the changes that have catered to the desire for simplicity and abstract purity.

Post Reply

Return to β€œCombinator Creations”