Skip to content
Snippets Groups Projects
Commit 0d90bd7c authored by Marco Marchesi's avatar Marco Marchesi
Browse files

NAS consistency check

parent 92f7e7ef
Branches
No related tags found
No related merge requests found
...@@ -106,7 +106,7 @@ ylabel('Mass [kg]') ...@@ -106,7 +106,7 @@ ylabel('Mass [kg]')
set(gca,"YColor",'#D3212D') set(gca,"YColor",'#D3212D')
xlim([-1160,-1000]) xlim([-1160,-1000])
legend legend
exportStandardizedFigure(gcf, 'TARS pressure mass',textDim, 'addMarkers',false,'changeColors',false,'overwriteFigure',true) exportStandardizedFigure(gcf, 'TARS pressure mass',textDim, 'addMarkers',false,'changeColors',false,'overwriteFigure',true,'exportPDF',false)
figure figure
yyaxis left yyaxis left
...@@ -126,7 +126,7 @@ legend ...@@ -126,7 +126,7 @@ legend
set(gca,"YColor",'#D3212D') set(gca,"YColor",'#D3212D')
xlim([-1160,-1000]) xlim([-1160,-1000])
title('Mass finite difference vs venting valve') title('Mass finite difference vs venting valve')
exportStandardizedFigure(gcf, 'TARS mass offset',textDim, 'addMarkers',false,'changeColors',false,'overwriteFigure',true) exportStandardizedFigure(gcf, 'TARS mass offset',textDim, 'addMarkers',false,'changeColors',false,'overwriteFigure',true,'exportPDF',false)
% % % commento: non abbiamo lasciato che TARS finisse, ma abbiamo stoppato % % % commento: non abbiamo lasciato che TARS finisse, ma abbiamo stoppato
% % % noi perché abbiamo visto fase liquida. Probabilmente si % % % noi perché abbiamo visto fase liquida. Probabilmente si
...@@ -384,18 +384,19 @@ xline(main.NASData(main.NASApogeeIndex,1),'--','APOGEE','HandleVisibility','off' ...@@ -384,18 +384,19 @@ xline(main.NASData(main.NASApogeeIndex,1),'--','APOGEE','HandleVisibility','off'
% % % Mi devo inventare un modo per sincronizzarle % % % Mi devo inventare un modo per sincronizzarle
%% MAGNETOMETER CALIBRATION %% MAGNETOMETER CALIBRATION
figure fig_magnetometerCalibration = figure;
scatter3(main.MAGNETOMETER(:,2),main.MAGNETOMETER(:,3),main.MAGNETOMETER(:,4),'.','DisplayName','Raw') % scatter3(main.MAGNETOMETER(:,2),main.MAGNETOMETER(:,3),main.MAGNETOMETER(:,4),'.','DisplayName','Raw')
hold on; hold on;
scatter3(main.IMU_CORRECTED(:,10),main.IMU_CORRECTED(:,11),main.IMU_CORRECTED(:,12),'.','DisplayName','Rotated') scatter3(main.IMU_CORRECTED(:,10),main.IMU_CORRECTED(:,11),main.IMU_CORRECTED(:,12),'.','DisplayName','Rotated')
scatter3(sensorTot.imu.magnetometerMeasuresCalib(:,1),sensorTot.imu.magnetometerMeasuresCalib(:,2),sensorTot.imu.magnetometerMeasuresCalib(:,3),'.','DisplayName','Calibrated') scatter3(sensorTot.imu.magnetometerMeasuresCalib(:,1),sensorTot.imu.magnetometerMeasuresCalib(:,2),sensorTot.imu.magnetometerMeasuresCalib(:,3),'.','DisplayName','Calibrated')
axis equal axis equal
legend legend
title('Magnetometer calibration') title('Magnetometer calibration')
xlabel('X') xlabel('X')
ylabel('Y') ylabel('Y')
zlabel('Z') zlabel('Z')
view(-60,40)
% exportgraphics(fig_magnetometerCalibration,'MagnetometerCalibration.pdf')
% % % commento: i dati raw ok, però anche i dati non raw non sono calibrati % % % commento: i dati raw ok, però anche i dati non raw non sono calibrati
% % % purtroppo, la sfera non è centrata in zero, a meno che non % % % purtroppo, la sfera non è centrata in zero, a meno che non
...@@ -587,7 +588,7 @@ xlabel('Altitude [m]') ...@@ -587,7 +588,7 @@ xlabel('Altitude [m]')
legend legend
title('ABK vs References') title('ABK vs References')
ylim([0,1.1]) ylim([0,1.1])
exportStandardizedFigure(gcf, 'ABK wrt references',textDim, 'addMarkers',false,'forcedMarkers',5,'changeColors',false) exportStandardizedFigure(gcf, 'ABK wrt references',textDim, 'addMarkers',false,'forcedMarkers',5,'changeColors',false,'exportPDF',false)
% % % commento: la shadowmode probabilmente si è mangiata il fatto che il primo % % % commento: la shadowmode probabilmente si è mangiata il fatto che il primo
...@@ -599,6 +600,24 @@ exportStandardizedFigure(gcf, 'ABK wrt references',textDim, 'addMarkers',false,' ...@@ -599,6 +600,24 @@ exportStandardizedFigure(gcf, 'ABK wrt references',textDim, 'addMarkers',false,'
% % % del controllore inaspettato. Sicuramente però, se è tarato è la migliore % % % del controllore inaspettato. Sicuramente però, se è tarato è la migliore
% % % stima della velocità xbody che abbiamo % % % stima della velocità xbody che abbiamo
%% NAS consistency check
v_int_PITOT = 0;
v_int_NOpitot = 0;
for i = 2:length(sensorTot_WithPitot.nas.states(:,3))
v_int_PITOT(i) = v_int_PITOT(i-1) + sum(sensorTot_WithPitot.nas.states([i-1,i],6))*nas.dt_k/2;
v_int_NOpitot(i) = v_int_NOpitot(i-1) + sum(sensorTot_NoPitot.nas.states([i-1,i],6))*nas.dt_k/2;
end
figure
sgtitle('NAS consistency check')
plot(sensorTot_WithPitot.nas.time,v_int_PITOT,'DisplayName','Int vel PITOT')
hold on;
plot(sensorTot_WithPitot.nas.time,sensorTot_WithPitot.nas.states(:,3),'DisplayName','Altitude PITOT')
plot(sensorTot_NoPitot.nas.time,v_int_NOpitot,'DisplayName','Int vel NO PITOT')
plot(sensorTot_NoPitot.nas.time,sensorTot_NoPitot.nas.states(:,3),'DisplayName','Altitude NOPITOT')
legend
%% rocket animation %% rocket animation
for i = 1:length(main.NASData(:,1)) for i = 1:length(main.NASData(:,1))
......
currentPath = pwd; currentPath = pwd;
localRepoPath_generalUtilities = '../../../general-utilities/'; localRepoPath_generalUtilities = '../../../general-utilities';
if ~exist([localRepoPath_generalUtilities,'exportStandardizedFigure'],'file') if ~exist([localRepoPath_generalUtilities,'/exportStandardizedFigure'],'file')
% clone repo % clone repo
answer = input('WARNING! You don''have the exportStandardizedFigure installed. Do you want to install it? (recommended) (y/n)','s'); answer = input('WARNING! You don''have the exportStandardizedFigure installed. Do you want to install it? (recommended) (y/n)','s');
if answer == "y" || answer == "yes" if answer == "y" || answer == "yes"
......
0% Loading or .
You are about to add 0 people to the discussion. Proceed with caution.
Please register or to comment