Skip to content

Commit

Permalink
Merge branch 'moredelays' of https://github.com/JuliaControl/ControlS…
Browse files Browse the repository at this point in the history
…ystems.jl into moredelays
  • Loading branch information
mfalt committed Oct 30, 2019
2 parents acdeb26 + dcca139 commit c7dc13a
Show file tree
Hide file tree
Showing 3 changed files with 13 additions and 22 deletions.
3 changes: 3 additions & 0 deletions Project.toml
Original file line number Diff line number Diff line change
Expand Up @@ -18,3 +18,6 @@ Printf = "de0858da-6303-5e67-8744-51eddeeeb8d7"
Random = "9a3f8284-a2c9-5f02-9a11-845980a1fd5c"
SparseArrays = "2f01184e-e22b-5df5-ae63-d93ebab69eaf"
Test = "8dfed614-e22c-5e08-85e1-65c5234f0b40"

[compat]
Polynomials = "0.5.3"
30 changes: 9 additions & 21 deletions src/pid_design.jl
Original file line number Diff line number Diff line change
Expand Up @@ -32,10 +32,7 @@ One can also supply a frequency vector ω to be used in Bode and Nyquist plots
See also `loopshapingPI`, `stabregionPID`
"""
function pidplots(P::LTISystem, args...; kps=0, kis=0, kds=0, time=false, series=false, ω=0, grid = false)



function pidplots(P::LTISystem, args...; kps=0, kis=0, kds=0, time=false, series=false, ω=0, grid = false, kwargs...)
if grid
kp = [i for i in kps, j in kis, k in kds][:]
ki = [j for i in kps, j in kis, k in kds][:]
Expand All @@ -51,12 +48,6 @@ function pidplots(P::LTISystem, args...; kps=0, kis=0, kds=0, time=false, series

getColorSys(i) = convert(Colors.RGB,Colors.HSV(360*((i-1)/(length(kps)))^1.5,0.9,0.8))

gof_ = in(:gof ,args)
nyquist_ = in(:nyquist ,args)
controller_ = in(:controller ,args)
pz_ = in(:pz ,args)
nichols_ = in(:nichols ,args)

Cs = LTISystem[]
PCs = LTISystem[]
Ts = LTISystem[]
Expand All @@ -75,21 +66,18 @@ function pidplots(P::LTISystem, args...; kps=0, kis=0, kds=0, time=false, series
labels[i] = label
end

if nyquist_
nq = nyquistplot(PCs, ω, lab=labels, title="Nyquist curves")
if :nyquist args
nyquistplot(PCs, ω; lab=labels, title="Nyquist curves", kwargs...) |> display
end
if gof_
bd = gangoffourplot(P, Cs, ω, lab=labels)
if :gof args
gangoffourplot(P, Cs, ω; lab=labels, kwargs...) |> display
end
if pz_
pzmap(Ts, title="Pole-zero map")
if :pz args
pzmap(Ts; title="Pole-zero map", kwargs...) |> display
end
if controller_
cplot = bodeplot(Cs, ω, lab=labels, title="Controller bode plot")
if :controller args
bodeplot(Cs, ω; lab=labels, title="Controller bode plot", kwargs...) |> display
end



end

@userplot Rlocusplot
Expand Down
2 changes: 1 addition & 1 deletion src/types/SisoTfTypes/polyprint.jl
Original file line number Diff line number Diff line change
Expand Up @@ -31,7 +31,7 @@ function showterm2(io::IO, p::Poly{T}, j, first, var, mimetype) where {T}

pj == zero(T) && return false

pj = Polynomials.printsign(io, pj, j, first, mimetype)
pj = Polynomials.printsign(io, pj, first, mimetype)
Polynomials.printcoefficient(io, pj, j, mimetype)
Polynomials.printproductsign(io, pj, j, mimetype)
Polynomials.printexponent(io, var, j, mimetype)
Expand Down

0 comments on commit c7dc13a

Please sign in to comment.