zebediah49 wrote:Here's my proposal: build a sawtooth generator for the range 1-100 -- pick a signal, and then
- a constant combinator feeds a '1' into
- an arithmetic combinator that is configured as an integrator (one output feeds back into its input; math operation does nothing but return input to output -- +0 or *1)
- a decider combinator feeds in '-100' if the output is greater than 100
This can be done easier (and then you don't have to worry about tick delay):
Decider combinator that does: "C < 100 => Output C (input count)"; loop the output back to the input
Constant combinator with "C = 1" (or the step increase that you want, e.g. put "C = 4" if you want to increase the counter in steps of 4); connect it to any of the inputs of the decider.
This is a clock that loops through 100 and then resets (what you correctly call a Sawtooth generator).
If you want to slow down the clock you can simply divide the output by any number.
BTW I like the rest of your setup with the dummy load to get an ingame graph, great idea.
Bomaz wrote:I would like to ensure that I don't risk running out of charge in my accumulators. The easiest way to do that would be to have a graph that shows the accumulator charge over time (possibly as a % of the max charge) is there any mod (or even part of the base game) that adds that?
Maybe it would already help you to have a running average of the accumulator charge level, with a very long averaging period. It's like one of those graphs you see on stock trading websites, where they have a 200 day average graph overlaid to the spiky daily trading graph, that shows you the long term trends.
You can make something like it with only 4 combinators. The output will show you the long-term average of the accumulator level. If that number is low, it means you've been dropping low recently, if it's high it means everything is good.
Of course it won't protect you from blackouts or anything, but it's a good measure for the general "health" level of the accumulators. You need a mod to display the readout, if you use Smart Display you can even have the readout show up on the map (as a label like a train station), so you can look at it from anywhere (or you put the signal on a wire and put a readout into your factory).
Here's the contraption:

- Capture.PNG (152.17 KiB) Viewed 6938 times
The top two combinators are just for initializing so you won't have to wait for the readout to ramp up to 100 when you connect it.
The middle two combinators do the counting and averaging. It's difficult to explain, but basically the accumulator keeps outputting its charge level every tick to the counter (decider in the middle), and the combinator below the decider subtracts a small fraction of the counter each tick (1/3000 of the counter value in this setup, you can't see this). That basically means that over 3000 ticks it will have subtracted the counter value from the counter. This will mean that the counter value slowly creeps to the average value that was input each tick.
The combinator to the right divides the counter value by 3000 and outputs it -- that's the average accumulator level each tick, averaged over a long period.
If you need shorter periods you can decrease the "3000" to a lower level (you also need to adapt the constant in the reset circuit, it needs to be that number divided by 2).
The constant combinator simply resets the counter to the current accu level when you want to start measuring. Turn it on and off again.
Blueprint has no accu but a combinator instead. Blueprint string fails if there's an accu in it, probably a bug. Smart Display is not included either, to keep it compatible with Vanilla.