Page 1 of 1

Dry Ore Patch Train Restrictor

Posted: Sun Oct 22, 2017 2:44 am
by SuicideJunkie
I've made a little self-resetting restrictor for my ore patches that should be generally useful, particularly on maps with many small ore patches.
Suggestions for improvement are welcome.

The goal is:
1) Require the station to have at least a Minimum amount ore collected before inviting trains to visit.
2) When the patch is completely dry, allow one more train to pick up the remaining ore before closing "forever".
3) If the patch isn't quite done and the electric drills get reshuffled to extract a wee bit more ore (due to terrain limitations or tree protection), then the system should reset automagically.
OrepatchRestrictor.png
Train Restrictor Logic
OrepatchRestrictor.png (223.65 KiB) Viewed 1117 times
Layout:
Top + : Wire up all the ore boxes to the adder. This adds EACH items to get a cumulative O-signal (ore), which means the blueprint works for any ore patch type without modification. Could be removed, if you are willing to do post-configuration or make multiple blueprints.
Upper *> : This is a direction detector which identifies whether the O has increased lately, and will latch a +1 output O if true.
Lower > : This is a secondary latch to latch the above +1 O.
Bottom * : Mulitply O by your minimum required ore (eg 1000), and output as M-signal (minimum required)
Stop : Enabled when raw O > M
Left side &=+ : Clock which outputs a Decrement signal every 1024 ticks. This will unlatch one (and only one) of the latches. If two Decrement pulses arrive before the next increment pulse, then the final latch resets and O goes to zero, setting the station to be open until dry since the latch O = 0.
Blueprint String

Re: Dry Ore Patch Train Restrictor

Posted: Thu Jul 11, 2019 12:28 pm
by waduk
This is EXACTLY what i need.
Thank you ! 😍

Re: Dry Ore Patch Train Restrictor

Posted: Thu Jul 11, 2019 1:45 pm
by mrvn
Why not simply wire up the last few belts before the buffer chest in read-only/hold mode and then enable the station when:

a) buffer chest >= train size
or
b) (buffer chest > 0) && (belts == 0)

You just have to test how many belt pieces you need to connect so one ore is present with just the last mining drill working.

Personally I just use a) alone and enable the station for the last partial load by hand when I deconstruct the mine.

Re: Dry Ore Patch Train Restrictor

Posted: Thu Jul 11, 2019 2:12 pm
by mmmPI
mrvn wrote:
Thu Jul 11, 2019 1:45 pm
Why not simply wire up the last few belts before the buffer chest in read-only/hold mode and then enable the station when:

a) buffer chest >= train size
or
b) (buffer chest > 0) && (belts == 0)
That's nice when you are sure that power is constant, if it runs too low like 25% for 5 minutes, the mine will output too slow so the station may turn on/off for every ore of the last couple mines.

The more complicated contraption allow for configuration of the equivalent of the belt lengh being read, which is the 1024 ticks counter which you could then use with robots.

Re: Dry Ore Patch Train Restrictor

Posted: Thu Jul 11, 2019 11:30 pm
by slippycheeze
mmmPI wrote:
Thu Jul 11, 2019 2:12 pm
mrvn wrote:
Thu Jul 11, 2019 1:45 pm
Why not simply wire up the last few belts before the buffer chest in read-only/hold mode and then enable the station when:

a) buffer chest >= train size
or
b) (buffer chest > 0) && (belts == 0)
That's nice when you are sure that power is constant, if it runs too low like 25% for 5 minutes, the mine will output too slow so the station may turn on/off for every ore of the last couple mines.

The more complicated contraption allow for configuration of the equivalent of the belt lengh being read, which is the 1024 ticks counter which you could then use with robots.
Don't forget the third critical problem, which is that if while you have power fade and the miners are slow, biters eat the train line causing trains to route the long way around, slowing down operations!

Re: Dry Ore Patch Train Restrictor

Posted: Fri Jul 12, 2019 12:15 am
by mmmPI
wuut ? i was more thinking like when lots of turrets fire at the end of the night during which you built roboports for example, it's annoying enough to have a power shortage even temporarily that if it transform on train deadlock everytime that might not be good :)

Also if using robots to fill in the chest, you can't rely on material being on a belt before to know if the outpost is depleted or not, another use for this contraption in case it wasn't clear.

I do agree that using belts reading is the most straightforward approach but it's not always possible :)

Re: Dry Ore Patch Train Restrictor

Posted: Fri Jul 12, 2019 2:17 pm
by slippycheeze
mmmPI wrote:
Fri Jul 12, 2019 12:15 am
wuut ? i was more thinking like when lots of turrets fire at the end of the night during which you built roboports for example, it's annoying enough to have a power shortage even temporarily that if it transform on train deadlock everytime that might not be good :)
Much better explanation of the problem. :)

I'd agree that you need a secondary backup if you use these strategies; an "or time idle > 300" on the trains would solve most of the deadlocking issues, unless you are assuming the rail system would deadlock if all stations enabled at once or something?

Re: Dry Ore Patch Train Restrictor

Posted: Mon Jul 15, 2019 10:07 am
by mrvn
mmmPI wrote:
Thu Jul 11, 2019 2:12 pm
mrvn wrote:
Thu Jul 11, 2019 1:45 pm
Why not simply wire up the last few belts before the buffer chest in read-only/hold mode and then enable the station when:

a) buffer chest >= train size
or
b) (buffer chest > 0) && (belts == 0)
That's nice when you are sure that power is constant, if it runs too low like 25% for 5 minutes, the mine will output too slow so the station may turn on/off for every ore of the last couple mines.

The more complicated contraption allow for configuration of the equivalent of the belt lengh being read, which is the 1024 ticks counter which you could then use with robots.
If it runs for 25% with 4 miners you still get the same ore as one miner running at 100%. So this would only affect mines with less than 4 miners. And worst that happens is an extra train is send. In your setup you also run into problems when the combinators loose power. Will it recover if some or all combinators run out?

But really? How many laser turrets do you have and how many aliens attack that your power drops from >100% to 25% for 5 minutes? You should really clear some space around your base to reduce the attacks. And build a lot more steam engines to produce power on demand.

Generally I try to keep my power production running at 50-75% of possible supply. If any more power is used then it's time to build more power.