Search the Community
Showing results for tags 'turbine'.
Found 2 results
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.
Ok, so, I'm playing on a modpack (Tekkify) that has both Big Reactors and OpenComputers, and I'm trying to write a program that monitors a turbine I have set up after I start the program. I sadly don't know a lot about lua or OC on my own to fix this, so I'm looking to get some help possibly from people who have more know-how on with OC. I've already written up a rough mock of what I want, though it doesn't quite work as I had imagined-- it goes through the program once, prints the items I'm attempting to track to the screen once, I was using a while loop to hopefully make it check the values over and over, but it doesn't seem to be doing that. local term = require("term") local component = require("component") local turbine = component.br_turbine local tActive = turbine.getActive() local tRPM = math.ceil(tonumber(turbine.getRotorSpeed())) local tRf = math.ceil(tonumber(turbine.getEnergyStored())) local tRfPt = math.ceil(tonumber(turbine.getEnergyProducedLastTick())) while tActive do os.sleep(1) term.clear() print(tRPM, " RPM") print(tRf, " RF Stored") print(tRfPt, " RF/t") end If, due to my lack of knowledge of how loops work other than them just looping, I actually did what I was hoping for wrong, please, tell me how I can fix it so I might learn for future instances. Thank you in advance!