You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
collect(model.cable.joint_2.phi) .=> 0.1 # Usa a larger initial cable bend since this controller is more robust
272
+
collect(model.cable.joint_2.phi) .=> 1 # Usa a larger initial cable bend since this controller is more robust
275
273
model.world.g => 9.81;
276
274
collect(model.body.phid) .=> 0;
277
275
collect(D.(model.body.phi)) .=> 0;
278
-
model.feedback_gain.input.u[9] => 0;
279
-
model.feedback_gain.input.u[12] => 0;
276
+
collect(model.feedback_gain.input.u) .=> 0;
280
277
model.Ie_alt => -10; # Initialize the integrator state to avoid a very large initial transient. This pre-compensates for gravity
281
278
] |> Dict
282
279
prob = ODEProblem(ssys, op, (0, 20))
@@ -294,43 +291,40 @@ nothing # hide
294
291
The observant reader may have noticed that we linearized the quadrotor without the cable-suspended load applied, but we simulated the closed-loop system with the load. Thankfully, the LQR controller is robust enough to stabilize the system despite this large model error. Before being satisfied with the controller, we should perform robustness analysis. Below, we compute sensitivity functions at the plant output and input and plot their sigma plots, as well as simultaneous diskmargins at the plant output and input.
295
292
296
293
```@example QUAD
297
-
# NOTE: this section is temporarily disabled waiting for improved performance in linearization
298
-
299
-
# linop = merge(op, Dict([
300
-
# collect(model.system_outputs.u) .=> 0
301
-
# collect(model.body.r_0) .=> 1e-32
302
-
# collect(model.load.v_0) .=> 1e-32 # To avoid singularity in linearization
303
-
# collect(model.system_outputs.u) .=> 1e-32
304
-
# collect(model.feedback_gain.input.u) .=> 1e-32
305
-
# ]))
306
-
# @time "Sensitivity function" S = get_named_sensitivity(model, :y; system_modifier=IRSystem, op=linop)
307
-
# S = minreal(S, 1e-6)
308
-
# isstable(S) || @error "Sensitivity function S is not stable"
309
-
# T = I(S.ny) - S
310
-
# T = minreal(T, 1e-6)
311
-
# isstable(T) || @error "Sensitivity function T is not stable"
# isstable(Ti) || @error "Sensitivity function Ti is not stable"
317
-
# LTi = feedback(Ti, -I(Ti.ny)) # Input loop-transfer function
318
-
319
-
# CS = named_ss(model, :y, :u; op=linop, system_modifier=IRSystem) # Closed-loop system from measurement noise to control signal
320
-
321
-
# w = 2pi.*exp10.(LinRange(-2, 2, 200))
322
-
# fig_dm = plot(diskmargin(LT, 0.5), label="Plant output") # Compute diskmargin with a positive skew of 0.5 to account for a likely gain increase when the load is dropped
@time "Comp Sensitivity function" Ti = get_named_comp_sensitivity(model, :u; system_modifier=IRSystem, op=linop)
310
+
Ti = minreal(Ti, 1e-6)
311
+
isstable(Ti) || @error "Sensitivity function Ti is not stable"
312
+
LTi = feedback(Ti, -I(Ti.ny)) # Input loop-transfer function
313
+
314
+
CS = named_ss(model, :y, :u; op=linop, system_modifier=IRSystem) # Closed-loop system from measurement noise to control signal
315
+
316
+
w = 2pi.*exp10.(LinRange(-2, 2, 200))
317
+
fig_dm = plot(diskmargin(LT, 0.5), label="Plant output") # Compute diskmargin with a positive skew of 0.5 to account for a likely gain increase when the load is dropped
While gain and phase margins appear to be reasonable, we have a large high-frequency gain in the transfer functions from measurement noise to control signal, ``C(s)S(s)``. For a rotor craft where the control signal manipulates the current through motor windings, this may lead to excessive heat generation in the motors if the sensor measurements are noisy.
0 commit comments