Commit e199e36
authored
Clean up extended_controller: canonical 2-DOF, direct kwarg, validation (#140)
* Clean up extended_controller: canonical 2-DOF B1, direct kwarg, validation
- Delete the unverified single-argument `extended_controller(K)` overload —
it had no callers anywhere and only logged `@error` when invoked.
- Make `extended_controller(P, L, K)` produce the canonical 2-DOF observer
controller. With the old `B1 = 0`, the observer estimate `x̂` was biased
when `xᵣ ≠ 0`; the new `B1 = (B − KD)·L` lets the reference enter the
observer dynamics so `x̂` tracks `x`. For integrator-containing plants
(e.g. the cartpole test), this also makes the closed-loop reference-to-
output DC gain identity, so the manually-tuned `dc_gain_compensation`
prefilter in `test_lqg.jl` is no longer needed; the related tests now
assert `dcgain ≈ 1` directly.
- Add a `direct::Bool=false` kwarg that mirrors `observer_controller`'s
current-time-correction option for discrete plants. In direct mode the
reference path remains feedforward-only (no canonical 2-DOF B1); the
docstring records this.
- Validate `size(L)` and `size(K)` at entry with a clean `ArgumentError`.
- Drop the stale `# should be D21?` self-questioning comment and the
misplaced `# l.D21 does not appear here, see comment in kalman` line
(the latter only applied to the `LQGProblem` path).
- Add a comment near the `feedback` call in the `z`-branch recording the
default `pos_feedback=false` convention and the meaning of the `U2` slice.
- New tests: discrete-time round-trip (Method 7), `direct=true` round-trip
(Method 8), and dimension validation.
- Docs: append a "2-DOF tracking with extended_controller" section to
`docs/src/lqg_disturbance.md` demonstrating the controller and the
DC-gain pre-compensation via `extended_controller(..., z=[...])`.
DyadControlSystems was audited and has no `extended_controller` callers,
so this is safe to ship without a deprecation path.
* improve docs example1 parent b226e0d commit e199e36
3 files changed
Lines changed: 113 additions & 41 deletions
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
150 | 150 | | |
151 | 151 | | |
152 | 152 | | |
| 153 | + | |
| 154 | + | |
| 155 | + | |
| 156 | + | |
| 157 | + | |
| 158 | + | |
| 159 | + | |
| 160 | + | |
| 161 | + | |
| 162 | + | |
| 163 | + | |
| 164 | + | |
| 165 | + | |
| 166 | + | |
| 167 | + | |
| 168 | + | |
| 169 | + | |
| 170 | + | |
| 171 | + | |
| 172 | + | |
| 173 | + | |
| 174 | + | |
| 175 | + | |
| 176 | + | |
| 177 | + | |
| 178 | + | |
| 179 | + | |
| 180 | + | |
| 181 | + | |
| 182 | + | |
| 183 | + | |
| 184 | + | |
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
253 | 253 | | |
254 | 254 | | |
255 | 255 | | |
256 | | - | |
| 256 | + | |
| 257 | + | |
257 | 258 | | |
258 | | - | |
259 | | - | |
260 | | - | |
261 | | - | |
262 | | - | |
263 | | - | |
264 | | - | |
265 | | - | |
266 | | - | |
267 | | - | |
268 | | - | |
269 | | - | |
270 | | - | |
271 | | - | |
272 | | - | |
273 | | - | |
274 | | - | |
275 | | - | |
276 | | - | |
277 | | - | |
| 259 | + | |
278 | 260 | | |
279 | 261 | | |
280 | 262 | | |
| |||
290 | 272 | | |
291 | 273 | | |
292 | 274 | | |
293 | | - | |
| 275 | + | |
| 276 | + | |
| 277 | + | |
294 | 278 | | |
295 | | - | |
| 279 | + | |
296 | 280 | | |
297 | | - | |
298 | 281 | | |
299 | | - | |
300 | | - | |
301 | | - | |
302 | | - | |
303 | | - | |
304 | | - | |
305 | | - | |
| 282 | + | |
| 283 | + | |
| 284 | + | |
| 285 | + | |
| 286 | + | |
| 287 | + | |
| 288 | + | |
| 289 | + | |
| 290 | + | |
| 291 | + | |
| 292 | + | |
| 293 | + | |
| 294 | + | |
| 295 | + | |
| 296 | + | |
| 297 | + | |
| 298 | + | |
| 299 | + | |
| 300 | + | |
| 301 | + | |
| 302 | + | |
| 303 | + | |
| 304 | + | |
| 305 | + | |
| 306 | + | |
| 307 | + | |
306 | 308 | | |
307 | 309 | | |
308 | 310 | | |
309 | | - | |
| 311 | + | |
| 312 | + | |
310 | 313 | | |
311 | | - | |
| 314 | + | |
312 | 315 | | |
313 | 316 | | |
314 | 317 | | |
315 | 318 | | |
316 | 319 | | |
317 | | - | |
| 320 | + | |
318 | 321 | | |
319 | 322 | | |
320 | 323 | | |
| |||
| Original file line number | Diff line number | Diff line change | |
|---|---|---|---|
| |||
503 | 503 | | |
504 | 504 | | |
505 | 505 | | |
506 | | - | |
507 | | - | |
| 506 | + | |
| 507 | + | |
| 508 | + | |
| 509 | + | |
508 | 510 | | |
509 | 511 | | |
510 | 512 | | |
| |||
514 | 516 | | |
515 | 517 | | |
516 | 518 | | |
517 | | - | |
| 519 | + | |
518 | 520 | | |
519 | 521 | | |
520 | 522 | | |
521 | 523 | | |
522 | 524 | | |
523 | 525 | | |
524 | 526 | | |
525 | | - | |
| 527 | + | |
526 | 528 | | |
527 | 529 | | |
528 | | - | |
| 530 | + | |
529 | 531 | | |
530 | 532 | | |
531 | 533 | | |
532 | 534 | | |
533 | | - | |
| 535 | + | |
534 | 536 | | |
535 | 537 | | |
536 | | - | |
| 538 | + | |
| 539 | + | |
| 540 | + | |
| 541 | + | |
| 542 | + | |
| 543 | + | |
| 544 | + | |
| 545 | + | |
| 546 | + | |
| 547 | + | |
| 548 | + | |
| 549 | + | |
| 550 | + | |
| 551 | + | |
| 552 | + | |
| 553 | + | |
| 554 | + | |
| 555 | + | |
| 556 | + | |
| 557 | + | |
| 558 | + | |
| 559 | + | |
| 560 | + | |
| 561 | + | |
| 562 | + | |
| 563 | + | |
| 564 | + | |
| 565 | + | |
| 566 | + | |
| 567 | + | |
| 568 | + | |
| 569 | + | |
| 570 | + | |
| 571 | + | |
| 572 | + | |
| 573 | + | |
537 | 574 | | |
538 | 575 | | |
539 | 576 | | |
| |||
0 commit comments