Skip to content

Commit ccf5a67

Browse files
committed
nicities, requires updated CSMTK and DyadContorl
1 parent 6fd15ea commit ccf5a67

1 file changed

Lines changed: 7 additions & 9 deletions

File tree

src/lqg_control_flat_planar.jl

Lines changed: 7 additions & 9 deletions
Original file line numberDiff line numberDiff line change
@@ -85,23 +85,17 @@ margin_plot = JSC.artifacts(lqg_asol, :MarginPlot)
8585
controller_gain = lqg_asol.L
8686
observer_gain = lqg_asol.K
8787

88-
display(controller_gain)
89-
display(observer_gain)
9088

9189
##
9290

93-
get_Cfffb(; name) = System(ss(lqg_asol.Cfffb); name)
94-
get_Cff(; name) = System(ss(lqg_asol.Cff); name)
95-
get_Cfb(; name) = System(ss(lqg_asol.Cfb); name)
96-
9791
@component function LQGFlatDyadBot4(; name)
9892
pars = @parameters begin
9993
step_time = 5
10094
step_height = 0.15
10195
end
10296
systems = @named begin
10397
plant = FlatDyadBot()
104-
C = get_Cfffb()
98+
C = DyadControlSystems.get_Cfffb(lqg_asol)
10599
end
106100

107101
eqs = [
@@ -110,7 +104,7 @@ get_Cfb(; name) = System(ss(lqg_asol.Cfb); name)
110104
C.input.u[3] ~ 0 # rtheta
111105
C.input.u[4] ~ 0 # rthetad
112106
C.input.u[5] ~ plant.x_output.u # x
113-
C.input.u[6] ~ plant.theta_output.u-pi # theta
107+
C.input.u[6] ~ plant.theta_output.u # theta (operating-point adjustment is already taken care of in C)
114108
connect(C.output, :u, plant.control_input)
115109
]
116110
guesses = [
@@ -139,6 +133,9 @@ plot(sol, idxs=[
139133

140134
##
141135

136+
rhp_pole, _ = findmax(real, poles(lqg_asol.P))
137+
# fundamental limitation due to RHP pole ω_gc > 2p = 2*
138+
142139
Lo = system_mapping(lqg_asol.P_ext)*lqg_asol.Cfb
143140
Li = lqg_asol.Cfb*system_mapping(lqg_asol.P_ext)
144141

@@ -156,7 +153,8 @@ dmi2 = diskmargin(L2, offset=0) # offset due to hard to cancel pole/zero pair in
156153
plot(dmi)
157154
plot!(dmi2)
158155

159-
bodeplot([Li, L2], adjust_phase_start=false) # Verify equal
156+
marginplot([Li, L2], adjust_phase_start=false) # Verify equal
157+
vline!([2*rhp_pole], l=(:dash, :black), label="Fundamental limitation")
160158

161159
# ##
162160
# P_ext = system_mapping(lqg_asol.P_ext)

0 commit comments

Comments
 (0)