Commit 20d4c807 authored by gepir's avatar gepir
Browse files

Fixed filters so that they can be run iteratively. Avoided repeating the name...

Fixed filters so that they can be run iteratively. Avoided repeating the name of the global pitchcolref variable in a subroutine.
parent 259912f6
......@@ -106,9 +106,9 @@ function lowpass2orderfilt(dt, stepno, filt, x)
y = a1*filt%y1_old + a2*filt%y2_old + b0*x + b1*filt%x1_old + b2*filt%x2_old
endif
! Save previous values
filt%x2 = filt%x1
filt%x2 = filt%x1_old
filt%x1 = x
filt%y2 = filt%y1
filt%y2 = filt%y1_old
filt%y1 = y
filt%stepno1=stepno
! Output
......@@ -154,9 +154,9 @@ function notch2orderfilt(dt,stepno,filt,x)
y = a1*filt%y1_old + a2*filt%y2_old + b0*x + b1*filt%x1_old + b2*filt%x2_old
endif
! Save previous values
filt%x2 = filt%x1
filt%x2 = filt%x1_old
filt%x1 = x
filt%y2 = filt%y1
filt%y2 = filt%y1_old
filt%y1 = y
filt%stepno1 = stepno
! Output
......@@ -201,9 +201,9 @@ function bandpassfilt(dt, stepno, filt, x)
y = a1*filt%y1_old + a2*filt%y2_old + b0*x + b1*filt%x1_old + b2*filt%x2_old
endif
! Save previous values
filt%x2 = filt%x1
filt%x2 = filt%x1_old
filt%x1 = x
filt%y2 = filt%y1
filt%y2 = filt%y1_old
filt%y1 = y
filt%stepno1 = stepno
! Output
......
......@@ -353,7 +353,7 @@ subroutine shut_down(CtrlStatus, GenSpeed, PitchVect, wsp, GenTorqueRef, PitchCo
return
end subroutine shut_down
!**************************************************************************************************
subroutine monitoring(CtrlStatus, GridFlag, GenSpeed, TTAcc, PitchVect, PitchColRef, dump_array)
subroutine monitoring(CtrlStatus, GridFlag, GenSpeed, TTAcc, PitchVect, PitchColRefmonitor, dump_array)
!
! Lower level system monitoring. It changes the controller status to:
! - (1) if filtered GenSpeed is higher than the overspeed limit.
......@@ -368,7 +368,7 @@ subroutine monitoring(CtrlStatus, GridFlag, GenSpeed, TTAcc, PitchVect, PitchCol
real(mk), intent(in) :: TTAcc ! Tower top acceleration [m/s**2].
real(mk), intent(in) :: GenSpeed ! Measured generator speed [rad/s].
real(mk), intent(in) :: PitchVect(3) ! Measured pitch angles [rad].
real(mk), intent(in) :: PitchColRef ! Reference collective pitch [rad].
real(mk), intent(in) :: PitchColRefmonitor ! Reference collective pitch [rad].
real(mk), intent(inout) :: dump_array(50) ! Array for output.
real(mk) GenSpeedFilt, dGenSpeed_dtFilt, TTAccFilt
real(mk) y(2),DiffPitch
......@@ -433,9 +433,9 @@ subroutine monitoring(CtrlStatus, GridFlag, GenSpeed, TTAcc, PitchVect, PitchCol
PitchRefs(2:NAve_Pitch,1:3)=PitchRefs(1:NAve_Pitch-1,1:3)
! Update new values
PitchAngles(1,1:3)=PitchVect
PitchRefs(1,1)=PitchColRef
PitchRefs(1,2)=PitchColRef
PitchRefs(1,3)=PitchColRef
PitchRefs(1,1)=PitchColRefmonitor
PitchRefs(1,2)=PitchColRefmonitor
PitchRefs(1,3)=PitchColRefmonitor
! Add new values
AveragedMeanPitchAngles=AveragedMeanPitchAngles+PitchAngles(1,1:3)/dfloat(NAve_Pitch)
AveragedPitchReference=AveragedPitchReference+PitchRefs(1,1:3)/dfloat(NAve_Pitch)
......
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