smart smelting using logistic and circuit conditions

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.
Post Reply
vanatteveldt
Filter Inserter
Filter Inserter
Posts: 918
Joined: Wed Nov 25, 2015 11:44 am
Contact:

smart smelting using logistic and circuit conditions

Post by vanatteveldt » Thu May 05, 2016 1:02 pm

This is my second attempt to do stock management for smart smelting:

Image

This is my smart smelting prototype, inspired by MeduSalem's design in viewtopic.php?f=5&t=13107&start=10.
The goal is to smelt something only if that resource is the lowest, and if it is below a threshold. Suppose the threshold is 1000, then if I have 300 iron and 700 each of steel and copper, I want to smelt iron exclusively, until iron reaches 700 as well, and then smelt everything until all are at 1000, and then stop.

A complicating factor is that the iron inserter for the steel smelting also requires a circuit conditon [iron > 4] connected to its own requester chest, as otherwise it could insert e,g, 3+4 iron, smelt 5 into steel, and be stuck with 2 iron left. So, using the inserter stack size of 5, this condition guarantees that only full stacks of 5 are inserted. (again, thanks @MeduSalem).

However, this means that the circuit network can't be used to control the ore inserters, as you can only have one circuit condition on an inserter. So, I use the logistic network to send the on/off messages to the smelters by (ab)using three item types that I don't use at all (cannon shells, rockets, and explosive rockets) as symbolic signals to indicate copper/iron/steel smelting should proceed.

Explanation:

Image


The output chests of the smelting are connected by red wire to the substation. Note that the screenshot shows a smart chest, this will be a provider chest in production, but I wanted my bots to leave the chest alone during testing :)


To enforce the dual condition (lowest amount and amount < X), two separate paths are taken from the substation. The first is to the top decider+constant. The constant combinator outputs the threshold level in green (now 100) and 1 each for the output types to make sure it works when storage is empty. The decider compares "each" to green, and outputs of "each". So, any output type that is below the threshold is coded as 1.

The second route are the three decider/constant combinators below that. The decider comparer "everything" to the target output, e.g. copper, and outputs 1 if everything is greater than copper, i.e. copper has the lowest stock. To make sure all signals are present, and to break ties, the constant combinator adds one of each type except the target type, so if everything has equal amounts the target will be seen as smaller.

All the decider outputs are put together on the green wire, which is connected to the indicator lights and the smart inserters, all set on output type (e.g. copper) > 1. So, it will only activate if both conditions are met.

The chest setup translates the circuit information to the logistic network, with the smart inserter inserting the signal item into the chest if the condition is true. A normal inserter takes it out and the underground belt moves it back to the smart inserter.

Finally, the smart inserters at the smelter use the logistic signal to control insertion, and the iron plate inserter for the steel smelting also has a circuit network condition, ensuring that it inserts iron only if both the stock is too low and there are enough plates to insert a full batch.

All comments / feedback welcome! Especially a way to avoid the rocket symbols would be much appreciated...

Post Reply

Return to “Combinator Creations”

Who is online

Users browsing this forum: No registered users