Not a member of Pastebin yet?
Sign Up,
it unlocks many cool features!
- os.loadAPI("api/PID")
- target = 13900
- base = 26
- settings = {
- kp = 0.007,
- ki = 0.0005,
- kd = 0.000001,
- maxout = base,
- minout = base - 100
- }
- pid = PID.new(settings)
- reactor = peripheral.wrap("back")
- pid.target = target
- pid.input = 0
- pid:compute()
- sleep(0.5)
- while true do
- pid.input = reactor.getHotFluidProducedLastTick()
- pid:compute()
- reactor.setAllControlRodLevels(base - pid.output)
- term.clear()
- term.setCursorPos(1, 1)
- print(pid.input)
- print(base - pid.output)
- sleep(0.1)
- end
Add Comment
Please, Sign In to add comment