Search the Community
Showing results for tags 'reactor'.
Found 6 results
I did a program to manage my batteries and reactors, and i got a problem in reactor.setActive(true/false) for address, name in pairs(reactorsID) do local reactor = component.proxy(address) countR = countR + 1 local tR = (countR + count) * 3 progressBar( name, tR, reactor.getEnergyStored(), reactor.getEnergyCapacity(), 0x00bb00, true, "RF") progressBar( "Reactor(Energy Last Tick)", tR + 3, math.ceil(reactor.getEnergyProducedLastTick()), 6200, 0x00bb00, true, "RF") if brPower + totalPower < brMaxPower + totalMaxPower then reactor.setActive(True) else reactor.setActive(False) end end The reactor doesn't turn on or off, and the program doesn't return any error . Here is the full code : https://pastebin.com/gkmtstis
This is an emulator of the Draconic Evolution's reactor. Basically, it emulates all inputs and outputs of the reactor with great precision. It is based on the actual Draconic Evolution's code. I made that to be able to test automatic control softwares without blowing up my base or needing to go in a creative world. Here's the pastebin link https://pastebin.com/WduATMTF To use it you simply use a require like always. The functions all have the same name than the Draconic Evolution's API. I also added some custom functions to control stuff like fake flux gate for example. Here they are. fluxGates.input and fluxGates.output -- Provides access to the virtual input and output flux gate. I didn't implemented all the methods for those, only what I thought was used by an automatic control system. setOverrideEnabled (boolean) : doesn't do anything. Just there to prevent error when calling it on a real flux gate. getFlow () : returns the current flow of the gate setFlowOverride (number) : set the current flow to the input setFuel(number) : Set the fuel quantity in the reactor. This can only be changed when the reactor is cold. The minimum for the reactor to be able to start is 144 (equivalent to 1 awakened draconium ingot) and the maximum is 10368 (8 awakened draconium block) reset() : Reset the reactor completely. Everything is set back to 0. update() : This needs to be called in the main loop of the control software. This method manage the call so the reactor is only updated each minecraft ticks. setUpdateSpeed(number) : Set the simulation speed. 1 is the default speed, 2 is two time the speed, etc. Increasing the speed over 100 will exponentially give inaccurate values. To display the status simply use the fields in getReactorInfo() like with the Draconic Evolution's API.
Hello folks!, i've been working on this little program for a few days, and think im at the final stage i want it to be in. - This is the first program i share on here, hope you will enjoy it ^^ PASTEBIN //Plazter ADDED FAILSAFE FUNCTION, Note: In the Vars you're able to set a temperature you want it to turn off at, and set it on or off. The fail safe is on by default. Picture + code:
Introduction This program and its library make setting up PID controllers in Minecraft easy. Controllers are used whenever you want to maintain a certain speed, temperature etc. An example system in Minecraft would be a Big Reactors turbine: It takes an adjustable steam flow rate and has a speed that should be maintained at an optimal value of 1800 rpm. A turbine controller would therefore have the following inputs: 1. the current turbine speed 2. the target turbine speed (1800 rpm) and the following output: 1. steam flow rate (a value that would let the turbine reach and stay at 1800 rpm) This software uses a PID controller. It got its name after the three parts its output is calculated from. The output is the sum of: 1. P(proportional): This part is proportional to the error. (difference between target value and currently measured value) While it is directly minimizing the error, it alone often can't zero it completely. Too much of it can also lead to instability. (oscillations) 2. I(ntegral): This part is proportional to the sum of all errors accumulated over time. That makes it perfect to slowly remove the residual error left over by the proportional part, but it increases the tendency for overshooting. (or even oscillations) 3. D(erivative): This part is proportional to the change in error per time. It is therefore good to limit the speed of error changes. (preventing too fast error increases and slowing down decreases to avoid overshooting -> damping / increasing stability) But it is vulnerable to noisy measurements. (large changes divided by short durations -> big influence -> output becomes very noisy) The tricky part is determining the correct factors to have a responsive controller but no instabilities. (There is a small Tutorial in the next section.) If you are interested to learn more, here is a good introduction to controllers: Screenshots Example / Tutorial (Big Reactors Turbine) Man Pages API You can use the library via require("pid"). Functions Properties Dependencies Software only OpenOS Hardware RAM: almost nothing on top of what OpenOS is already using Installation Simply download the tar archive and extract it into the root directory. All files should then be there where they should be. Download (last update: 07.11.15) github: program and library github: sample controllers Ingame: #program + library: wget 'https://github.com/mpmxyz/ocprograms/raw/master/tars/pid.tar' tar -xf pid.tar #sample controllers: wget 'https://github.com/mpmxyz/ocprograms/raw/master/tars/pids.tar' tar -xf pids.tar OR oppm install mpmpid Known Issues currently none Feel free to ask, if anything is unclear. Control Engineering has never been part of my curriculum; so if you know more and would like to share something - like an automatic tuning algorithm, feel free to do so.
Hello, I'm working on a program to run my Big Reactor (ala Direwolf20's recent CC program) I started yesterday knowing very little about writing code and have managed to program the basic function which I wanted to start out with. I'm hoping to add more monitoring and adjustment functions later as I learn more, but this what I need to start off. I want my reactor to shut off when the energy buffer is at 90% and restart when the buffer is down to 10%. My buffer is currently 10mil RF. It works, once. If I run when the buffer is near full, it will shut down, and if I run the program when the buffer is low, it will start the reactor. It does not, however, shut the reactor back down once it is near full unless I rerun the program. My question is what do I need to add in order to have this run in the background and continuously manage my reactor? Here's my code: component = require("component") RF_BUFFER_MAX = 9000000 RF_BUFFER_MIN = 1000000 for _, reactor in pairs(REACTORS) do if reactor.getEnergyStored() >= RF_BUFFER_MAX then reactor.setActive(false) print("Reactor is offline") else if reactor.getEnergyStored() <=RF_BUFFER_MIN then reactor.setActive(true) print("Reactor is online") end end Thank you for any insight that you can give!