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

back up

parent 892957ff
......@@ -361,10 +361,10 @@
;
begin type2_dll;
name dtu_we_controller;
filename C:\Users\famen\repos_BasicDTUController\build_DHI_vs17\src\dtu_we_controller\Debug\dtu_we_controller.dll;
; filename ./dtu_we_controller.dll;
; dll_subroutine_init init_regulation_advanced;
dll_subroutine_init init_external_ctrl_dll;
; filename C:\Users\famen\repos_BasicDTUController\build_DHI_vs17\src\dtu_we_controller\Debug\dtu_we_controller.dll;
filename ./control/dtu_we_controller.dll;
dll_subroutine_init init_regulation_advanced;
; dll_subroutine_init init_external_ctrl_dll;
dll_subroutine_update update_regulation;
arraysizes_init 100 1;
arraysizes_update 100 100;
......@@ -491,10 +491,10 @@
constant 88 0.0; Frequency of BP filter [Hz] (Default 0 if filter not used)
constant 89 0.02; Damping ratio of BP filter [-] (Default 0.02)
constant 90 0.0; Time constant of BP filter [s] (Default 0)
cosntant 91 0.0; Coefficient of linear term in gain scheduling for tower-pitch loop, KK1 [1/(m/s)];
; Kgain * (1 + KK1 *abs(WSPfilt - WSPrated) + KK2 * abs(WSPfilt - WSPrated)**2)
constant 91 0.0; Coefficient of linear term in gain scheduling for tower-pitch loop, KK1 [1/(m/s)];
; ; Kgain * (1 + KK1 *abs(WSPfilt - WSPrated) + KK2 * abs(WSPfilt - WSPrated)**2)
constant 92 0.0; Coefficient of quadratic term in gain scheduling for tower-pitch loop, KK2 [1/(m/s)^2];
cosntant 93 0.0; Coefficient of linear term in gain scheduling for tower-genTorq loop, KK1 [1/(m/s)];
constant 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
......@@ -525,7 +525,7 @@
;
begin type2_dll;
name generator_servo;
filename ./generator_servo.dll;
filename ./control/generator_servo.dll;
dll_subroutine_init init_generator_servo;
dll_subroutine_update update_generator_servo;
arraysizes_init 100 1;
......@@ -554,7 +554,7 @@
;
begin type2_dll;
name mech_brake;
filename ./mech_brake.dll;
filename ./control/mech_brake.dll;
dll_subroutine_init init_mech_brake;
dll_subroutine_update update_mech_brake;
arraysizes_init 100 1;
......@@ -579,7 +579,7 @@
;
begin type2_dll;
name servo_with_limits;
filename ./servo_with_limits.dll;
filename ./control/servo_with_limits.dll;
dll_subroutine_init init_servo_with_limits;
dll_subroutine_update update_servo_with_limits;
arraysizes_init 100 1;
......@@ -615,7 +615,7 @@
;-------------------------------------------
begin type2_dll;
name towerclearance_mblade;
filename ./towerclearance_mblade.dll;
filename ./control/towerclearance_mblade.dll;
dll_subroutine_init initialize;
dll_subroutine_update update;
arraysizes_init 3 1;
......
......@@ -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(110), intent(inout) :: array1
real(mk), dimension(100), intent(inout) :: array1
real(mk), dimension(1) , intent(inout) :: array2
! delclare loacl variables
type(TcontrolFile), pointer :: pAdditionalCtrlParamFile => null()
......@@ -610,13 +610,15 @@ subroutine init_regulation_advanced(array1, array2) bind(c,name='init_regulation
! 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
if (array1(97) .gt. 0.0_mk) then
write(6,*) "*** LICOREIM gain modifier is activated ***"
Licovar%time_detected = array1(96)
Licovar%amp = array1(97)
Licovar%x0 = array1(98)
Licovar%sigma = array1(99)
Licovar%p = array1(100)
endif
Licovar%gain = 1.000000000_mk
return
end subroutine init_regulation_advanced
......@@ -802,11 +804,17 @@ subroutine update_regulation(array1, array2) bind(c,name='update_regulation')
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)
if ((time .gt. Licovar%time_detected).and.(time .le.(Licovar%time_detected+Licovar%x0+Licovar%sigma*4))) then
! if ((time .gt. 100.00_mk) .and. (time .le. 110.00_mk)) then
write(6,*) "*** Re-writing the RPM gain at time = ", time, " s ***"
Licovar%gain = 1.0000_mk+ Licovar%amp*exp( - ((time - (Licovar%time_detected+Licovar%x0))**2/(2*Licovar%sigma**2))**Licovar%p)
else
Licovar%gain = 1.000000000_mk
endif
GenSpeed_unmod = GenSpeed
if (time .gt. 5.0_mk) then
GenSpeed = GenSpeed_unmod*Licovar%gain
endif
!***********************************************************************************************
! Safety system
!***********************************************************************************************
......
......@@ -127,7 +127,7 @@ module user_defined_types
real(mk) :: sigma = 1.0_mk
real(mk) :: x0 = 0.0_mk
real(mk) :: p = 1.0_mk
real(mk) :: gain = 0.0_mk
real(mk) :: gain = 1.0_mk
end type
! MIN CT control data type
......
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