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
* use getproperty instead of getfield for LQG
* more updates for LQG
* import getindex
* merge updates from working
* update formatting in docstring
* handle messed-up merge
* fix backslash
G = LQG(A,B,C,D, Q1, Q2, R1, R2; qQ=0, qR=0, integrator=false)
6
-
G = LQG(sys, args...; kwargs...)
5
+
G = LQG(sys::AbstractStateSpace, Q1, Q2, R1, R2; qQ=0, qR=0, integrator=false, M = sys.C)
7
6
8
7
Return an LQG object that describes the closed control loop around the process `sys=ss(A,B,C,D)`
9
8
where the controller is of LQG-type. The controller is specified by weight matrices `Q1,Q2`
10
9
that penalizes state deviations and control signal variance respectively, and covariance
11
10
matrices `R1,R2` which specify state drift and measurement covariance respectively.
12
11
This constructor calls [`lqr`](@ref) and [`kalman`](@ref) and forms the closed-loop system.
13
12
14
-
If `integrator=true`, the resulting controller will have intregral action.
13
+
If `integrator=true`, the resulting controller will have integral action.
15
14
This is achieved by adding a model of a constant disturbance on the inputs to the system
16
-
described by `A,B,C,D`.
15
+
described by `sys`.
17
16
18
17
`qQ` and `qR` can be set to incorporate loop transfer recovery, i.e.,
19
18
```julia
20
19
L = lqr(A, B, Q1+qQ*C'C, Q2)
21
20
K = kalman(A, C, R1+qR*B*B', R2)
22
21
```
23
22
24
-
# Fields
23
+
`M` is a matrix that defines the controlled variables `z`, if none is provided, the default is to consider all measured outputs `y` of the system as controlled. The definitions of `z` and `y` are given below
24
+
```
25
+
y = C*x
26
+
z = M*x
27
+
```
28
+
29
+
# Fields and properties
25
30
When the LQG-object is populated by the lqg-function, the following fields have been made available
26
31
- `L` is the feedback matrix, such that `A-BL` is stable. Note that the length of the state vector (and the width of L) is increased by the number of inputs if the option `integrator=true`.
27
32
- `K` is the kalman gain such that `A-KC` is stable
28
33
- `sysc` is a dynamical system describing the controller `u=L*inv(A-BL-KC+KDL)Ky`
29
34
30
-
# Functions
31
-
Several other properties of the object are accessible with the indexing function `getindex()`
32
-
and are called with the syntax `G[:function]`. The available functions are
35
+
Several other properties of the object are accessible as properties. The available properties are
33
36
(some have many alternative names, separated with / )
34
37
35
-
-`G[:cl] / G[:closedloop]` is the closed-loop system, including observer, from reference to output, precompensated to have static gain 1 (`u = −Lx + lᵣr`).
36
-
-`G[:S] / G[:Sin]` Input sensitivity function
37
-
-`G[:T] / G[:Tin]` Input complementary sensitivity function
38
-
-`G[:Sout]` Output sensitivity function
39
-
-`G[:Tout]` Output complementary sensitivity function
40
-
-`G[:CS]` The transfer function from measurement noise to control signal
41
-
-`G[:DS]` The transfer function from input load disturbance to output
42
-
-`G[:lt] / G[:looptransfer] / G[:loopgain] = PC`
43
-
-`G[:rd] / G[:returndifference] = I + PC`
44
-
-`G[:sr] / G[:stabilityrobustness] = I + inv(PC)`
45
-
-`G[:sysc] / G[:controller]` Returns the controller as a StateSpace-system
46
-
47
-
It is also possible to access all fileds using the `G[:symbol]` syntax, the fields are `P
48
-
,Q1,Q2,R1,R2,qQ,qR,sysc,L,K,integrator`
38
+
- `G.cl / G.closedloop` is the closed-loop system, including observer, from reference to output, precompensated to have static gain 1 (`u = −Lx + lᵣr`).
39
+
- `G.S / G.Sin` Input sensitivity function
40
+
- `G.T / G.Tin` Input complementary sensitivity function
41
+
- `G.Sout` Output sensitivity function
42
+
- `G.Tout` Output complementary sensitivity function
43
+
- `G.CS` The transfer function from measurement noise to control signal
44
+
- `G.DS` The transfer function from input load disturbance to output
45
+
- `G.lt / G.looptransfer / G.loopgain = PC`
46
+
- `G.rd / G.returndifference = I + PC`
47
+
- `G.sr / G.stabilityrobustness = I + inv(PC)`
48
+
- `G.sysc / G.controller` Returns the controller as a StateSpace-system
49
+
50
+
It is also possible to access all fileds using the `G.symbol` syntax, the fields are `P,Q1,Q2,R1,R2,qQ,qR,sysc,L,K,integrator`
49
51
50
52
# Example
51
53
@@ -64,9 +66,9 @@ R2 = 1eye(2)
64
66
65
67
G = LQG(sys, Q1, Q2, R1, R2, qQ=qQ, qR=qR, integrator=true)
0 commit comments