Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MechaRaptor - Data Processing
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Iterations
Wiki
Requirements
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Locked files
Build
Pipelines
Jobs
Pipeline schedules
Test cases
Artifacts
Deploy
Releases
Package Registry
Container Registry
Model registry
Operate
Environments
Terraform modules
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
CI/CD analytics
Repository analytics
Code review analytics
Issue analytics
Insights
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
Community forum
Contribute to GitLab
Provide feedback
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Aerospace and Mechanical Engineering
tlambert
MechaRaptor - Data Processing
Commits
5b3405f7
Verified
Commit
5b3405f7
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
feat(tunnel): add calibration Fx-My
parent
c09683c6
No related branches found
No related tags found
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/loadtunnel.m
+48
-2
48 additions, 2 deletions
utils/loadtunnel.m
with
48 additions
and
2 deletions
utils/loadtunnel.m
+
48
−
2
View file @
5b3405f7
...
...
@@ -76,8 +76,8 @@ function calibrated = calibrate(raw)
% Proceed to calibration using the calibration data
if
isempty
(
kF
)
||
isempty
(
kA
)
kF
=
0
;
% [FIXME] Temporary placeholder
kA
=
0
;
% [FIXME] Temporary placeholder
kF
=
findcalibslope
(
'data/wtFiles/2022/calibration/calibFront_*'
,
'Fx'
,
'My'
);
kA
=
findcalibslope
(
'data/wtFiles/2022/calibration/calibAft_*'
,
'Fx'
,
'My'
);
end
% Calibrate Fx by removing parasitic force due to My
...
...
@@ -94,3 +94,49 @@ function filtered = filterwt(raw, cutoff, sampling)
% Apply filter
filtered
=
filtfilt
(
bb
,
aa
,
raw
(:,
:));
end
function
slope
=
findcalibslope
(
files
,
force
,
moment
)
% FINDCALIBSLOPE Find the linear coefficient for the calibration of parasitic effects
% Constants and defaults
FORCES
=
{
'Fx'
,
'Fy'
,
'Fz'
};
% Order of forces in datafile
MOMENTS
=
{
'Mx'
,
'My'
,
'Mz'
};
% Order of moments in datafile
% Get all relevant calibration files
allFiles
=
dir
(
files
);
iForce
=
find
(
strcmp
(
force
,
FORCES
));
iMom
=
find
(
strcmp
(
moment
,
MOMENTS
));
% Get mean forces and moment for each calibration point
meanF
=
zeros
(
1
,
length
(
allFiles
));
meanM
=
zeros
(
1
,
length
(
allFiles
));
for
iFile
=
1
:
length
(
allFiles
)
% Determine if we must look at front or aft data columns
if
contains
(
allFiles
(
iFile
)
.
name
,
'calibFront'
)
idx
=
1
;
elseif
contains
(
allFiles
(
iFile
)
.
name
,
'calibAft'
)
idx
=
2
;
else
error
(
'loadtunnel:findcalibslope:undefinedCalibType'
,
...
'Calibration filename must contain either
''
calibFront
''
or
''
calibAft
''
.'
);
end
% Load raw forces and moments
calibTable
=
loadcsv
(
fullfile
(
allFiles
(
iFile
)
.
folder
,
allFiles
(
iFile
)
.
name
));
rawCalib
=
table2array
(
calibTable
);
% Isolate proper data
rawF
=
rawCalib
(:,
6
*
(
idx
-
1
)
+
iForce
);
rawM
=
rawCalib
(:,
6
*
(
idx
-
1
)
+
(
3
+
iMom
));
meanF
(
iFile
)
=
mean
(
rawF
);
meanM
(
iFile
)
=
mean
(
rawM
);
end
% Slope is mean value of the individual slope between each calibration point
slope
=
mean
(
diff
(
meanF
)
.
/
diff
(
meanM
));
end
This diff is collapsed.
Click to expand it.
Preview
0%
Loading
Try again
or
attach a new file
.
Cancel
You are about to add
0
people
to the discussion. Proceed with caution.
Finish editing this message first!
Save comment
Cancel
Please
register
or
sign in
to comment