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
Not how the closed-loop system changes very little along the trajectory, this is a good indication that the gain-scheduled controller is able to make the system appear linear.
165
166
166
167
Internally, [`trajectory_ss`](@ref) works very much the same as [`batch_ss`](@ref), but constructs operating points automatically along the trajectory. This requires that the solution contains the states of the simplified system, accessible through the `idxs` argument like `sol(t, idxs=x)`. By linearizing the same system as we simulated, we ensure that this condition holds, doing so requires that we specify the inputs and outputs as analysis points rather than as variables.
167
168
168
169
169
-
Notice how the peak of the transfer function changes along the trajectory. We can replicate the figure above by linearizing the plant and the controller individually, by providing the `loop_openings` argument. When linearizing the plant, we disconnect the controller input by passing `loop_openings=[closed_loop.u]`, and when linearizing the controller, we have various options for disconnecting the the plant:
170
+
We can replicate the figure above by linearizing the plant and the controller individually, by providing the `loop_openings` argument. When linearizing the plant, we disconnect the controller input by passing `loop_openings=[closed_loop.u]`, and when linearizing the controller, we have various options for disconnecting the the plant:
170
171
- Break the connection from plant output to controller input by passing `loop_openings=[closed_loop.y]`
171
172
- Break the connection between the controller and the plant input by passing `loop_openings=[closed_loop.u]`
172
173
- Break the connection `y` as well as the scheduling variable `v` (which is another form of feedback) by passing `loop_openings=[closed_loop.y, closed_loop.v]`
@@ -207,7 +208,7 @@ bodeplot(closed_loops_mimo, w; title="Loop open at MIMO", kwargs...)
207
208
208
209
209
210
210
-
Why the discrepancy? We can understand the difference by comparing the Bode plots of the controllers.
211
+
Why are the results different depending on where we open the loop? We can understand the difference by comparing the Bode plots of the controllers.
211
212
212
213
```@example BATCHLIN
213
214
plot(
@@ -217,9 +218,23 @@ plot(
217
218
bodeplot(controllersv, w, legend=false, plotphase=false, title="Loop open at v and y"),
218
219
)
219
220
```
220
-
if we open at both `y` and `v`, we only get the controller designed for the origin. If we open at `u`, we get controllers for the different values of the scheduling variable, and the corresponding measurement feedback (which is the same as the scheduling variable in this case).
221
+
if we open at both `y` and `v` or we open at `u`, we get controllers for the different values of the scheduling variable, and the corresponding measurement feedback (which is the same as the scheduling variable in this case).
222
+
223
+
However, if we only open at `y` we get controller linearizations that _still contain the closed loop through the scheduling connection_`v`. We can verify this by looking at what variables are present in the input-output map
notice how the state of the plant is included in the controller, this is an indication that we didn't fully isolate the controller during the linearizaiton. If we do the same thing for the controller with the loop opened at `u`, we see that the state of the plant is not included in the controller:
229
+
```@example BATCHLIN
230
+
Cu = named_ss(controllersu[end], x=Symbol.(unknowns(ssu)))
231
+
sminreal(Cu).x
232
+
```
233
+
The call to `sminreal` is important here, it removes the states that are not needed to represent the input-output map of the system. The state of the full model, including the plant state, is present in the linearization before this call.
234
+
235
+
221
236
222
-
However, if we only open at `y` we get controller linearizations that contains the closed loop through the scheduling connection `v`. The easiest way to ensure that the controller is properly disconnected from the plant while taking into account the different scheduling along the trajectory is thus to break at `u`.
237
+
The easiest way to ensure that the controller is properly disconnected from the plant while taking into account the different scheduling along the trajectory is thus to break at `u`.
0 commit comments