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

Convert pid parameters to :parallel #900

Merged
merged 8 commits into from
Nov 17, 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
Update lib/ControlSystemsBase/test/test_pid_design.jl
Co-authored-by: Fredrik Bagge Carlson <baggepinnen@gmail.com>
  • Loading branch information
mzaffalon and baggepinnen committed Nov 17, 2023
commit 0ac6a7518c40eb56a0cc7944075df6cba69db1e7
10 changes: 10 additions & 0 deletions lib/ControlSystemsBase/test/test_pid_design.jl
Original file line number Diff line number Diff line change
Expand Up @@ -84,6 +84,16 @@ C, Kp, Ti = placePI(P, 2, 0.7; form=:standard)
@test [Kp, Ti] ≈ [9/5, 9/20]

# Test internal functions convert_pidparams*
# Standard
params = (2, 3, 0.5)
parallel_params = ControlSystemsBase.convert_pidparams_from_standard(params..., :parallel)
@test parallel_params == (2, 2/3, 1)
@test ControlSystemsBase.convert_pidparams_to_standard(parallel_params..., :parallel) == params
series_params = ControlSystemsBase.convert_pidparams_from_standard(params..., :series)
@test series_params == ((3-sqrt(3))/3, (3-sqrt(3))/2, (3+sqrt(3))/2)
@test ControlSystemsBase.convert_pidparams_to_standard(series_params..., :series) == params

# Parallel
params = (4, 3, 0.5)
mzaffalon marked this conversation as resolved.
Show resolved Hide resolved
standard_params = ControlSystemsBase.convert_pidparams_from_parallel(params..., :standard)
@test standard_params == (4, 4/3, 0.5/4)
Expand Down
Loading