-
Notifications
You must be signed in to change notification settings - Fork 8
Open
Description
The following produces a system with the wrong external inputs
function assemble(kp, ki, kd, T, d, b, c)
kp = named_ss(ss(kp), "kp")
ki = named_ss(ss(ki), "ki")
kd = named_ss(ss(kd), "kd")
b = named_ss(ss(b), "b")
c = named_ss(ss(c), "c")
F = named_ss(ss(filt(T,d)), "F")
s1 = sumblock("kpu = by + Fy1")
s2 = sumblock("kiu = r2 + Fy2")
s3 = sumblock("Fu = cy + yiny")
integrator = named_ss(ss(1/s), "integrator")
sout = sumblock("u = kpy + integratory + kdy")
rsplit = splitter(:r, 3)
yin = named_ss(ss(-1.0), "yin")
# ysplit = splitter(:y, 3)
Fsplit = splitter(:Fy, 3)
external_inputs = [:r, :y]
external_outputs = [:u]
connections = [
# :y1 => :y1
# :y2 => :y2
# :y3 => :y3
:y => :yinu
:yiny => :yiny
:r1 => :bu
:r2 => :r2 # s2 input
:r3 => :cu
:by => :by # s1 input
:cy => :cy # s3 input
:Fu => :Fu # s3 output
:kiu => :kiu # s2 output
:kpu => :kpu # s1 output
:Fy1 => :Fy1
:Fy2 => :Fy2
:Fy3 => :kdu
:kiy => :integratoru
:integratory => :integratory
:kpy => :kpy
:kdy => :kdy
]
systems = [
kp,
ki,
kd,
b,
c,
F,
s1,
s2,
s3,
integrator,
sout,
rsplit,
yin,
# ysplit,
Fsplit,
]
connect(systems, connections; external_inputs, external_outputs, unique=true)
end
Metadata
Metadata
Assignees
Labels
No labels