Conditional Lab Activation

Don't know how to use a machine? Looking for efficient setups? Stuck in a mission?
Boldar
Inserter
Inserter
Posts: 26
Joined: Sun Dec 14, 2014 7:55 pm
Contact:

Conditional Lab Activation

Post 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.

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Conditional Lab Activation

Post 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 7394 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

Engimage
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: Conditional Lab Activation

Post 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.

User avatar
darkfrei
Smart Inserter
Smart Inserter
Posts: 2903
Joined: Thu Nov 20, 2014 11:11 pm
Contact:

Re: Conditional Lab Activation

Post 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.

Caine
Fast Inserter
Fast Inserter
Posts: 213
Joined: Sun Dec 17, 2017 1:46 pm
Contact:

Re: Conditional Lab Activation

Post 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.

Engimage
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: Conditional Lab Activation

Post 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

User avatar
DaveMcW
Smart Inserter
Smart Inserter
Posts: 3699
Joined: Tue May 13, 2014 11:06 am
Contact:

Re: Conditional Lab Activation

Post 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.

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Conditional Lab Activation

Post by impetus maximus »

labs don't have any 'drain'.

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Conditional Lab Activation

Post 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.
Money might be the root of all evil, but ignorance is the heart.

User avatar
impetus maximus
Smart Inserter
Smart Inserter
Posts: 1299
Joined: Sat Aug 20, 2016 10:07 pm
Contact:

Re: Conditional Lab Activation

Post 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.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Conditional Lab Activation

Post 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.

Engimage
Smart Inserter
Smart Inserter
Posts: 1067
Joined: Wed Jun 29, 2016 10:02 am
Contact:

Re: Conditional Lab Activation

Post 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.

Aeternus
Filter Inserter
Filter Inserter
Posts: 835
Joined: Wed Mar 29, 2017 2:10 am
Contact:

Re: Conditional Lab Activation

Post 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.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Conditional Lab Activation

Post 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.
Last edited by mrvn on Tue Feb 27, 2018 10:05 am, edited 1 time in total.

Boldar
Inserter
Inserter
Posts: 26
Joined: Sun Dec 14, 2014 7:55 pm
Contact:

Re: Conditional Lab Activation

Post 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.

User avatar
Deadly-Bagel
Smart Inserter
Smart Inserter
Posts: 1498
Joined: Wed Jul 13, 2016 10:12 am
Contact:

Re: Conditional Lab Activation

Post 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.
Money might be the root of all evil, but ignorance is the heart.

Boldar
Inserter
Inserter
Posts: 26
Joined: Sun Dec 14, 2014 7:55 pm
Contact:

Re: Conditional Lab Activation

Post by Boldar »

I got a good working solution:
lab circuit.png
lab circuit.png (1.23 MiB) Viewed 7167 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.

Enidras
Burner Inserter
Burner Inserter
Posts: 7
Joined: Sat Dec 30, 2017 3:30 pm
Contact:

Re: Conditional Lab Activation

Post 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?

User avatar
MeduSalem
Smart Inserter
Smart Inserter
Posts: 1475
Joined: Sun Jun 08, 2014 8:13 pm
Contact:

Re: Conditional Lab Activation

Post 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.

mrvn
Smart Inserter
Smart Inserter
Posts: 5682
Joined: Mon Sep 05, 2016 9:10 am
Contact:

Re: Conditional Lab Activation

Post 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.

Post Reply

Return to “Gameplay Help”