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
16b426b9
Verified
Commit
16b426b9
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
feat(sync): include semiflapping cases
parent
dde75955
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
1
Hide whitespace changes
Inline
Side-by-side
Showing
1 changed file
utils/syncdata.m
+14
-6
14 additions, 6 deletions
utils/syncdata.m
with
14 additions
and
6 deletions
utils/syncdata.m
+
14
−
6
View file @
16b426b9
...
...
@@ -35,8 +35,8 @@ function [arduSynced, tunnelSynced, arduStartTime, tunnelStartTime] = ...
END_TRIM_SECONDS
=
2
;
% Number of seconds to trim at the end, [s]
% Detect start of wing motion in Arduino and wind tunnel datasets
[
arduStartIdx
,
arduStartTime
]
=
getstartardu
(
arduShort
);
[
tunnelStartIdx
,
tunnelStartTime
]
=
getstarttunnel
(
tunnelData
);
[
arduStartIdx
,
arduStartTime
,
steadyIdx
]
=
getstartardu
(
arduShort
);
[
tunnelStartIdx
,
tunnelStartTime
]
=
getstarttunnel
(
tunnelData
,
steadyIdx
);
% Trim everything before wing starts in both datasets
arduShort
=
arduShort
(
arduStartIdx
:
end
,
:);
...
...
@@ -70,24 +70,30 @@ function [arduSynced, tunnelSynced, arduStartTime, tunnelStartTime] = ...
end
function
[
startIdx
,
startTime
]
=
getstartardu
(
arduData
)
function
[
startIdx
,
startTime
,
steadyIdx
]
=
getstartardu
(
arduData
)
% GETSTARTARDU Get the starting po int for the arduino dataset and the flapping direction at
% start
ANGLE_IDX
=
[
2
,
3
];
% Indexes of the front and aft angles in arduData file
N_STABLE_VAL
=
20
;
% Number of stable values before beginnig of motion
DCRIT
=
0.1
;
% Deviation from the mean to be considered a "large" deviation
STD_NO_MOTION
=
3
;
% A standard deviation less than 1deg means no motion
% Get a first approximation for the starting point of each wing set
startIdx
=
[
NaN
,
NaN
];
steadyIdx
=
[
NaN
,
NaN
];
for
i
=
1
:
2
startIdx
(
i
)
=
findsignalstart
(
arduData
(:,
ANGLE_IDX
(
i
)),
N_STABLE_VAL
,
'ardu'
,
DCRIT
);
if
std
(
arduData
(:,
ANGLE_IDX
(
i
)))
>
STD_NO_MOTION
startIdx
(
i
)
=
findsignalstart
(
arduData
(:,
ANGLE_IDX
(
i
)),
N_STABLE_VAL
,
'ardu'
,
DCRIT
);
else
steadyIdx
(
i
)
=
i
;
end
end
startIdx
=
min
(
startIdx
);
startTime
=
arduData
(
startIdx
,
1
);
end
function
[
startIdx
,
startTime
]
=
getstarttunnel
(
tunnelData
)
function
[
startIdx
,
startTime
]
=
getstarttunnel
(
tunnelData
,
steadyIdx
)
% GETSTARTTUNNEL Get the starting point for the wind tunnel dataset
% Only use the Fz to determine starting point
...
...
@@ -101,7 +107,9 @@ function [startIdx, startTime] = getstarttunnel(tunnelData)
startIdx
=
[
NaN
,
NaN
];
for
i
=
1
:
2
startIdx
(
i
)
=
findsignalstart
(
tunnelData
(:,
FZ_IDX
(
i
)),
SAMPLING
/
2
,
'tunnel'
,
DCRIT
);
if
steadyIdx
(
i
)
~=
i
startIdx
(
i
)
=
findsignalstart
(
tunnelData
(:,
FZ_IDX
(
i
)),
SAMPLING
/
2
,
'tunnel'
,
DCRIT
);
end
end
startIdx
=
TRIM_MS
+
min
(
startIdx
);
startTime
=
startIdx
/
SAMPLING
;
...
...
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