Power Control Suggestion? (Computer craft or ?)

  • Please make sure you are posting in the correct place. Server ads go here and modpack bugs go here

XLT_Frank

New Member
Jul 29, 2019
157
0
0
I have a few stacks for power generation that I am wanting to automate. Attached is a picture of what they look like and I thought I would install a Redstone Energy Cell on top of each stack. When the cell depletes below 25%, the stack of engines below it will turn on and run until 100%. This is phase one.

Phase two will involve computer craft I am sure of that (or maybe player detection modules) to shed power to equipment that is non essential.

Thoughts on the best method for the engine control? I am not good with Computer Craft even though I program. It is a bit different then only school that I am used to using.

2014-04-13_09.32.55 - Copy.png


Thanks!
Frank
 

Wagon153

New Member
Jul 29, 2019
3,148
-3
1
Ender IO has a pretty good power controller(although you would need to replace your conduits with the Ender IO ones and use Ender IO capacitor banks for best results). You can set it to emit redstone when power levels are either above or below a certain amount, and will also tell you the total amount of power in your system, including in the conduits.
 
  • Like
Reactions: Padfoote

XLT_Frank

New Member
Jul 29, 2019
157
0
0
I should have said that I am on a Direwolf20 1.0.20 configured server, so no Ender IO.

Sent from my Galaxy Nexus using Tapatalk
 

Wagon153

New Member
Jul 29, 2019
3,148
-3
1
Well in that case, you can use a comparator to tell if the cell is full. And energy cells make block update detectors go nuts when either full or empty I think if you wanna put that to use.
 

XLT_Frank

New Member
Jul 29, 2019
157
0
0
So the engines would always try to maintain 100%, correct? I think I just need to bite down on the computer craft bullet.
 

Dreossk

New Member
Jul 29, 2019
218
0
0
With OpenPeripheral you can monitor an energy cell and do that. You can also detect players but the range is pretty small so it might turn off your machine if you leave it but you could just put more detectors. All that is in DW20.
 

YX33A

New Member
Jul 29, 2019
3,764
1
0
So the engines would always try to maintain 100%, correct? I think I just need to bite down on the computer craft bullet.
Only if you have them to run all when it's not at 100%. Some wise usage of Comparators would allow you to throttle down when you are getting full by shutting off engines, and at max power, you could shut down everything.
 

YX33A

New Member
Jul 29, 2019
3,764
1
0
How compact can I make it with comparators?

Sent from my Galaxy Nexus using Tapatalk
Use two comparators, one for the "Alpha", or Input cell, and one for a "Omega", or a Cell that gets fed off of every other cell and nothing else. If the "Alpha" Cell is empty but the "Omega" cell is full, it's the same as if both are empty. The more full the Alpha Cell is, the higher the signal from the Comparator will be, so feed this info into something that pays attention to these things(I suggest a MFR Computer Cube Thingy since simple logic is easy to use). Higher Input from the "Alpha Cell" means run less engines. The "Omega" cell comparator is technically not needed if the "Alpha Cell" provides power for your whole power storage network(that is, all power goes into it before going to any other power storage you have).
 

XLT_Frank

New Member
Jul 29, 2019
157
0
0
Use two comparators, one for the "Alpha", or Input cell, and one for a "Omega", or a Cell that gets fed off of every other cell and nothing else. If the "Alpha" Cell is empty but the "Omega" cell is full, it's the same as if both are empty. The more full the Alpha Cell is, the higher the signal from the Comparator will be, so feed this info into something that pays attention to these things(I suggest a MFR Computer Cube Thingy since simple logic is easy to use). Higher Input from the "Alpha Cell" means run less engines. The "Omega" cell comparator is technically not needed if the "Alpha Cell" provides power for your whole power storage network(that is, all power goes into it before going to any other power storage you have).

I like this as this would be great for a "battery" bank. I think this may be something good for another phase of my power generation project.

I finally found some good nuggets of info and at the top of each power stack will be a energy cell with a wireless turtle. The turtle for now will read the energy cell and run the following code I found here:http://wiki.technicpack.net/Open_Peripheral

Code:
rec = peripheral.wrap("top")
while(true) do
  powerLevel = rec.getEnergy()
  if(powerLevel<(rec.getMaxEnergy()/2)) then
    redstone.setOutput("left", true)
    print("Energy low!")
  else
    redstone.setOutput("left", false)
    print("Energy ok")
  end
os.sleep(1)
end

Once I verify that it works, I will then look at more advanced coding. Something like turning on 4 of the 16 engines unless the depletion over time is too great and start turning more on.

Each of these will be the same. Later I will add a computer and monitor for feedback.
 

namiasdf

New Member
Jul 29, 2019
2,183
0
0
The game is more conducive to energy sinks than energy control. Once you get your initial set of energy, begin doing things a lot more efficiently (time and resource wise) you can begin to expand your energy production cycle, for very little opportunity costs, since you will probably have a large excess of materials anyways.

The two main energy sinks are matter fabs and laser drill. Look into either. If you want more details, I can explain further.
 

namiasdf

New Member
Jul 29, 2019
2,183
0
0
I would take out the print line. You will have outputting a message every second, which is kinda bad.

I don't know if it is less resource intensive (in terms of computing), you could use a logic gate to tell the computer when the energy is empty and when the energy is full. I am not sure if running a while loop that checks every second is the same as a BC gate detecting energy levels. Though, I suspect that BC might be optimized to allow for continuous monitoring via gate. I am not sure if CC is designed to be optimized for this task.
 

XLT_Frank

New Member
Jul 29, 2019
157
0
0
I would take out the print line. You will have outputting a message every second, which is kinda bad.

I don't know if it is less resource intensive (in terms of computing), you could use a logic gate to tell the computer when the energy is empty and when the energy is full. I am not sure if running a while loop that checks every second is the same as a BC gate detecting energy levels. Though, I suspect that BC might be optimized to allow for continuous monitoring via gate. I am not sure if CC is designed to be optimized for this task.

The print statement is for debugging/testing.

I had read somewhere that BC gates do not monitor cells properly. I am going to optimize this a bit more and put more delay in the loop.
 

namiasdf

New Member
Jul 29, 2019
2,183
0
0
Well think about it this way. What is the minimum time it takes for half the REC to be drained @ 100 MJ/t. That should be your delay x2. If you are checking the energy approximately when a quarter of it can empty, I think you should be safe.

100 MJ/t is crap when you progress further, so this much work for a single REC might be overkill. Just my two bits.
 

XLT_Frank

New Member
Jul 29, 2019
157
0
0
Well think about it this way. What is the minimum time it takes for half the REC to be drained @ 100 MJ/t. That should be your delay x2. If you are checking the energy approximately when a quarter of it can empty, I think you should be safe.

100 MJ/t is crap when you progress further, so this much work for a single REC might be overkill. Just my two bits.

I see your point. I know it is overkill but I am replicating this for each of my powerstacks. I plan then use the wireless modem to send data to a computer and monitor for a cool status.
 

namiasdf

New Member
Jul 29, 2019
2,183
0
0
If you are playing on a multiplayer server, you will benefit greatly from having an energy sink, cause it'll operate near 24/7.

Though, this could be a good exercise in progression/development as a player. CC is a powerful mod, if used correctly. Just takes some willingness to learn programming logic. LUA is quite easy compared to other languages anyways.
 

XLT_Frank

New Member
Jul 29, 2019
157
0
0
Here is a picture of my compression dynamo stack with cell, turtle, and rednet... don't worry the rednet does not loop on itself. It does work.

I will be repeating this on my magmatic dyanamos and reactant dynamos.

2014-04-13_21.34.37.png
 

XLT_Frank

New Member
Jul 29, 2019
157
0
0
Looking at the following page, I think my strategy will change. It looks like I can read energy per tick on the cell. If so I will engage each stage of engines (4 of 16) based on the consumption.

So if ticks are between 100 and 320, the first four dynamos will run. If 320 and 640, the second set of dynamos will engage. Etc.

If the cell falls below 50% then all dynamos will engage until the cell is above 95%.

https://github.com/OpenMods/OpenPer...c/openperipheral/integration/thermalexpansion

Sent from my Galaxy Nexus using Tapatalk