Skip to content
Merged
Show file tree
Hide file tree
Changes from all commits
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
2 changes: 1 addition & 1 deletion README.md
Original file line number Diff line number Diff line change
Expand Up @@ -73,7 +73,7 @@ P = K/(s*((J*s + b)*(L*s + R) + K^2))
#Continuous-time transfer function model

# Create an array of closed loop systems for different values of Kp
CLs = TransferFunction[kp*P/(1 + kp*P) for kp = [1, 5, 15]];
CLs = [kp*P/(1 + kp*P) for kp [1, 5, 15]];

# Plot the step response of the controllers
# Any keyword arguments supported in Plots.jl can be supplied
Expand Down
9 changes: 2 additions & 7 deletions lib/ControlSystemsBase/Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -7,8 +7,6 @@ version = "1.13.2"
[deps]
DSP = "717857b8-e6f2-59f4-9121-6e50c889abd2"
ForwardDiff = "f6369f11-7733-5829-9624-2563aa707210"
IterTools = "c8e1da08-722c-5040-9ed9-7db0dc04731e"
LaTeXStrings = "b964fa9f-0449-5b57-a5c2-d3ea65f4040f"
LinearAlgebra = "37e2e46d-f89d-539d-b4ee-838fcccc9c8e"
MacroTools = "1914dd2f-81c6-5fcd-8719-6d5c9610ff09"
MatrixEquations = "99c1a7ee-ab34-5fd5-8076-27c950a045f4"
Expand All @@ -18,7 +16,6 @@ PrecompileTools = "aea7be01-6a6a-4083-8856-8a6e6704d82a"
Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
RecipesBase = "3cdcf5f2-1ef4-517c-9805-6587b60abb01"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArraysCore = "1e83bf80-4336-4d27-bf5d-d5a4f845583c"
UUIDs = "cf7118a7-6976-5b1a-9a39-7adc72f591a4"

Expand All @@ -34,8 +31,6 @@ Aqua = "0.5"
DSP = "0.6.1, 0.7, 0.8"
ForwardDiff = "0.10"
ImplicitDifferentiation = "0.4.2"
IterTools = "1.0"
LaTeXStrings = "1.0"
LinearAlgebra = "<0.0.1, 1"
MacroTools = "0.5"
MatrixEquations = "1, 2.1"
Expand All @@ -45,7 +40,6 @@ PrecompileTools = "1"
Printf = "<0.0.1, 1"
Random = "<0.0.1, 1"
RecipesBase = "1"
SparseArrays = "<0.0.1, 1"
StaticArraysCore = "1"
UUIDs = "<0.0.1, 1"
julia = "1.6"
Expand All @@ -58,8 +52,9 @@ FiniteDifferences = "26cc04aa-876d-5657-8c51-4c34ba976000"
GR = "28b8d3ca-fb5f-59d9-8090-bfdbd6d07a71"
ImplicitDifferentiation = "57b37032-215b-411a-8a7c-41a003a55207"
Plots = "91a5bcdd-55d7-5caf-9e0b-520d859cae80"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
StaticArrays = "90137ffa-7385-5640-81b9-e52037218182"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[targets]
test = ["Test", "Aqua", "ComponentArrays", "Documenter", "FiniteDifferences", "ImplicitDifferentiation", "GR", "Plots", "StaticArrays"]
test = ["Test", "Aqua", "ComponentArrays", "Documenter", "FiniteDifferences", "ImplicitDifferentiation", "GR", "Plots", "SparseArrays", "StaticArrays"]
3 changes: 1 addition & 2 deletions lib/ControlSystemsBase/src/ControlSystemsBase.jl
Original file line number Diff line number Diff line change
Expand Up @@ -126,8 +126,7 @@ export LTISystem,
add_output


# QUESTION: are these used? LaTeXStrings, Requires, IterTools
using RecipesBase, LaTeXStrings, LinearAlgebra
using RecipesBase, LinearAlgebra
import Polynomials
import Polynomials: Polynomial, coeffs
import Base: +, -, *, /, (==), (!=), isapprox, convert, promote_op
Expand Down
6 changes: 3 additions & 3 deletions lib/ControlSystemsBase/src/pid_design.jl
Original file line number Diff line number Diff line change
Expand Up @@ -251,7 +251,7 @@
kp = kps[i]
ki = kis[i]
kd = kds[i]
label = latexstring("k_p = $(round(kp, digits=3)), k_i = $(round(ki, digits=3)), k_d = $(round(kd, digits=3))")
label = "\$k_p = $(round(kp, digits=3)), k_i = $(round(ki, digits=3)), k_d = $(round(kd, digits=3))\$"

C = pid(kp,ki,kd,form=form)
T = robust_minreal(feedback(P*C, 1))
Expand Down Expand Up @@ -384,7 +384,7 @@
K = convert_pidparams_from_parallel.(kp, ki, kd, form)
kp, ki = getindex.(K, 1), getindex.(K, 2)
fig = if doplot
RecipesBase.plot(kp,ki,linewidth = 1.5, xlabel=L"k_p", ylabel=L"k_i", title="Stability region of P, k_d = $(round(kd, digits=4))")
RecipesBase.plot(kp,ki,linewidth = 1.5, xlabel="\$k_p\$", ylabel="\$k_i\$", title="Stability region of P, k_d = $(round(kd, digits=4))")

Check warning on line 387 in lib/ControlSystemsBase/src/pid_design.jl

View check run for this annotation

Codecov / codecov/patch

lib/ControlSystemsBase/src/pid_design.jl#L387

Added line #L387 was not covered by tests
else
nothing
end
Expand All @@ -401,7 +401,7 @@
K = convert_pidparams_from_parallel.(kp, ki, kd, form)
kp, ki = getindex.(K, 1), getindex.(K, 2)
fig = if doplot
RecipesBase.plot(kp,ki,linewidth = 1.5, xlabel=L"k_p", ylabel=L"k_i", title="Stability region of P, k_d = $(round(kd, digits=4))")
RecipesBase.plot(kp,ki,linewidth = 1.5, xlabel="\$k_p\$", ylabel="\$k_i\$", title="Stability region of P, k_d = $(round(kd, digits=4))")
else
nothing
end
Expand Down
2 changes: 1 addition & 1 deletion lib/ControlSystemsBase/src/plotting.jl
Original file line number Diff line number Diff line change
Expand Up @@ -90,7 +90,7 @@ end
# minor = minor[ind]
# minorText = minorText[ind]
# if length(minor) > minor_text_limit
# minorText = [" " for t in minorText]#fill!(minorText, L" ")
# minorText = [" " for t in minorText]#fill!(minorText, " ")
# end
# perm = sortperm([major; minor])
# return [major; minor][perm], [majorText; minorText][perm]
Expand Down
Loading