Drawing a graph of any signal in the production statistics
Posted: Thu Jul 28, 2016 3:40 am
So there was the question in this thread (29735) of how to show the accumulator charge over time, as a graph.
And zebediah49 had the great idea of creating a PWM signal from the input (accumulator level in this case), then use the PWM signal to toggle a power switch to create a power usage graph of an isolated power network. That graph basically traces the original input signal.
That's a bit awkward for actual use, because you need to be close to the (isolated) power network to be able to click on a power pole and inspect the graph.
Then I had the idea "why not use the production graph?" After all, there is one item that you can produce and consume endlessly: Oil Barrels.
The combinators at the top create the PWM signal (Zebediah's idea). It's simply a looping counter and a decider that outputs a "1" when the reference signal is greater than the counter value. So, the output goes between "1" and "0", and the periods of "1" are longer, the higher your reference signal is.
So it turns an arbitrary input signal into a PWM "encoding" of it. Then you can use the PWM signal to control something else, for example a pump.
The two assemblers just produce and consume oil barrels endlessly. There are 10 barrels in the loop, which is enough to keep the machines working as long as the oil is flowing. The Fast Inserters are also fast enough.
So the bottleneck is the oil, which we use to slow down the production. The three pumps transport up to 90 oil/second, the assemblers could theoretically process ~93 oil/second. So, if we're slowing down the pumps, we already slow down the machines.
The PWM signal is simply used as the pump control, so the pumps can be regulated from 0% to 100%, with some granularity, and the resulting Oil Barrel consumption/production immediately follows. Because the machines are sped up to 300% and feeding directly into eachother, the contraption reacts really fast to any change of the pump speed.
When creating the PWM signal, I'm using a clock with a cycle of 10 ticks, so the period of the PWM signal is 10 ticks, and the inputs can take values from 0 to 10 (an accumulator readout would have to be divided by 10 to be compatible).
I've created a small solar array with a dummy load, and put it through two day/night cycles, here's how it looks in the production graph (for the second cycle I've removed a few accus to make them drain to zero):
Of course you could graph all others sorts of long-term trends with this: train throughput, coal bunker at the power plant, oil storage...
The only downside is that you can't transport oil in barrels anymore, as that would ruin the graph. Rail Tanker I guess . Of course, if all the liquids become barreable, then you could everything except oil, and even have multiple graphs of different things.
And the production statistics are available anywhere, anytime, and can show very long-term trends up to 50h.
And zebediah49 had the great idea of creating a PWM signal from the input (accumulator level in this case), then use the PWM signal to toggle a power switch to create a power usage graph of an isolated power network. That graph basically traces the original input signal.
That's a bit awkward for actual use, because you need to be close to the (isolated) power network to be able to click on a power pole and inspect the graph.
Then I had the idea "why not use the production graph?" After all, there is one item that you can produce and consume endlessly: Oil Barrels.
The combinators at the top create the PWM signal (Zebediah's idea). It's simply a looping counter and a decider that outputs a "1" when the reference signal is greater than the counter value. So, the output goes between "1" and "0", and the periods of "1" are longer, the higher your reference signal is.
So it turns an arbitrary input signal into a PWM "encoding" of it. Then you can use the PWM signal to control something else, for example a pump.
The two assemblers just produce and consume oil barrels endlessly. There are 10 barrels in the loop, which is enough to keep the machines working as long as the oil is flowing. The Fast Inserters are also fast enough.
So the bottleneck is the oil, which we use to slow down the production. The three pumps transport up to 90 oil/second, the assemblers could theoretically process ~93 oil/second. So, if we're slowing down the pumps, we already slow down the machines.
The PWM signal is simply used as the pump control, so the pumps can be regulated from 0% to 100%, with some granularity, and the resulting Oil Barrel consumption/production immediately follows. Because the machines are sped up to 300% and feeding directly into eachother, the contraption reacts really fast to any change of the pump speed.
When creating the PWM signal, I'm using a clock with a cycle of 10 ticks, so the period of the PWM signal is 10 ticks, and the inputs can take values from 0 to 10 (an accumulator readout would have to be divided by 10 to be compatible).
I've created a small solar array with a dummy load, and put it through two day/night cycles, here's how it looks in the production graph (for the second cycle I've removed a few accus to make them drain to zero):
Of course you could graph all others sorts of long-term trends with this: train throughput, coal bunker at the power plant, oil storage...
The only downside is that you can't transport oil in barrels anymore, as that would ruin the graph. Rail Tanker I guess . Of course, if all the liquids become barreable, then you could everything except oil, and even have multiple graphs of different things.
And the production statistics are available anywhere, anytime, and can show very long-term trends up to 50h.
blueprint