Post by siggboy » Thu Jul 28, 2016 3:40 am

oil-contraption.gif (1.87 MiB) Viewed 5801 times

accu-cycle.png (350.45 KiB) Viewed 5801 times

blueprint Code: Select all H4sIAAAAAAAA/82W3W6bMBTHXyXiGk98bTedJ019gD1ANSEHnySWjG3ZpmqEePcdQ9IUGgKR2m1XTcP5/J3/OYTrjdQVk5uStqC88AIcbVvFaqBRpZXzTHlS 6XorFPPaRrHRDq20ou0LJVl8pKToYi4sVP23WYxe3mpZbuHAnoW2tN0J6cGGuE7sFZO09UeD8Z+F9Q2TUTykGx6Sx6jDGI3yNI2F4vBC064LXyk15MBAT1Ea /abt3gJgIUPlx1LwkF7YqhE+/BP80PPUDYdKcLDzzSRfvq5q5xSoxCdcnAraCet8ub69ASxNE/xcG2ZDOTT6HsW68aa5J5I5lj2tcmd1XQqF3tTbBlYjS5HQ DMAs4HuKsuBogY/c8gnp+EOHkf6VWfxEgg6C7x3AL+P6cde4ej6zI9sx6eZmNkU/O6Mrwy1G2JlzUG+lUHtSs+ogFJB8sgV54J6OueMnERrDRZaksg0HooUk W2YtYJvCQx22O/zFdg0AJ7XmjeyjD7tcvKnCYLBJ1jRkzW6ZJIsWyzGGNOlSmuRi4GqGLZumNu9zJUviPE/pVZz3aPMil9OtSCbaW38T85EGZsDdpJKNqVw3 eBtijls+5fbt/+WWj9csvgdpMQa2Y84ToRxYfBFONBlM0+4GBlwlKPWu1AawieB2qcwC4+WB4QEL/ligOx//FZnzIfNlGMVnVbHy7uRjZZzPDtTGHz/l7iQ9 gQWDxaNz0yAbG8wtRrakgn+8DPgiebsAabKwAPkSl2KNwWQ2xGtsCefKr9z1sXhW+b1zyxYGGdY+FlWPavJjNojwTP+dVLvXX7LxDbdB5xOXwGh4/EvIzWPQ BzOhpqh7sOAbqzblAyj+BzyTVjjKCwAA

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.