Best way to reduce lag from generators turning on and off (Or any other interesting solutions)

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here
  • The FTB Forum is now read-only, and is here as an archive. To participate in our community discussions, please join our Discord! https://ftb.team/discord

Nephrahim

New Member
Jul 29, 2019
24
0
0
I've run into a problem in my base that has just... befuddled me. Googling it has turned up no good answers, so I figured I'd just toss it out here.

I'm playing FTB Beyond, running my base on a Diesel Generator using Diesel fuel from Immersive Petroleum (I added it) The generator feeds into an Ender IO Capacitor bank that fuels most of my base, including the Distillation tower (There's a second generator dedicated for extractors, on a separate system) Until recently, I was using HV Capacitors for all my power generation needs, but recently I've started to rrun into power limits so I'm upgrading to the Ender IO stuff.

THE PROBLEM: In order to conserve power, I had a Redstone Comparator attached to my HV Capacitor to emit a signal when the power got above an ammount, to turn off the Diesel generator and save fuel. This worked fairly well, as the signal only output every few seconds. After switching to the Ender IO capacitor bank though, I've noticed the signal shuts on and off WAY WAY FASTER, maybe at the tick rate of the server, and is causing MASSIVE lag.

I don't like my Generator running forever since it means I'll just have to find more sources of fuel, but as it is I don't see if there's any other way. I wish there was way to have the generator turn ON when the bank hit a certain ammount but then turn back off once it was full, but I don't know any way to do that, or if it's even possible, or any other way around this problem, other then to just use all the fuel and then later find more.

Thanks in advance!
 

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
I've run into a problem in my base that has just... befuddled me. Googling it has turned up no good answers, so I figured I'd just toss it out here.

I'm playing FTB Beyond, running my base on a Diesel Generator using Diesel fuel from Immersive Petroleum (I added it) The generator feeds into an Ender IO Capacitor bank that fuels most of my base, including the Distillation tower (There's a second generator dedicated for extractors, on a separate system) Until recently, I was using HV Capacitors for all my power generation needs, but recently I've started to rrun into power limits so I'm upgrading to the Ender IO stuff.

THE PROBLEM: In order to conserve power, I had a Redstone Comparator attached to my HV Capacitor to emit a signal when the power got above an ammount, to turn off the Diesel generator and save fuel. This worked fairly well, as the signal only output every few seconds. After switching to the Ender IO capacitor bank though, I've noticed the signal shuts on and off WAY WAY FASTER, maybe at the tick rate of the server, and is causing MASSIVE lag.

I don't like my Generator running forever since it means I'll just have to find more sources of fuel, but as it is I don't see if there's any other way. I wish there was way to have the generator turn ON when the bank hit a certain ammount but then turn back off once it was full, but I don't know any way to do that, or if it's even possible, or any other way around this problem, other then to just use all the fuel and then later find more.

Thanks in advance!
The EnderIO power monitor may be your friend here - that can be configured to emit redstone when the power in a capacitor bank is below a certain percentage, or when it is above a certain percentage. I'm not sure if you can have two, but if you can, I have an idea. Imagine you wanted to keep it between 20% and 80%. One monitor is set to emit redstone below 20%, and the other is set to emit redstone at above 80%; both of these then go into their own single-pulse forming thing, and have the pulses go into a toggle latch - the output of that goes to your engines.

So: you get a single pulse from one monitor when it hits below 20%, which switches it on. As the power goes above 20%, that monitor stops emitting redstone, but that's OK. Likewise, when it gets to 80%, that triggers a second pulse, which toggles the latch and turns the engines off. The first monitor won't get toggled again until it gets back down to 20%, and likewise for the 80% one.

Would that work do you think? The only issue is getting something to just pulse once, not sure how you'd do that.
 

SevenMass

Well-Known Member
Jan 2, 2013
283
137
69
The Netherlands
The EnderIO power monitor has a build-in Schmitt trigger, you can set it to turn on a redstone signal below a certain % and turn it off above a certain %.(or the other way around) Only one power monitor is needed.

"Schmitt trigger", or "Hysteresis circuit" are names for the type of circuit function you are looking for here.
 

GamerwithnoGame

Over-Achiever
Jan 29, 2015
2,808
1,507
224
The EnderIO power monitor has a build-in Schmitt trigger, you can set it to turn on a redstone signal below a certain % and turn it off above a certain %.(or the other way around) Only one power monitor is needed.

"Schmitt trigger", or "Hysteresis circuit" are names for the type of circuit function you are looking for here.
Oh can you set two thresholds??? Well, never mind then! :)

EDIT: I feel like I remember DW20 having to do some shenanigans to get his systems to behave the way he wanted without flickering redstone; was that just him being a derp and its actually really simple? I'm just thinking about the logistics of it, because the wiki entry only mentions about emitting signal when below or above certain percentages, and not about actively turning them off (as opposed to it turning off when the condition is no longer met).

So imagine you've got it set to turn redstone on, to switch your engines on, at below 20%. That's great, your level drops and the engines go on. Now when it rises above 20%, according to that condition, the redstone will switch off again, right? Running the risk of flickering. As I'm reading it, it won't remember that state within the Monitor itself - it will emit or not emit depending on the condition at the time. Meaning that you can't have a second condition to turn the redstone off above a certain percentage because it will already be off, won't it?


EDIT 2: Scratch that, the wiki is just badly written by the looks of it - having seen a pic of the GUI where it specifies that it can stop emitting when the storage is XX% full, that makes complete sense. *grumbles*
 
Last edited:

Inaeo

New Member
Jul 29, 2019
2,158
-3
0
Indeed, the Power Monitor is a powerful beast. Make sure to set the top threshold with a bit of space (85-90% depending on the capacity of the bank) since the generators will likely burn whatever fuel they are actively consuming (but not burn additional fuel) before stopping. Otherwise, you're wasting a bit of fuel.

If you have several power gen options available (or even just several generators), you could use a few Power Monitors to make them turn on in sequence at different thresholds. For instance, generator one turns on at 50% and kicks off at 90%, and this is the backbone of your passive drain. Generator two runs kicks on at 45% and shuts off at 75%, thus only activating when power drain is pulling harder than the first can keep up with. A third option kicks on at 10% and kicks off at 50%, and functions as backup power. These are all generalized numbers, of course, and should be suited to your particular setup, but I find this system helps provide consistent power through ebbs and flows of demand, to conserve fuel, and to minimize the lag of machines starting and stopping every other second.
 
  • Like
Reactions: GamerwithnoGame

Nephrahim

New Member
Jul 29, 2019
24
0
0
Awesome! Exactly what I wanted to know! This is why I asked, I NEVER would have found that out by myself!

And yes, the multi-generator solution was absouletely what I was trying to figure too, but I've been having trouble finding things that give me enough power. I'm running a few Dynamos to combat passive drain but they're such a drip...
 
  • Like
Reactions: GamerwithnoGame

Inaeo

New Member
Jul 29, 2019
2,158
-3
0
My early game power is a self-sustaining Arboreal Extractor setup, that I've managed to upgrade a bit as I've moved along. I'm still on the brink of early-mid game (I've intentionally pushed off going to the Nether, which limits some choices). I'm finding the setup to be more than enough power for now, even during peak usage, and I hope it will work as a counter to passive drain as I move forward. There are still ways I think I can optimize the system as I push forward, so I have hope it can shoulder most of the burden.

I've been digging through @rhn 's thread in the Community Showcase trying to find his setup using multiple power systems working off Power Monitors, but I keep getting lost in amazement along the way. I know he's used the same type of setup on at least two worlds, but I'll be damned if I can find the details. If you've not read through it, it's truly fantastic stuff, and he does a good job of explaining his systems and then blending them into beautiful builds.
 
  • Like
Reactions: GamerwithnoGame