Creating a trigger when material ceases running on a belt
Creating a trigger when material ceases running on a belt
Hi!
(First post)
I've been trying to find a forum thread that explains belt counters in detail. I want to create a trigger for when the flow of materials on a belt completely ceases (the primary reason being to alert me when mines run out). The nearest I've come to a solution in the image below.
A, B & C are Arithmetic Combinators. D is a Decider Combinator. The input for A & B are the two belt counters, set on pulse (IE counts each passing object only once).
Combinator A is set to give a signal of +1, Combinator B is set to give a signal of -3 (I'll explain later). Each of their signals are sent to the input of Combinator C to hold the cumulative value (which is done by running a red wire from Combinator C’s output back into its own input). Decider Combinator D is set to output signal “Red” when the cumulative value in Combinator C falls. For the test I hooked up a light.
I encountered a number of problems, and problems with the numbers
1) Combinator A adds 3 to the count, instead of just 1. (This is why I have to set combinator B to -3)
2) A value of zero sends no signal. Therefore I've set the trigger to any value less than 10, which means you have to carefully prime the belt when you set up. However this doesn't work if the value suddenly becomes negative (which it obviously shouldn't).
3) Placing either of the belt counters directly adjacent to a corner, a splitter or an underground belt results in the belt counters occasionally missing items. (Found out through trial and error)
I've created a blueprint (attached) and nine out of ten times this is working, but now and then I get a belt that just wont behave. Any suggestions for how to improve this? Especially if it can be simplified.
(First post)
I've been trying to find a forum thread that explains belt counters in detail. I want to create a trigger for when the flow of materials on a belt completely ceases (the primary reason being to alert me when mines run out). The nearest I've come to a solution in the image below.
A, B & C are Arithmetic Combinators. D is a Decider Combinator. The input for A & B are the two belt counters, set on pulse (IE counts each passing object only once).
Combinator A is set to give a signal of +1, Combinator B is set to give a signal of -3 (I'll explain later). Each of their signals are sent to the input of Combinator C to hold the cumulative value (which is done by running a red wire from Combinator C’s output back into its own input). Decider Combinator D is set to output signal “Red” when the cumulative value in Combinator C falls. For the test I hooked up a light.
I encountered a number of problems, and problems with the numbers
1) Combinator A adds 3 to the count, instead of just 1. (This is why I have to set combinator B to -3)
2) A value of zero sends no signal. Therefore I've set the trigger to any value less than 10, which means you have to carefully prime the belt when you set up. However this doesn't work if the value suddenly becomes negative (which it obviously shouldn't).
3) Placing either of the belt counters directly adjacent to a corner, a splitter or an underground belt results in the belt counters occasionally missing items. (Found out through trial and error)
I've created a blueprint (attached) and nine out of ten times this is working, but now and then I get a belt that just wont behave. Any suggestions for how to improve this? Especially if it can be simplified.
- Attachments
-
- Mine empty alert system.txt
- Mine empty alert system
- (1.08 KiB) Downloaded 133 times
-
- Inserter
- Posts: 46
- Joined: Mon Oct 23, 2017 10:46 pm
- Contact:
Re: Creating a trigger when material ceases running on a belt
Not in a position to give you a blueprint just now, but:
Two decider combinators, one constant combinator.
Constant: T = 1
Decider 1: If [iron, copper, whatever] = 0, output T (input count)
Decider 2: If T > 60, output Red (1)
Wire a belt (read input, hold) to Decider 1's input with green wire.
Wire the constant combinator to Decider 1's input and output with red wire.
Wire Decider 1's output to Decider 2's input with green wire.
Decider 2 will now output 1 Red whenever the connected belt stays empty for at least 1s (60 ticks)
If you want it to alert on stalled (i.e., full but not moving) belts as well, change the belt read from 'hold' to 'pulse'
Adjust the value of Decider 2 as necessary to change the sensitivity.
Two decider combinators, one constant combinator.
Constant: T = 1
Decider 1: If [iron, copper, whatever] = 0, output T (input count)
Decider 2: If T > 60, output Red (1)
Wire a belt (read input, hold) to Decider 1's input with green wire.
Wire the constant combinator to Decider 1's input and output with red wire.
Wire Decider 1's output to Decider 2's input with green wire.
Decider 2 will now output 1 Red whenever the connected belt stays empty for at least 1s (60 ticks)
If you want it to alert on stalled (i.e., full but not moving) belts as well, change the belt read from 'hold' to 'pulse'
Adjust the value of Decider 2 as necessary to change the sensitivity.
Re: Creating a trigger when material ceases running on a belt
Circuit connect 5 consecutive belts to what ever output device you want, trigger for item=0.
- eradicator
- Smart Inserter
- Posts: 5211
- Joined: Tue Jul 12, 2016 9:03 am
- Contact:
Re: Creating a trigger when material ceases running on a belt
While circuits are great and awesome, and you should definetly use more of them... some problems have easier solutions: For flow-measuring without circuits, you can measure the content of a buffer chest. Though this will only work if the belt isn't moving at full speed:ozfoxaroo wrote: (the primary reason being to alert me when mines run out).
Author of: Belt Planner, Hand Crank Generator, Screenshot Maker, /sudo and more.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Mod support languages: 日本語, Deutsch, English
My code in the post above is dedicated to the public domain under CC0.
Re: Creating a trigger when material ceases running on a belt
Thanks! That worked a treat! Blueprint attached for anyone who needs it (500 is the number of ticks I've chosen, but it's at the user's discretion).thedarkbunny wrote:Not in a position to give you a blueprint just now, but:
Two decider combinators, one constant combinator.
Constant: T = 1
Decider 1: If [iron, copper, whatever] = 0, output T (input count)
Decider 2: If T > 60, output Red (1)
Wire a belt (read input, hold) to Decider 1's input with green wire.
Wire the constant combinator to Decider 1's input and output with red wire.
Wire Decider 1's output to Decider 2's input with green wire.
Decider 2 will now output 1 Red whenever the connected belt stays empty for at least 1s (60 ticks)
If you want it to alert on stalled (i.e., full but not moving) belts as well, change the belt read from 'hold' to 'pulse'
Adjust the value of Decider 2 as necessary to change the sensitivity.
Note: You must be specific about the commodity (iron in this case). I tried "Everything", "Anything" and "Each" signals but they didn't pass along the value of T.
Thanks, but I rarely have drills covering an entire ore deposit - too much concentrated pollution. The reason I'm creating an alert system is to let me know when it's time to re-position the drills.eradicator wrote:While circuits are great and awesome, and you should definetly use more of them... some problems have easier solutions:ozfoxaroo wrote: (the primary reason being to alert me when mines run out).
For flow-measuring without circuits, you can measure the content of a buffer chest. Though this will only work if the belt isn't moving at full speed:
The approach with the buffer chest was my first attempt before I moved on to combinators. I tried a few variations, including having the output inserter move much less than the input inserter, but even that resulted in having an empty chest too frequently.
- Attachments
-
- Mine empty alert system Mk2.txt
- (1001 Bytes) Downloaded 138 times
Re: Creating a trigger when material ceases running on a belt
Why not cover the whole ore patch but only use a yellow belt? Then only a few miners work at any time.
Re: Creating a trigger when material ceases running on a belt
Tried that in the past but still killed off trees and aggro'ed the locals.mrvn wrote:Why not cover the whole ore patch but only use a yellow belt? Then only a few miners work at any time.
Re: Creating a trigger when material ceases running on a belt
This approach has worked very well, but with one drawback: the decider combinator has to be set to whatever ore type is being mined. If it's not the ore in the blueprint then I need to wait for the bots to place the combinator before I can change it. That gets tiresome after a while.
Is there a way to configure the circuit using "Everything", "Anything" or "Each"? I've been experimenting but haven't had any luck; the combinator has reported "True" regardless of activity on the belt.
Is there a way to configure the circuit using "Everything", "Anything" or "Each"? I've been experimenting but haven't had any luck; the combinator has reported "True" regardless of activity on the belt.
- 5thHorseman
- Smart Inserter
- Posts: 1193
- Joined: Fri Jun 10, 2016 11:21 pm
- Contact:
Re: Creating a trigger when material ceases running on a belt
You could place the combnator yourself.ozfoxaroo wrote: ↑Sat Sep 21, 2019 8:40 pm This approach has worked very well, but with one drawback: the decider combinator has to be set to whatever ore type is being mined. If it's not the ore in the blueprint then I need to wait for the bots to place the combinator before I can change it. That gets tiresome after a while.
Re: Creating a trigger when material ceases running on a belt
Explain.5thHorseman wrote: ↑Sat Sep 21, 2019 10:12 pmYou could place the combnator yourself.ozfoxaroo wrote: ↑Sat Sep 21, 2019 8:40 pm This approach has worked very well, but with one drawback: the decider combinator has to be set to whatever ore type is being mined. If it's not the ore in the blueprint then I need to wait for the bots to place the combinator before I can change it. That gets tiresome after a while.
Re: Creating a trigger when material ceases running on a belt
Why not just wire up a few belt segments read-hold and bleat on everything = 0?
Re: Creating a trigger when material ceases running on a belt
Here you have a "dry ore patch train restrictor", it reads on chest, not on belts, but the use case described is quite similar : it can be used to detect if the miners on a patch needs to be moved ( run dry/ material ceases filling a chest ) , in this case it is used to manage a station open or close but maybe you could adapt it to trigger an alert instead.
viewtopic.php?t=53519
This other one uses many details to explain how to find the " moving average " on a belt, which can be 0 i guess, it was mentionned in the previous thread as an other solution.
viewtopic.php?t=51471
both are meant to be generic and don't require to be set to specific material if it helps having example to fiddle after.
Re: Creating a trigger when material ceases running on a belt
How to translate every signal to T:
-Use an arithmetic combinator
-Set input: "Each + 0"
-set output: "T"
-Use an arithmetic combinator
-Set input: "Each + 0"
-set output: "T"
- 5thHorseman
- Smart Inserter
- Posts: 1193
- Joined: Fri Jun 10, 2016 11:21 pm
- Contact:
Re: Creating a trigger when material ceases running on a belt
Place the blueprint, and then place the combinators exactly where they are in the placed blueprint. The game should place them with any settings from the blueprint.ozfoxaroo wrote: ↑Sun Sep 22, 2019 1:27 amExplain.5thHorseman wrote: ↑Sat Sep 21, 2019 10:12 pmYou could place the combnator yourself.ozfoxaroo wrote: ↑Sat Sep 21, 2019 8:40 pm This approach has worked very well, but with one drawback: the decider combinator has to be set to whatever ore type is being mined. If it's not the ore in the blueprint then I need to wait for the bots to place the combinator before I can change it. That gets tiresome after a while.
-
- Filter Inserter
- Posts: 365
- Joined: Mon Jul 03, 2017 9:14 am
- Contact:
Re: Creating a trigger when material ceases running on a belt
idling miners don't pollute since they have no drain.
Do you use efficienty modules?
This makes mining much easier.
I always use 3 Eff1 Modules on each miner and it reduces pollution by 80%.
Re: Creating a trigger when material ceases running on a belt
Worked it out. A new combinator is needed in the circuit so that the T counter is interrupted whenever [Everything] != 0 . IE any resource is passing through the belt counter.
Pros: Increased yield in each ore/stone patch, less time spent constructing and demolishing mines
Cons: Slower mining, greatly increased pollution, resources spent on manufacturing the modules
My approach means far slower progress in creating the infrastructure, but the advantage manifests in the later stages of the game where far less time is spent setting up new mines and decommissioning them. Once a sufficient number of mines are up and running there's no longer an issue with how slow each individual drill runs. I keep the pollution under control by limiting the number of drills operating in a given area.
I use 3 x Mark 3 Productivity modules because I'm a skinflint.JimBarracus wrote: ↑Mon Sep 23, 2019 7:57 amidling miners don't pollute since they have no drain.
Do you use efficienty modules?
This makes mining much easier.
I always use 3 Eff1 Modules on each miner and it reduces pollution by 80%.
Pros: Increased yield in each ore/stone patch, less time spent constructing and demolishing mines
Cons: Slower mining, greatly increased pollution, resources spent on manufacturing the modules
My approach means far slower progress in creating the infrastructure, but the advantage manifests in the later stages of the game where far less time is spent setting up new mines and decommissioning them. Once a sufficient number of mines are up and running there's no longer an issue with how slow each individual drill runs. I keep the pollution under control by limiting the number of drills operating in a given area.
-
- Filter Inserter
- Posts: 365
- Joined: Mon Jul 03, 2017 9:14 am
- Contact:
Re: Creating a trigger when material ceases running on a belt
interesting.ozfoxaroo wrote: ↑Mon Sep 23, 2019 11:38 am My approach means far slower progress in creating the infrastructure, but the advantage manifests in the later stages of the game where far less time is spent setting up new mines and decommissioning them. Once a sufficient number of mines are up and running there's no longer an issue with how slow each individual drill runs. I keep the pollution under control by limiting the number of drills operating in a given area.
I think, that letting the miners back up would be much better.
Pollution seems to be a problem for you, but having 30% more output for the pollution of 4 miners seems very inefficient.
Compared to 3xEff1 miners it gets even worse.
One of your miners produces as much pollution as 17 "clean" miners. Thats just insane.
Should be far more effective to invest in mining productivity.
Anyway setting yourself rules makes the gameplay interesting.
Re: Creating a trigger when material ceases running on a belt
I'd sooner fire all those resources you spent on productivity modules into repeated +Mining Productivity research, which is a. free for every miner once researched, b. doesn't come with any kind of penalty at all, and c. very rapidly drowns out the bonus from productivity modules.ozfoxaroo wrote: ↑Mon Sep 23, 2019 11:38 am I use 3 x Mark 3 Productivity modules because I'm a skinflint.
Pros: Increased yield in each ore/stone patch, less time spent constructing and demolishing mines
Cons: Slower mining, greatly increased pollution, resources spent on manufacturing the modules
My approach means far slower progress in creating the infrastructure, but the advantage manifests in the later stages of the game where far less time is spent setting up new mines and decommissioning them. Once a sufficient number of mines are up and running there's no longer an issue with how slow each individual drill runs. I keep the pollution under control by limiting the number of drills operating in a given area.
Re: Creating a trigger when material ceases running on a belt
Like I said, I limit the number of drills operating in a given area. All my drills are linked in sequence using the below blueprints. As each drill is depleted, the next one in sequence begins mining.JimBarracus wrote: ↑Mon Sep 23, 2019 12:35 pminteresting.
I think, that letting the miners back up would be much better.
Pollution seems to be a problem for you, but having 30% more output for the pollution of 4 miners seems very inefficient.
Compared to 3xEff1 miners it gets even worse.
One of your miners produces as much pollution as 17 "clean" miners. Thats just insane.
Should be far more effective to invest in mining productivity.
Anyway setting yourself rules makes the gameplay interesting.
Already researched up to mining productivity 16 and still going. I grab every bit of extra ore I can get my hands on.foamy wrote: ↑Mon Sep 23, 2019 8:05 pmI'd sooner fire all those resources you spent on productivity modules into repeated +Mining Productivity research, which is a. free for every miner once researched, b. doesn't come with any kind of penalty at all, and c. very rapidly drowns out the bonus from productivity modules.