Unverified Commit f2fa409a authored by gepirdtu's avatar gepirdtu Committed by GitHub
Browse files

Merge pull request #31 from DTUWindEnergy/check_iteration

Check iteration
parents c603390a 377c37bf
......@@ -448,6 +448,9 @@ begin dll;
constant 75 1 ;
; Gear ratio
constant 76 1 ;
; rotor speed notch filter for constant power operation above rated
constant 77 3.55 ; Frequency of notch filter [Hz] applied on the rotor speed before computing torque above rated (constant power), if zero no notch filter used
constant 78 0.0 ; Damping of notch filter [-] applied on the rotor speed before computing torque above rated (constant power), (Default 0.01 used if zero)
end init ;
;
begin output ;
......
......@@ -448,6 +448,9 @@ begin dll;
constant 75 1 ;
; Gear ratio
constant 76 1 ;
; rotor speed notch filter for constant power operation above rated
constant 77 3.55 ; Frequency of notch filter [Hz] applied on the rotor speed before computing torque above rated (constant power), if zero no notch filter used
constant 78 0.0 ; Damping of notch filter [-] applied on the rotor speed before computing torque above rated (constant power), (Default 0.01 used if zero)
end init ;
;
begin output ;
......
......@@ -273,6 +273,8 @@ subroutine init_regulation(array1, array2) bind(c, name='init_regulation')
SafetySystemVar%RysteVagtLevel = MoniVar%RysteVagtLevel*1.1_mk
! Gear Ratio
GearRatio = 1.0_mk
! Deactivate the filter on rotor speed for generator torque computation above rated
DT_mode_filt_torque%f0 = 0.0_mk
! Pitch devaiation monitor
DeltaPitchThreshold = 0.0_mk
TAve_Pitch = 0.0_mk
......@@ -326,7 +328,9 @@ subroutine init_regulation_advanced(array1, array2) bind(c,name='init_regulation
! ; where 'nnn' [s] is the period of the moving average and 'mmm' is threshold of the deviation [0.1 deg] (functionality is inactive if value $<$ 1,000,000)
! Gear ratio
! constant 76 ; Gear ratio used for the calculation of the LSS rotational speeds and the HSS generator torque reference [-] (Default 1 if zero)
!
! Rotor speed notch filter
! constant 77 ; Frequency of notch filter [Hz] applied on the rotor speed before computing torque above rated (constant power), if zero no notch filter used
! constant 78 ; Damping of notch filter [-] applied on the rotor speed before computing torque above rated (constant power), (Default 0.01 used if zero)
call init_regulation(array1, array2)
! Generator torque exclusion zone
if (array1(53).gt.0.0_mk) ExcluZone%Lwr = array1(53)
......@@ -363,6 +367,9 @@ subroutine init_regulation_advanced(array1, array2) bind(c,name='init_regulation
endif
! Gear ratio
if (array1(76).gt.0.0_mk) GearRatio = array1(76)
! Notch filter on rotor speed signal used for constant power tracking above rated
if (array1(77).gt.0.0_mk) DT_mode_filt_torque%f0 = array1(77)
if (array1(78).gt.0.0_mk) DT_mode_filt_torque%zeta2 = array1(78)
! Initialization
TimerExcl = -0.02_mk
return
......
......@@ -113,7 +113,7 @@ function lowpass2orderfilt(dt, stepno, filt, x)
filt%stepno1=stepno
! Output
lowpass2orderfilt(1) = y
lowpass2orderfilt(2) = (y - filt%y2_old)/dt
lowpass2orderfilt(2) = (y - filt%y1_old)/dt
return
end function lowpass2orderfilt
!**************************************************************************************************
......
......@@ -40,6 +40,7 @@ module turbine_controller_mod
type(Tfirstordervar), save :: wspfirstordervar
type(Tpidvar), save :: PID_gen_var
type(Tnotch2order), save :: DT_mode_filt
type(Tnotch2order), save :: DT_mode_filt_torque
type(Tnotch2order), save :: pwr_DT_mode_filt
type(Tpid2var), save :: PID_pit_var
type(Tdamper), save :: DT_damper
......@@ -478,7 +479,7 @@ subroutine torquecontroller(GenSpeed, GenSpeedFilt, dGenSpeed_dtFilt, PitchMean,
real(mk) GenTorqueMin_full, GenTorqueMax_full, GenTorqueMin_partial, GenTorqueMax_partial
real(mk) GenSpeed_min1, GenSpeed_min2, GenSpeed_max1, GenSpeed_max2, GenSpeedRef
real(mk) x, switch, switch_pitang_lower, switch_pitang_upper,ConstantPowerTorque
real(mk) kgain(3), GenSpeedFiltErr, GenSpeedErr, outmin, outmax
real(mk) kgain(3), GenSpeedFiltErr, GenSpeedErr, outmin, outmax, GenSpeedFiltTorque
!***********************************************************************************************
! Speed ref. changes max. <-> min. for torque contr. and remains at rated for pitch contr.
!***********************************************************************************************
......@@ -503,7 +504,13 @@ subroutine torquecontroller(GenSpeed, GenSpeedFilt, dGenSpeed_dtFilt, PitchMean,
!-----------------------------------------------------------------------------------------------
! Limits for full load
!-----------------------------------------------------------------------------------------------
ConstantPowerTorque=min((GenTorqueRated*GenSpeedRef_full)/max(GenSpeed, GenSpeedRefMin),GenTorqueMax)
if (DT_mode_filt_torque%f0 .gt. 0.0_mk) then
GenSpeedFiltTorque=notch2orderfilt(deltat, stepno, DT_mode_filt_torque, Genspeed)
else
GenSpeedFiltTorque= Genspeed
endif
ConstantPowerTorque=min((GenTorqueRated*GenSpeedRef_full)/max(GenSpeedFiltTorque, GenSpeedRefMin),GenTorqueMax)
GenTorqueMin_full = GenTorqueRated*(1.0_mk-TorqueCtrlRatio) + ConstantPowerTorque*TorqueCtrlRatio
GenTorqueMax_full = GenTorqueMin_full
!-----------------------------------------------------------------------------------------------
......
Markdown is supported
0% or .
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment