Skip to content
Snippets Groups Projects
Commit d3af836b authored by Jacob Wikmark's avatar Jacob Wikmark
Browse files

bumpless transfer only if I is on

parent 1900fae6
No related branches found
No related tags found
No related merge requests found
...@@ -41,13 +41,15 @@ function runprocess(;simulated=false, webservice=true, port=8000, σ = 0.001, du ...@@ -41,13 +41,15 @@ function runprocess(;simulated=false, webservice=true, port=8000, σ = 0.001, du
onv = Int.([gui[s]=="On" for s in [:pOn, :iOn, :dOn]]) onv = Int.([gui[s]=="On" for s in [:pOn, :iOn, :dOn]])
rv = pidcontroller(r, y, onv) rv = pidcontroller(r, y, onv)
if gui[:mode]=="Automatic" 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) control(P, rv)
elseif gui[:mode]=="Manual" elseif gui[:mode]=="Manual"
control(P, gui[:u]) control(P, gui[:u])
#bumpless transfer: #bumpless transfer:
if gui[:iOn]=="On"
pidcontroller.I = gui[:u]-(pidcontroller.Tot-pidcontroller.I) pidcontroller.I = gui[:u]-(pidcontroller.Tot-pidcontroller.I)
end end
end
push!(gui, y, 1) push!(gui, y, 1)
push!(gui, r, 2) push!(gui, r, 2)
push!(gui, pidcontroller.P, 3) push!(gui, pidcontroller.P, 3)
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment