Improve the pss inputs calculation functions
jd-lara opened this issue · 1 comments
jd-lara commented
as reported by @tavovalmo the current functions to fetch PSS inputs are unclear and in some cases incomplete. For instance:
function get_pss_input_signal(
::Val{2},
device_states::AbstractArray{<:ACCEPTED_REAL_TYPES},
inner_vars::AbstractArray{<:ACCEPTED_REAL_TYPES},
ω_sys::ACCEPTED_REAL_TYPES,
dynamic_device::DynamicWrapper{PSY.DynamicGenerator{M, S, A, TG, P}},
) where {M <: PSY.Machine, S <: PSY.Shaft, A <: PSY.AVR, TG <: PSY.TurbineGov, P <: PSY.PSS}
# TODO: Frequency Input for PSS not properly supported yet"
return ω_sys - 1.0
end
We need to improve the interface and implement other inputs like speed.
tavovalmo commented
Stab1 uses speed deviation too. However, I struggled to understand how to choose option 1. I finally used what José suggested:
external_ix = get_input_port_ix(dynamic_device, M)
ω = device_states[external_ix[1]] # get machine speed
u = ω - 1.0