Page 1 of 2

Conditional Lab Activation

Posted: Fri Feb 23, 2018 5:57 am
by Boldar
Hi,
i have searched quite a bit, but not found anything helpful:
I have built a large research Complex with Labs and beacons, and it is using about half of my total power consumption (modded game - Angels+Bobs and some minor mods).
So i am looking for a way to switch the complex on only when a research is actually in progress, but cannot find a way to get that information. Labs cannot be wired to the circuit network and i cannot think of another not too complicated way of getting this information. I think there might be a way using a seperate "Sensor" lab and an energy consumption detector, but there has to be some better way.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 6:22 am
by impetus maximus
if you have access to accumulators, i would use an SR latch.
Lab_SR_Latch.png
Lab_SR_Latch.png (69.66 KiB) Viewed 8927 times
[edit] the beacons should be on a different network from the labs but switch off with the labs. use the labs to draw from the accumulator.
blueprint string

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 8:27 am
by Engimage
Honestly I do not see other way than manually switching power off here. There is no way you can get info about science or labs at all.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 8:58 am
by darkfrei
PacifyerGrey wrote:Honestly I do not see other way than manually switching power off here. There is no way you can get info about science or labs at all.
It can be read with some mod and available with special constant combinator.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 9:10 am
by Caine
You can detect that an inserter is putting science into a lab. If you time the interval between insertions then you can detect when it exceeds some upper-bound to determine when research has stopped.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 10:14 am
by Engimage
Caine wrote:You can detect that an inserter is putting science into a lab. If you time the interval between insertions then you can detect when it exceeds some upper-bound to determine when research has stopped.
The point is if you disable power the whole research facility will not start again ever
Only if you make a standalone lab which will turn the resl of the complex on/off

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 10:39 am
by DaveMcW
Check the last chest or belt for science packs. If it has them, you know the rest of the labs have them too.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 10:44 am
by impetus maximus
labs don't have any 'drain'.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 10:58 am
by Deadly-Bagel
Ahah you know I was about to say that same thing but decided to read over the OP again - he's using a ton of Beacons, and they do have drain.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 11:04 am
by impetus maximus
Deadly-Bagel wrote:Ahah you know I was about to say that same thing but decided to read over the OP again - he's using a ton of Beacons, and they do have drain.
right, so that is what we need to switch off.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 11:47 am
by mrvn
Inserters have drain too.

So it makes sense to have one isolated lab which is always on with the inserter wired up to a count down clock. Every time the inserter has something in its hand you reset the clock. If the clock reaches 0 you turn off the remaining huge science complex.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 12:54 pm
by Engimage
mrvn wrote:Inserters have drain too.

So it makes sense to have one isolated lab which is always on with the inserter wired up to a count down clock. Every time the inserter has something in its hand you reset the clock. If the clock reaches 0 you turn off the remaining huge science complex.
PacifyerGrey wrote:Only if you make a standalone lab which will turn the resl of the complex on/off
Turning beacons on/off without touching labs is nearly impossible as power poles most likely intersect. Unless devs will finally implement circuit network connection for beacons...
So switching the whole facility is a way to go.
However introducing timer is not too accurate as research times will increase over time which means you will probably have labs working invane for quite a time after research is finished.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 1:36 pm
by Aeternus
PacifyerGrey wrote:
mrvn wrote:Inserters have drain too.

So it makes sense to have one isolated lab which is always on with the inserter wired up to a count down clock. Every time the inserter has something in its hand you reset the clock. If the clock reaches 0 you turn off the remaining huge science complex.
PacifyerGrey wrote:Only if you make a standalone lab which will turn the resl of the complex on/off
Turning beacons on/off without touching labs is nearly impossible as power poles most likely intersect. Unless devs will finally implement circuit network connection for beacons...
So switching the whole facility is a way to go.
However introducing timer is not too accurate as research times will increase over time which means you will probably have labs working invane for quite a time after research is finished.
Bit of a kludge but:
Have one extra lab, unboosted, outside of the main research cluster.
Use a 120 second timer to set the "power off" to the research cluster, excluding this one unboosted lab. Use an SR latch for this.
Set the Reset of the SR latch to trigger on any input, then hook it up to the inserter that is feeding the unboosted lab and set the inserter to read hand content in hold mode.

Effect: Shortly after starting a research the main labs will be kicked online when the unboosted lab gets fed. When research ends, the extra labs will shut off after at most a 120 second timeout.

Re: Conditional Lab Activation

Posted: Fri Feb 23, 2018 2:25 pm
by mrvn
I think you can improve on the timeout.

You still need one lab that runs all the time but don't connect to the inserter for that lab.

Instead connect to the belt(s) running into your science complex (before the always on lab) set to pulse mode and use that to reset the timeout.
If you also set your labs up with some labs chained to others you should get a lot more pulses than with just the inserter from a single lab.

Note: The chaining of labs is there to get and keep them out of sync. Otherwise you might get 1000 pulses close together with a 100s gap and science would shut down while needed till the always on lab reactivates it again.

Re: Conditional Lab Activation

Posted: Mon Feb 26, 2018 7:55 pm
by Boldar
That is an interesting approach i will try out. I am right now trying something like in the first answer, buit with a seperate lab where the power consumption is measured, but it still needs some tuning.

Re: Conditional Lab Activation

Posted: Tue Feb 27, 2018 9:49 am
by Deadly-Bagel
mrvn wrote:Note: The chaining of labs is there to get and keep them out of sync. Otherwise you might get 1000 pulses close together with a 100s gap and science would should down while needed till the always on lab reactivates it again.
Set Inserter Stack Size to 1, timeout can then be set to say 65s without chaining. Inserters will use a bit more power moving things around but it shouldn't be a massive difference compared to the energy making those Science Packs.

Re: Conditional Lab Activation

Posted: Wed Feb 28, 2018 4:34 am
by Boldar
I got a good working solution:
lab circuit.png
lab circuit.png (1.23 MiB) Viewed 8700 times
The single probe lab is connected to the power pole on the right. Basically, it detects power consumtion by falling signal levels in a accumulator. Do do so accurately it swaps it around - one accumulator is charged all the time and the other is discharged from, swapping at an interval (The circuit connected belts are the clock for this, there is an item circulating which is either on the top or on the bottom side. This is a clock which hardly looses timing on power loss)
The falling edge is then detected by comparing the level to a delayed signal and this pulse is then lengthened with the use of another belt loop. It is working really good. To make it work at night, the accumulator of course needs to be steam powered because the accumulators from the main network cannot charge the others, but in a modded game, this limitation can be overcome with electric boilers and a dedicated steam engine for this contraption. I can provide further information if anyone is interested.

Re: Conditional Lab Activation

Posted: Wed Feb 28, 2018 9:36 pm
by Enidras
Boldar wrote: (The circuit connected belts are the clock for this, there is an item circulating which is either on the top or on the bottom side. This is a clock which hardly looses timing on power loss)
The falling edge is then detected by comparing the level to a delayed signal and this pulse is then lengthened with the use of another belt loop. It is working really good. To make it work at night, the accumulator of course needs to be steam powered because the accumulators from the main network cannot charge the others, but in a modded game, this limitation can be overcome with electric boilers and a dedicated steam engine for this contraption. I can provide further information if anyone is interested.
Can't just replace your clock by a logic clock and some dedicated panels/accus?

Re: Conditional Lab Activation

Posted: Thu Mar 01, 2018 1:24 am
by MeduSalem
Hahaha...

it would be so much simpler if Twinsen would just add a circuit network signal to the labs which outputs if it is currently researching or not. Someone should probably tell them that this is an issue.


I tried so many times doing it with Circuit Network contraptions trying to measure the power draw or inserter movements and failed with it that I gave up on it honestly. I just let the beacons around the labs draw power even when idle and don't give much of a damn about it. The few beacons aren't the world anyway compared to the rest of the factory... and if it is due to mods then just switch them off manually or look for a mod that allows for circuit network connection to labs.

Hell, my roboports draw 200MW idle. What are a bunch of beacons around labs compared to that. Though I already consider rigging the "excess roboports" also to power gates that turn on when the affiliated factory module comes online, and otherwise leaving only a "backbone" of corner roboports always on to keep the logistic network without gaps.

Everything else in the factory is shut down though when idle, not only the beacons but even the machines and inserters. Don't give much of a damn to seperate the machines from the beacons. it's not possible to seperate them anyway due to power pole coverage overlapping with beacons/assemblers.

And honestly being able to switch off beacons over Circuit network would seem nice on paper, but wouldn't be of any more advantage than just shutting down the entire factory module including the machines and inserters. On the contrary... shutting down the entire factory module even kills the idle power draw of machines and inserters... so even more power is saved.

Re: Conditional Lab Activation

Posted: Thu Mar 01, 2018 10:20 am
by mrvn
If you want to turn off power for research because you don't have enough science packs then there is something much simpler that can be done:

Put all science packs into chests and then back onto belts to the science labs. Then enable the beacons when you have >100 science packs in each chest and disable them when you have 0.