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

Yaw control init

parent 0be69428
Pipeline #22461 passed with stage
in 3 minutes and 55 seconds
......@@ -397,6 +397,11 @@ 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));
! constant 96 ; Yaw rate [rad/s]
! constant 97 ; Time to start yawing [s]
! constant 98 ; Time to stop yawing [s]
! constant 99 ; Cut-off frequency of the low-pass filter for yaw rate [Hz]
! constant 100; Time to yaw back to zero degree [s]
call init_regulation(array1, array2)
! Generator torque exclusion zone
if (array1(53).gt.0.0_mk) ExcluZone%Lwr = array1(53)
......@@ -597,6 +602,18 @@ 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)
! Yaw controller
! constant 96 ; Yaw rate [rad/s]
! constant 97 ; Time to start yawing [s]
! constant 98 ; Time to stop yawing [s]
! constant 99 ; Cut-off frequency of the low-pass filter for yaw rate [Hz]
if (array1(96).gt.0.0_mk) then
Yawvar%YawRate = array1(96)
Yawvar%Time_on = array1(97)
Yawvar%Time_off = array1(98)
yaw1odervar%tau = 1/(2*pi*array1(99))
endif
return
end subroutine init_regulation_advanced
......@@ -733,6 +750,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) y_yaw
EmergPitchStop = 0
ActiveMechBrake = 0
! Global Time from HAWC2
......@@ -818,6 +836,20 @@ subroutine update_regulation(array1, array2) bind(c,name='update_regulation')
if ((abs(Floatingvar%TPgain) .gt. 0.0_mk).or.(abs(Floatingvar%TGgain) .gt. 0.0_mk)) then
call floating_controller(CtrlStatus, time, Floatingvar, TTfa_vel, wsp, Pitch_addition, GenTorque_addition, dump_array)
endif
! *****************************************************************
! Yaw control
! *****************************************************************
if (Yawvar%YawRate .gt. 0.0_mk) then
if ((time .gt. Yawvar%Time_on ) .and. (time .lt. Yawvar%Time_off)) then
y_yaw = Yawvar%YawRate
write(6,*) "Yaw rate is active at time = ", nint(time*100)/100, " s"
else
y_yaw = 0.0_mk
endif
else
y_yaw = 0.0_mk
endif
Yawvar%YawRateFilt = lowpass1orderfilt(deltat,stepno, yaw1odervar, y_yaw)
!***********************************************************************************************
! Output
!***********************************************************************************************
......@@ -873,6 +905,7 @@ 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) = Yawvar%YawRateFilt ! 49 : Filtered Yaw Rate [rad/s]
return
end subroutine update_regulation
!**************************************************************************************************
......
......@@ -131,7 +131,7 @@ subroutine DISCON (avrSWAP, aviFAIL, avcINFILE, avcOUTNAME, avcMSG) bind(c,name=
avrSWAP(45) = array2( 2) ! Use the command angle of blade 1 if using collective pitch
avrSWAP(46) = 0.0e0 ! Demanded pitch rate (Collective pitch)
avrSWAP(47) = array2( 1)/gearboxRatio ! Demanded generator torque
avrSWAP(48) = 0.0e0 ! Demanded nacelle yaw rate
avrSWAP(48) = array2(49) ! Demanded nacelle yaw rate
avrSWAP(55) = 0.0e0 ! Pitch override: 0=yes
avrSWAP(56) = 0.0e0 ! Torque override: 0=yes
avrSWAP(65) = 0.0e0 ! Number of variables returned for logging
......
......@@ -80,6 +80,10 @@ module global_variables
type(Tfirstordervar), save :: switchingvar
type(Tlowpass2order), save :: float2orderlpfvar
type(Tbandpassfilt), save :: float2orderbpfvar
! Yaw control
type(TYawControl), save :: Yawvar
type(Tfirstordervar), save :: yaw1odervar
! defined global variables for down regulation control strategy
type(TdownRegulationData), save :: downRegulationData
......
......@@ -119,7 +119,12 @@ module user_defined_types
real(mk) :: switchfactor = 0.0_mk
real(mk) :: TTfa_vel_filt = 0.0_mk
end type
! Yaw control
type TYawControl
real(mk) :: YawRate = 0.0_mk
real(mk) :: YawRateFilt = 0.0_mk
real(mk) :: Time_on, Time_off
end type
! MIN CT control data type
type TdownRegulationData
real(mk) Cp(MAX_NUM_Pitch,1)
......
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