Schematics (Trash) - rain9441/factorio-tls GitHub Wiki

https://github.com/rain9441/factorio-tls/blob/master/screenshots/12-trash-schematics.png Link to Image

The Trash system may be the largest system, but it isn't necessarily as complex as the other systems. It uses a some of the same wires and connections as the Unloader to determine what to trash.

The right roboport (P2) is configured to read the robot statistics (but only total bots as their respective item) and is combined with a few other sources in the Unloader. The R1 wire contains the number of bots in the roboport network, in the hand of the stack inserters feeding it, as well as in the steel buffer chest in queue. C12 is a constant combinator setup with the (negative value of) minimum number of bots to keep in the system while trashing, outputted to G2. R1 and G2 are combined into D3 which combines and filters negative values out. This gives us the number of bots in the system minus how many we want to keep. The R2 wire is pulled off the Alpha Network and it contains all of the items requested by the TLS Unloader. R2 is connected to A4, an arithmetic combinator that multiplies the value by -1 as a subtraction support combinator. This is output along with the D3 combinator above into G3, which is the number of extra bots in the system. G3 is sent to four stack filter inserters (F11) which pull bots from the roboports P1 and P2 and push them into active provider chests.

The R2 wire is also connected to A6, which applies the trash threshold by adding 100 to all items requested by the TLS system. This value is put into R4 and connected to A8, another subtraction support combinator. The negative value is put into R3. This is effectively the (negative) number of each item we want to keep in the system.

The C13 combinator is the configurable black list for the trash system. It is pushed into G5 which is connected to A7, an arithematic combinator that multiples each signal by -1,000,000. This value is put into R3 as well, which is the (negative) number of each of those items we want to keep in the system.

R3 is combined with G1, which is the contents of the logistic storage system, and sent to a decider combinator (D5) which combines and filters any negative values out. This value is output to G4, which is the number of items we want to trash from the system (What we have minus what we want to keep minus all of what we want to black list). This value is sent to an arithematic combinator (A9) that divides the requests across four requester chests (output to G6). G4 is also sent to a decider combinator (D10), which sends 1 for each type whose value is less than 4, to the R5 wire. The R5 wire connects to one of the trash requester chests (R21). Because of the fact that integer division rounds down, any quantity of item less than 4 will be 0 on the G6 wire, so we put those items directly into the right most trash requester chest directly (R21) to clean up any miscellaneous items that may be at the outpost. The C14 constant combinator holds the white list (by default it contains both bots) which is also sent to the G6 wire. The G6 wire is connected to all of the requester chests (R21) and causes items to be requested to be trashed. Stack inserters (I22) are in place to transfer items from the requester chests (R21) to steel chest buffers (B23) that hold all of the items to be loaded into the train by stack inserters (I24).

The contents of the steel chest buffers (B23) are all output into the G7 wire, which holds the contents that are awaiting trash train pickup. This value is sent to the decider combinator (D20), which outputs E=1 if Anything>0. This output is the request to enable the train station, and is sput on the R7 wire, which connects to an arithmetic combinator (A19) that multiples the value with green from the Beta Network (G9) similar to the way the Train Stop system works above. The arithmetic combinator (A19) outputs E=1 to the RS Latch (D16), which is connected to T15 in the same fashion as the Train Stop system above.