Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

add option to design observers with direct term #861

Merged
merged 6 commits into from
Jul 11, 2023
Merged
Changes from 1 commit
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
Prev Previous commit
Next Next commit
rearrange tests
  • Loading branch information
baggepinnen committed Jul 10, 2023
commit 0179a570807cba22ee5a3c0ad9f02da2a101aa9f
33 changes: 11 additions & 22 deletions lib/ControlSystemsBase/test/test_matrix_comps.jl
Original file line number Diff line number Diff line change
Expand Up @@ -234,28 +234,6 @@ cont = observer_controller(sys, L, K, direct=true)
syscl = feedback(sys, cont)
@test isstable(syscl)

pcl = poles(syscl)
A,B,C,D = ssdata(sys)
allpoles = [
eigvals(A-B*L)
eigvals(A-K*C)
]
@test sort(pcl, by=LinearAlgebra.eigsortby) ≈ sort(allpoles, by=LinearAlgebra.eigsortby)
@test cont.B == K

## Test time scaling
for balanced in [true, false]
sys = ssrand(1,1,5);
t = 0:0.1:50
a = 10

Gs = tf(1, [1e-6, 1]) # micro-second time scale modeled in seconds
Gms = time_scale(Gs, 1e-6; balanced) # Change to micro-second time scale
@test Gms == tf(1, [1, 1])
end



# Test observer_controller discrete with pole placement
Ts = 0.01
sys = ssrand(2,3,4; Ts, proper=true)
Expand Down Expand Up @@ -292,6 +270,17 @@ allpoles = [
]
@test sort(pcl, by=real) ≈ sort(allpoles, by=real) rtol=1e-3

## Test time scaling
for balanced in [true, false]
sys = ssrand(1,1,5);
t = 0:0.1:50
a = 10

Gs = tf(1, [1e-6, 1]) # micro-second time scale modeled in seconds
Gms = time_scale(Gs, 1e-6; balanced) # Change to micro-second time scale
@test Gms == tf(1, [1, 1])
end



## Test balancing with Duals
Expand Down
Loading