forked from NREL/ROSCO
-
Notifications
You must be signed in to change notification settings - Fork 0
Commit
This commit does not belong to any branch on this repository, and may belong to a fork outside of the repository.
- Loading branch information
Sebastiaan Mulders
committed
Aug 28, 2017
0 parents
commit 79be70f
Showing
14 changed files
with
1,501 additions
and
0 deletions.
There are no files selected for viewing
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,46 @@ | ||
!Wind file for Trivial turbine. | ||
!Time Wind Wind Vert. Horiz. Vert. LinV Gust | ||
! Speed Dir Speed Shear Shear Shear Speed | ||
0.00 7.0 0.00 0.00 0.00 0.00 0.00 0.00 | ||
0.10 7.0 0.00 0.00 0.00 0.00 0.00 0.00 | ||
100.00 7.0 0.00 0.00 0.00 0.00 0.00 0.00 | ||
100.10 8.0 0.00 0.00 0.00 0.00 0.00 0.00 | ||
200.00 8.0 0.00 0.00 0.00 0.00 0.00 0.00 | ||
200.10 9.0 0.00 0.00 0.00 0.00 0.00 0.00 | ||
300.00 9.0 0.00 0.00 0.00 0.00 0.00 0.00 | ||
300.10 10.0 0.00 0.00 0.00 0.00 0.00 0.00 | ||
400.00 10.0 0.00 0.00 0.00 0.00 0.00 0.00 | ||
400.10 11.0 0.00 0.00 0.00 0.00 0.00 0.00 | ||
500.00 11.0 00.0 0.00 0.00 0.00 0.00 0.00 | ||
500.10 10.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
600.00 10.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
600.10 11.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
700.00 11.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
700.10 12.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
800.00 12.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
800.10 13.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
900.00 13.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
900.10 14.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1000.00 14.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1000.10 15.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1100.00 15.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1100.10 16.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1200.00 16.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1200.10 17.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1300.00 17.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1300.10 18.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1400.00 18.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1400.10 19.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1500.00 19.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1500.10 20.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1600.00 20.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1600.10 21.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1700.00 21.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1700.10 22.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1800.00 22.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1800.10 23.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1900.00 23.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
1900.10 24.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
2000.00 24.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
2000.10 25.00 0.00 0.00 0.00 0.00 0.00 0.00 | ||
2100.00 25.00 0.00 0.00 0.00 0.00 0.00 0.00 |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
5.0 = User Variable 1: K [Nm/(rad/s)2] | ||
3.5 = User Variable 2: | ||
2.3 = User Variable 3: | ||
0.0 = User Variable 4: | ||
0.0 = User Variable 5: | ||
0.0 = User Variable 6: | ||
0.0 = User Variable 7: | ||
0.0 = User Variable 8: | ||
0.0 = User Variable 9: | ||
0.0 = User Variable 10: |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,53 @@ | ||
:: Compiling and Testing Discon.f90 | ||
|
||
echo off | ||
|
||
:: Set this to the absolute path of FAST. In that | ||
:: case also make sure the correct drive is selected | ||
set "FASTdir=C:\FAST" | ||
|
||
:: Set these to the absolute path of your archive directory. Does not necessarily have | ||
:: to be the current directory | ||
set "ArchiveDir=C:\FASTArchive" | ||
|
||
:: Go to the drive where FAST is located | ||
C: | ||
|
||
Remove old .dll file | ||
DEL %FASTdir%\CertTest\5MW_Baseline\ServoData\DISCON_gwin32.dll | ||
|
||
:: Compile new .dll file | ||
cd %FASTdir%\Compiling | ||
mingw32-make.exe | ||
|
||
:: Run Test18 | ||
echo off | ||
cd ..\CertTest | ||
echo on | ||
FAST_Win32.exe Test18.fst | ||
|
||
echo off | ||
:: Make new directory with correct timestamp | ||
|
||
Get the timestamp | ||
for /f "tokens=2 delims==" %%a in ('wmic OS Get localdatetime /value') do set "dt=%%a" | ||
set "YYYY=%dt:~0,4%" & set "MM=%dt:~4,2%" & set "DD=%dt:~6,2%" | ||
set "HH=%dt:~8,2%" & set "Min=%dt:~10,2%" | ||
set "stamp=%YYYY%_%MM%_%DD%_%HH%%Min%" | ||
|
||
:: Put together the directory name and create it | ||
set "dbFolder=%ArchiveDir%\%stamp%" | ||
mkdir %dbFolder% | ||
|
||
:: Copy debug files to this directory | ||
copy Test18.sum %dbFolder%\Test18.sum | ||
copy Test18.AD.sum %dbFolder%\Test18.AD.sum | ||
copy Test18.ED.sum %dbFolder%\Test18.ED.sum | ||
copy Test18.out %dbFolder%\Test18.out | ||
copy Test18.SrvD.dbg %dbFolder%\Test18.SrvD.dbg | ||
copy Test18.SrvD.dbg2 %dbFolder%\Test18.SrvD.dbg2 | ||
|
||
|
||
:: Echo the debug directory so matlab can potentially pick it up | ||
echo %dbFolder% | ||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,22 @@ | ||
:: Compiling DISCON dll and run Test 18 | ||
:: Pauses afterwards so command window output can be read | ||
|
||
:: Change these to the absolute path of FAST. In that | ||
:: case also make sure the correct drive is selected | ||
set "FASTdir=C:\FAST" | ||
|
||
:: Go to the correct drive | ||
C: | ||
|
||
:: Remove old .dll file | ||
DEL %FASTdir%\CertTest\5MW_Baseline\ServoData\DISCON_gwin32.dll | ||
|
||
:: Compile new .dll file | ||
cd %FASTdir%\Compiling | ||
mingw32-make.exe | ||
|
||
:: Run Test18 | ||
cd ..\CertTest | ||
FAST_Win32.exe Test18.fst | ||
|
||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,170 @@ | ||
%% PlotDebugData | ||
% Imports and plots data from dbg and dbg2 files | ||
|
||
%% Cleaning | ||
close all | ||
clearvars | ||
clc | ||
|
||
%% Settings | ||
% set timeStamp (format: YYYY_MM_DD_TTTT or 2017_01_01_1200) to the test | ||
% directory you want to import and plot | ||
timeStamp = '2017_08_17_1448'; | ||
% Run the CompileRunAndDebug.cmd file from this matlab script | ||
runCmdFromHere = false; | ||
|
||
%% Loading | ||
totalTime = tic; | ||
if(runCmdFromHere) % Run CompileRunAndDebug.cmd and get the correct folder | ||
|
||
[~,output] = dos('CompileRunAndDebug.cmd', '-echo'); | ||
i = strfind(output,'C:'); | ||
i = i(end); | ||
debugFolder = [output(i:end-1) '\']; | ||
clearvars output TimeStamp | ||
|
||
else % otherwise get the debugfolder with the manual timestamp | ||
|
||
debugFolder = [timeStamp '\']; | ||
clearvars d order | ||
|
||
end | ||
|
||
% Import data from Test18.out and put in the debug structure | ||
dbRaw = dlmread([debugFolder 'Test18.SrvD.dbg'],'\t',8,0); | ||
[~,vars] = size(dbRaw); | ||
|
||
fid = fopen([debugFolder 'Test18.SrvD.dbg']); | ||
header = textscan(fid,'%s','delimiter','\t'); | ||
fclose(fid); | ||
|
||
header = strtrim(header{1,1}(1:vars)); | ||
for i = 1:vars | ||
db.(header{i}) = dbRaw(:,i); | ||
end | ||
|
||
% Import avrSWAP debug file | ||
avrSWAP = dlmread([debugFolder 'Test18.SrvD.dbg2'],'\t',8,0); | ||
avrTime = avrSWAP(:,1); | ||
avrSWAP = avrSWAP(:,2:end); | ||
|
||
|
||
%% Plotting | ||
figure | ||
title('GenSpeed') | ||
hold on | ||
plot(db.Time,db.GenSpeed) | ||
plot(db.Time,db.GenSpeedF) | ||
legend('GenSpeed','GenSpeedF') | ||
ylabel('Speed [rpm]') | ||
|
||
figure | ||
title('GenTorque') | ||
hold on | ||
plot(avrTime,avrSWAP(:,47)) | ||
|
||
% figure | ||
% title('Pitch') | ||
% hold on | ||
% subplot(2,1,1), plot(Time,PitCom1) | ||
% legend('PitCom1') | ||
% subplot(2,1,2), plot(Time,PitRate1) | ||
% legend('PitRate1') | ||
% | ||
figure | ||
title('Pitch') | ||
hold on | ||
plot(db.Time,db.PitCom1) | ||
% plot(Time,PitRate1) | ||
plot(db.Time,db.BlPitch1) | ||
plot(db.Time,db.PitComT1) | ||
% plot(Time,PitComT) | ||
% plot(Time,GenTrq) | ||
legend('PitCom1','BlPitch1','PitComT') | ||
|
||
figure | ||
title('rootMOOP') | ||
hold on | ||
plot(db.Time,db.rootMOOP1) | ||
% plot(Time,rootMOOPF1) | ||
% plot(Time,rootMOOP2) | ||
% % plot(Time,rootMOOPF2) | ||
% plot(Time,rootMOOP3) | ||
% plot(Time,rootMOOPF3) | ||
legend('rootMOOP1') | ||
|
||
figure | ||
title('PitComIPC') | ||
hold on | ||
plot(db.Time,db.PitComF1) | ||
% plot(Time,PitComIPCF2) | ||
% plot(Time,PitComIPCF3) | ||
legend('PitComIPCF1') | ||
% | ||
figure | ||
title('WindVelocity') | ||
hold on | ||
plot(db.Time,db.HorWindV) | ||
legend('HorWindV') | ||
|
||
% figure | ||
% title('PitComT') | ||
% hold on | ||
% plot(Time,PitComT1) | ||
% plot(Time,PitComT2) | ||
% plot(Time,PitComT3) | ||
% legend('PitComT1','PitComT2','PitComT3') | ||
% | ||
% figure | ||
% title('PitRate') | ||
% hold on | ||
% plot(Time,PitRate1) | ||
% plot(Time,PitRate2) | ||
% plot(Time,PitRate3) | ||
% legend('PitRate1','PiRate2','PitRate3') | ||
% | ||
% figure | ||
% title('PitCom') | ||
% hold on | ||
% plot(Time,PitCom1) | ||
% plot(Time,PitCom2) | ||
% plot(Time,PitCom3) | ||
% legend('PitCom1','PitCom2','PitCom3') | ||
% | ||
% figure | ||
% title('Measured yaw error') | ||
% hold on | ||
% plot(db.Time,db.MErr) | ||
% plot(db.Time,db.ErrLPFFast) | ||
% plot(db.Time,db.ErrLPFSlow) | ||
% plot(db.Time,rad2deg(avrSWAP(:,37))) | ||
% legend('MErr','ErrLPFFast','ErrLPFSlow','Turibine yaw') | ||
% | ||
% figure | ||
% title('Integral of fast yaw error') | ||
% hold on | ||
% grid on | ||
% plot(db.Time,db.ErrLPFFast) | ||
% plot(db.Time,db.Y_AccErr) | ||
% legend('ErrLPFFast','AccErr') | ||
|
||
% figure | ||
% title('Yaw Rate') | ||
% hold on | ||
% grid on | ||
% plot(db.Time,avrSWAP(:,48)) | ||
% legend('Yaw Rate') | ||
|
||
% figure | ||
% title('YawTorque') | ||
% hold on | ||
% grid on | ||
% plot(avrTime,avrSWAP(:,41)) | ||
% legend('YawTorque') | ||
% | ||
% figure | ||
% title('Yaw end time') | ||
% hold on | ||
% plot(db.Time,db.Y_YawEndT) | ||
% plot(db.Time,db.Time) | ||
% legend('YawEndT','Time') |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,10 @@ | ||
%% saveFigs | ||
% Saves all current figures. Can only be used after plotData is excecuted. | ||
% Same code as in plotData, used so it can easily be executed from the | ||
% command window. | ||
figArray=findall(0,'type','figure'); | ||
for i = 1:length(figArray) | ||
figure(figArray(i).Number) | ||
saveas(figArray(i),[debugFolder 'fig' get(get(gca,'title'),'string') '.fig']); | ||
end | ||
disp(['Saved all figures to ' debugFolder(1:end-1)]); |
Binary file not shown.
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,18 @@ | ||
:: Compiling DISCON | ||
|
||
:: Main FAST directory: | ||
:: Change this to the absolute path if this script is not located in the FAST main folder. | ||
:: In that case also make sure the correct drive is selected | ||
set "FASTdir=." | ||
|
||
:: Go to the correct drive | ||
:: C: | ||
|
||
:: Remove old .dll file | ||
DEL %FASTdir%\CertTest\5MW_Baseline\ServoData\DISCON_gwin32.dll | ||
|
||
:: Compile new .dll file | ||
cd %FASTdir%\Compiling | ||
mingw32-make.exe | ||
|
||
pause |
This file contains bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Original file line number | Diff line number | Diff line change |
---|---|---|
@@ -0,0 +1,13 @@ | ||
:: Running Test18 | ||
|
||
:: Main FAST directory: | ||
:: Change this to the absolute path if this script is not located in the FAST main folder. | ||
:: In that case also make sure the correct drive is selected | ||
set "FASTdir=." | ||
|
||
:: Go to the correct drive | ||
:: C: | ||
|
||
:: Run | ||
cd %FASTdir%\CertTest | ||
FAST_Win32.exe Test18.fst |
Oops, something went wrong.