Commit d3af836b authored by Jacob Wikmark's avatar Jacob Wikmark
Browse files

bumpless transfer only if I is on

parent 1900fae6
......@@ -41,12 +41,14 @@ function runprocess(;simulated=false, webservice=true, port=8000, σ = 0.001, du
onv = Int.([gui[s]=="On" for s in [:pOn, :iOn, :dOn]])
rv = pidcontroller(r, y, onv)
if gui[:mode]=="Automatic"
gui[:u] = clamp(round(rv,2), 0, 1) #u's constructor has a dummy graphic so this is fine
gui[:u] = clamp(round(rv,2), 0, 1) #u's constructor has only a dummy graphic so this is fine
control(P, rv)
elseif gui[:mode]=="Manual"
control(P, gui[:u])
#bumpless transfer:
pidcontroller.I = gui[:u]-(pidcontroller.Tot-pidcontroller.I)
if gui[:iOn]=="On"
pidcontroller.I = gui[:u]-(pidcontroller.Tot-pidcontroller.I)
end
end
push!(gui, y, 1)
push!(gui, r, 2)
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment