Skip to content

Commit

Permalink
Implement luenberger (#457)
Browse files Browse the repository at this point in the history
Implements a wrapper around `place` which allows for a more convenient user workflow when performing pole-placement for observer design.
  • Loading branch information
tfoliva authored Mar 21, 2021
1 parent 08a90f8 commit 6dcb3d8
Showing 1 changed file with 19 additions and 1 deletion.
20 changes: 19 additions & 1 deletion src/synthesis.jl
Original file line number Diff line number Diff line change
Expand Up @@ -125,7 +125,9 @@ dkalman(A, C, R1,R2) = Matrix(dlqr(A',C',R1,R2)')
Calculate gain matrix `K` such that
the poles of `(A-BK)` in are in `p`.
Uses Ackermann's formula."""
Uses Ackermann's formula.
For observer pole placement, see `luenberger`.
"""
function place(A, B, p)
n = length(p)
n != size(A,1) && error("Must define as many poles as states")
Expand All @@ -141,6 +143,22 @@ function place(sys::StateSpace, p)
return place(sys.A, sys.B, p)
end

"""
luenberger(A, C, p)
luenberger(sys::StateSpace, p)
Calculate gain matrix `L` such that the poles of `(A - LC)` are in `p`.
Uses sytem's dual form (Controllability-Observability duality) applied to Ackermann's formula.
That is, `(A - BK)` is indentic to `(A' - C'L') == (A - LC)`.
"""
function luenberger(A, C, p)
place(A', C', p)'
end

function luenberger(sys::StateSpace, p)
return luenberger(sys.A, sys.C, p)
end

#Implements Ackermann's formula for placing poles of (A-BK) in p
function acker(A,B,P)
n = length(P)
Expand Down

0 comments on commit 6dcb3d8

Please sign in to comment.