Commit 892957ff authored by Alan Wai Hou Lio's avatar Alan Wai Hou Lio
Browse files

licoreim_wp3 init

parent 7a72b079
Pipeline #22444 failed with stage
in 3 minutes and 11 seconds
......@@ -497,6 +497,12 @@
cosntant 93 0.0; Coefficient of linear term in gain scheduling for tower-genTorq loop, KK1 [1/(m/s)];
constant 94 0.0; Coefficient of quadratic term in gain scheduling for tower-genTorq loop, KK2 [1/(m/s)^2];
constant 95 1.0; Choice of gain-scheduling variable (0: WSPfilt, 1:Pitch angle (Default))
; LICOREIM
constant 96 0.0; Time for detection [s]
constant 97 0.1; Amplitude of the gain [-]
constant 98 3.9; Time-delay of the signal [s]
constant 99 1.0; Sigma/width of the signal [-]
constant 100 1.0; Flatness of the signal [-]
end init;
;
begin output;
......
......@@ -328,7 +328,7 @@ subroutine init_regulation_advanced(array1, array2) bind(c,name='init_regulation
!DEC$ ATTRIBUTES DLLEXPORT::init_regulation_advanced
!GCC$ ATTRIBUTES DLLEXPORT::init_regulation_advanced
!DEC$ END IF
real(mk), dimension(100), intent(inout) :: array1
real(mk), dimension(110), intent(inout) :: array1
real(mk), dimension(1) , intent(inout) :: array2
! delclare loacl variables
type(TcontrolFile), pointer :: pAdditionalCtrlParamFile => null()
......@@ -397,6 +397,12 @@ subroutine init_regulation_advanced(array1, array2) bind(c,name='init_regulation
! cosntant 93 ; Coefficient of linear term in gain-scheduling for tower-genTorq loop, KK1 [1/(m/s)];
! constant 94 ; Coefficient of quadratic term in gain-scheduling for tower-genTorq loop, KK2 [1/(m/s)^2];
! constant 95 ; Choice of gain-scheduling variable (0: WSPfilt, 1: Pitch angle (Default));
! LICOREIM
! constant 96 ; Time for detection [s]
! constant 97 ; Amplitude of the gain [-]
! cosntant 98 ; Time-delay of the signal x0 [s]
! constant 99 ; Sigma/width of the signal [-]
! constant 100; flatness of the signal [-]
call init_regulation(array1, array2)
! Generator torque exclusion zone
if (array1(53).gt.0.0_mk) ExcluZone%Lwr = array1(53)
......@@ -597,6 +603,20 @@ subroutine init_regulation_advanced(array1, array2) bind(c,name='init_regulation
Floatingvar%KK1_tq = array1(93)
Floatingvar%KK2_tq = array1(94)
if (array1(95).gt.0.0_mk) Floatingvar%GSmode = array1(95)
! LICOREIM
! constant 96 ; Time for detection [s]
! constant 97 ; Amplitude of the gain [-]
! cosntant 98 ; Time-delay of the signal x0 [s]
! constant 99 ; Sigma/width of the signal [-]
! constant 100; flatness of the signal [-]
if (array1(96).gt.0.0_mk) then
Licovar%time_detected = array1(96)
Licovar%amp = array1(97)
Licovar%x0 = array1(98)
Licovar%sigma = array1(99)
Licovar%p = array1(100)
endif
return
end subroutine init_regulation_advanced
......@@ -733,6 +753,7 @@ subroutine update_regulation(array1, array2) bind(c,name='update_regulation')
real(mk) GenSpeed, wsp, PitchVect(3), Pe, TT_acc(2), time
real(mk) ipc_pitch(3);
real(mk) TTfa_vel ! floating
real(mk) GenSpeed_unmod ! LICOREIM
EmergPitchStop = 0
ActiveMechBrake = 0
! Global Time from HAWC2
......@@ -780,6 +801,12 @@ subroutine update_regulation(array1, array2) bind(c,name='update_regulation')
! Tower fore-aft velocity
TTfa_vel = array1(16)
!
! LICOREIM
if ((time.gt.Licovar%time_detected).and.(time.le.(Licovar%time_detected+Licovar%x0+Licovar%sigma*4))) then
Licovar%gain = Licovar%amp*exp( - ((time - (time+Licovar%x0))**2/(2*Licovar%sigma**2))**Licovar%p)
endif
GenSpeed_unmod = GenSpeed
GenSpeed = GenSpeed_unmod*Licovar%gain
!***********************************************************************************************
! Safety system
!***********************************************************************************************
......@@ -873,6 +900,9 @@ subroutine update_regulation(array1, array2) bind(c,name='update_regulation')
array2(46) = Floatingvar%TTfa_vel_filt ! 46: Filtered tower-top fore-aft velocity [m/s]
array2(47) = GenTorque_addition ! 47: Generator Torque from additional loop [Nm]
array2(48) = Pitch_addition ! 48: Blade pitch angle from additional loop [rad]
array2(49) = GenSpeed ! 49: Modified rotor speed [rad/s]
array2(50) = GenSpeed_unmod ! 50: Unmodified rotor speed [rad/s]
array2(51) = Licovar%gain ! 51: LICOREIM gain [-]
return
end subroutine update_regulation
!**************************************************************************************************
......
......@@ -80,6 +80,8 @@ module global_variables
type(Tfirstordervar), save :: switchingvar
type(Tlowpass2order), save :: float2orderlpfvar
type(Tbandpassfilt), save :: float2orderbpfvar
! Define variables for LICOREIM
type(TLICOREIMvar), save :: Licovar
! defined global variables for down regulation control strategy
type(TdownRegulationData), save :: downRegulationData
......
......@@ -119,6 +119,16 @@ module user_defined_types
real(mk) :: switchfactor = 0.0_mk
real(mk) :: TTfa_vel_filt = 0.0_mk
end type
! LICOREIM
type TLICOREIMvar
real(mk) :: time_detected = 0.0_mk
real(mk) :: amp = 0.0_mk
real(mk) :: sigma = 1.0_mk
real(mk) :: x0 = 0.0_mk
real(mk) :: p = 1.0_mk
real(mk) :: gain = 0.0_mk
end type
! MIN CT control data type
type TdownRegulationData
......
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