@@ -85,23 +85,17 @@ margin_plot = JSC.artifacts(lqg_asol, :MarginPlot)
8585controller_gain = lqg_asol. L
8686observer_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+
142139Lo = system_mapping (lqg_asol. P_ext)* lqg_asol. Cfb
143140Li = 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
156153plot (dmi)
157154plot! (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