Dear,
I am using the 5MW NREL turbine with the control routine provided in DISCON.dll. Currently, I am trying to simulate sensor and actuator faults on the Blade-Pitch Controller and Generator-Torque Controller loops. For this, I need to do some modifications to the DISCON.f90 code and I will need to access the internal variables of the controllers for implementing fault detection algorithms (I would need some variables included in an output file after the simulation with OpenFast).
I have to say I am not familiar with Fortran. However, from the code I see that there is a ‘debugging’ option that is enabled with the flag ‘PC_DbgOut’. This option seems to print or modify a file by printing a header and some variables values:
[code]! If we’re debugging the pitch controller, open the debug file and write the
! header:
IF ( PC_DbgOut ) THEN
OPEN ( UnDb, FILE=TRIM( RootName )//'.dbg', STATUS='REPLACE' )
WRITE (UnDb,'(/////)')
WRITE (UnDb,'(A)') 'Time '//Tab//'ElapTime'//Tab//'HorWindV'//Tab//'GenSpeed'//Tab//'GenSpeedF'//Tab//'RelSpdErr'//Tab// &
'SpdErr '//Tab//'IntSpdErr'//Tab//'GK '//Tab//'PitComP'//Tab//'PitComI'//Tab//'PitComT'//Tab// &
'PitRate1'//Tab//'PitRate2'//Tab//'PitRate3'//Tab//'PitCom1'//Tab//'PitCom2'//Tab//'PitCom3'//Tab// &
'BlPitch1'//Tab//'BlPitch2'//Tab//'BlPitch3'
WRITE (UnDb,'(A)') '(sec)'//Tab//'(sec) '//Tab//'(m/sec) '//Tab//'(rpm) '//Tab//'(rpm) '//Tab//'(%) '//Tab// &
'(rad/s)'//Tab//'(rad) '//Tab//'(-)'//Tab//'(deg) '//Tab//'(deg) '//Tab//'(deg) '//Tab// &
'(deg/s) '//Tab//'(deg/s) '//Tab//'(deg/s) '//Tab//'(deg) '//Tab//'(deg) '//Tab//'(deg) '//Tab// &
'(deg) '//Tab//'(deg) '//Tab//'(deg) '
OPEN ( UnDb2, FILE=TRIM( RootName )//'.dbg2', STATUS='REPLACE' )
WRITE (UnDb2,'(/////)')
WRITE (UnDb2,'(A,85("'//Tab//'AvrSWAP(",I2,")"))') 'Time ', (i,i=1,85)
WRITE (UnDb2,'(A,85("'//Tab//'(-)"))') '(s)'
ENDIF[/code]
[code]! Output debugging information if requested:
IF ( PC_DbgOut ) THEN
WRITE (UnDb,FmtDat) Time, ElapTime, HorWindV, GenSpeed*RPS2RPM, GenSpeedF*RPS2RPM, &
100.0*SpdErr/PC_RefSpd, SpdErr, IntSpdErr, GK, PitComP*R2D, PitComI*R2D, &
PitComT*R2D, PitRate*R2D, PitCom*R2D, BlPitch*R2D
END IF
ENDIF [/code]
I think I can make use of this debugging option in order to have access to the internal variables of the controllers. I tried to compile DISCON.f90 with 'PC_DbgOut = .TRUE. '. However, once I use the compiled DISCON.dll, I don’t see any new file once the simulation with OpenFast is over.
I guess I need to do something in addition for using the debugging option? like maybe create a file ‘.dbg’ with a name coinciding with ‘RootName’ in a given folder or something? (I don’t know what ‘RootName’ should be equal to, as I mentioned I am not familiar with Fortran).
Could you please help by pointing out how to enable correctly the debugging option?
Best regards,
Sandra Vasquez
PhD student