-
Notifications
You must be signed in to change notification settings - Fork 74
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 current lims to psy3 #1014
Merged
Merged
Add current lims to psy3 #1014
Changes from all commits
Commits
Show all changes
6 commits
Select commit
Hold shift + click to select a range
bf3aaa6
modify inverter struct model
rodrigomha 338c7e3
Add Inverter Limiter Structs
rodrigomha d390dcc
add test
rodrigomha 6e814dc
fix unbound params
rodrigomha be02aac
update tests
rodrigomha 871b134
Merge branch 'main' into rh/add_currentlims_to_psy3
rodrigomha File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#= | ||
This file is auto-generated. Do not edit. | ||
=# | ||
|
||
#! format: off | ||
|
||
""" | ||
mutable struct InstantaneousCurrentLimiter <: InverterLimiter | ||
Id_max::Float64 | ||
Iq_max::Float64 | ||
ext::Dict{String, Any} | ||
end | ||
|
||
Parameters of Instantaneous (Square) Current Controller Limiter | ||
|
||
# Arguments | ||
- `Id_max::Float64`: Maximum limit on d-axis current controller input current (device base), validation range: `(0, nothing)` | ||
- `Iq_max::Float64`: Maximum limit on d-axis current controller input current (device base), validation range: `(0, nothing)` | ||
- `ext::Dict{String, Any}` | ||
""" | ||
mutable struct InstantaneousCurrentLimiter <: InverterLimiter | ||
"Maximum limit on d-axis current controller input current (device base)" | ||
Id_max::Float64 | ||
"Maximum limit on d-axis current controller input current (device base)" | ||
Iq_max::Float64 | ||
ext::Dict{String, Any} | ||
end | ||
|
||
|
||
function InstantaneousCurrentLimiter(; Id_max, Iq_max, ext=Dict{String, Any}(), ) | ||
InstantaneousCurrentLimiter(Id_max, Iq_max, ext, ) | ||
end | ||
|
||
# Constructor for demo purposes; non-functional. | ||
function InstantaneousCurrentLimiter(::Nothing) | ||
InstantaneousCurrentLimiter(; | ||
Id_max=0, | ||
Iq_max=0, | ||
ext=Dict{String, Any}(), | ||
) | ||
end | ||
|
||
"""Get [`InstantaneousCurrentLimiter`](@ref) `Id_max`.""" | ||
get_Id_max(value::InstantaneousCurrentLimiter) = value.Id_max | ||
"""Get [`InstantaneousCurrentLimiter`](@ref) `Iq_max`.""" | ||
get_Iq_max(value::InstantaneousCurrentLimiter) = value.Iq_max | ||
"""Get [`InstantaneousCurrentLimiter`](@ref) `ext`.""" | ||
get_ext(value::InstantaneousCurrentLimiter) = value.ext | ||
|
||
"""Set [`InstantaneousCurrentLimiter`](@ref) `Id_max`.""" | ||
set_Id_max!(value::InstantaneousCurrentLimiter, val) = value.Id_max = val | ||
"""Set [`InstantaneousCurrentLimiter`](@ref) `Iq_max`.""" | ||
set_Iq_max!(value::InstantaneousCurrentLimiter, val) = value.Iq_max = val | ||
"""Set [`InstantaneousCurrentLimiter`](@ref) `ext`.""" | ||
set_ext!(value::InstantaneousCurrentLimiter, val) = value.ext = val |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
#= | ||
This file is auto-generated. Do not edit. | ||
=# | ||
|
||
#! format: off | ||
|
||
""" | ||
mutable struct MagnitudeCurrentLimiter <: InverterLimiter | ||
I_max::Float64 | ||
ext::Dict{String, Any} | ||
end | ||
|
||
Parameters of Magnitude (Circular) Current Controller Limiter | ||
|
||
# Arguments | ||
- `I_max::Float64`: Maximum limit on current controller input current (device base), validation range: `(0, nothing)` | ||
- `ext::Dict{String, Any}` | ||
""" | ||
mutable struct MagnitudeCurrentLimiter <: InverterLimiter | ||
"Maximum limit on current controller input current (device base)" | ||
I_max::Float64 | ||
ext::Dict{String, Any} | ||
end | ||
|
||
|
||
function MagnitudeCurrentLimiter(; I_max, ext=Dict{String, Any}(), ) | ||
MagnitudeCurrentLimiter(I_max, ext, ) | ||
end | ||
|
||
# Constructor for demo purposes; non-functional. | ||
function MagnitudeCurrentLimiter(::Nothing) | ||
MagnitudeCurrentLimiter(; | ||
I_max=0, | ||
ext=Dict{String, Any}(), | ||
) | ||
end | ||
|
||
"""Get [`MagnitudeCurrentLimiter`](@ref) `I_max`.""" | ||
get_I_max(value::MagnitudeCurrentLimiter) = value.I_max | ||
"""Get [`MagnitudeCurrentLimiter`](@ref) `ext`.""" | ||
get_ext(value::MagnitudeCurrentLimiter) = value.ext | ||
|
||
"""Set [`MagnitudeCurrentLimiter`](@ref) `I_max`.""" | ||
set_I_max!(value::MagnitudeCurrentLimiter, val) = value.I_max = val | ||
"""Set [`MagnitudeCurrentLimiter`](@ref) `ext`.""" | ||
set_ext!(value::MagnitudeCurrentLimiter, val) = value.ext = val |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,55 @@ | ||
#= | ||
This file is auto-generated. Do not edit. | ||
=# | ||
|
||
#! format: off | ||
|
||
""" | ||
mutable struct PriorityCurrentLimiter <: InverterLimiter | ||
I_max::Float64 | ||
ϕ_I::Float64 | ||
ext::Dict{String, Any} | ||
end | ||
|
||
Parameters of Priority-Based Current Controller Limiter | ||
|
||
# Arguments | ||
- `I_max::Float64`: Maximum limit on current controller input current (device base), validation range: `(0, nothing)` | ||
- `ϕ_I::Float64`: Pre-defined angle (measured against the d-axis) for Iref once limit is hit, validation range: `(-1.571, 1.571)` | ||
- `ext::Dict{String, Any}` | ||
""" | ||
mutable struct PriorityCurrentLimiter <: InverterLimiter | ||
"Maximum limit on current controller input current (device base)" | ||
I_max::Float64 | ||
"Pre-defined angle (measured against the d-axis) for Iref once limit is hit" | ||
ϕ_I::Float64 | ||
ext::Dict{String, Any} | ||
end | ||
|
||
|
||
function PriorityCurrentLimiter(; I_max, ϕ_I, ext=Dict{String, Any}(), ) | ||
PriorityCurrentLimiter(I_max, ϕ_I, ext, ) | ||
end | ||
|
||
# Constructor for demo purposes; non-functional. | ||
function PriorityCurrentLimiter(::Nothing) | ||
PriorityCurrentLimiter(; | ||
I_max=0, | ||
ϕ_I=0, | ||
ext=Dict{String, Any}(), | ||
) | ||
end | ||
|
||
"""Get [`PriorityCurrentLimiter`](@ref) `I_max`.""" | ||
get_I_max(value::PriorityCurrentLimiter) = value.I_max | ||
"""Get [`PriorityCurrentLimiter`](@ref) `ϕ_I`.""" | ||
get_ϕ_I(value::PriorityCurrentLimiter) = value.ϕ_I | ||
"""Get [`PriorityCurrentLimiter`](@ref) `ext`.""" | ||
get_ext(value::PriorityCurrentLimiter) = value.ext | ||
|
||
"""Set [`PriorityCurrentLimiter`](@ref) `I_max`.""" | ||
set_I_max!(value::PriorityCurrentLimiter, val) = value.I_max = val | ||
"""Set [`PriorityCurrentLimiter`](@ref) `ϕ_I`.""" | ||
set_ϕ_I!(value::PriorityCurrentLimiter, val) = value.ϕ_I = val | ||
"""Set [`PriorityCurrentLimiter`](@ref) `ext`.""" | ||
set_ext!(value::PriorityCurrentLimiter, val) = value.ext = val |
Oops, something went wrong.
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
We missing the circle one?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Magnitude is circle, Instantaneous is Square, based on this paper: https://ieeexplore.ieee.org/stamp/stamp.jsp?arnumber=9973369
We can change the name to circular, and square