Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
M
MicroCART
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Deploy
Releases
Model registry
Monitor
Incidents
Analyze
Value stream analytics
Contributor analytics
Repository analytics
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
Distributed Autonomous Networked Control Lab
MicroCART
Commits
a44bd63f
Commit
a44bd63f
authored
8 years ago
by
Andy Snawerdt
Browse files
Options
Downloads
Patches
Plain Diff
Updated model and model parameters file to support active log analysis tools
parent
87eccdf5
No related branches found
Branches containing commit
No related tags found
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
controls/model/modelParameters.m
+66
-5
66 additions, 5 deletions
controls/model/modelParameters.m
controls/model/test_model.slx
+0
-0
0 additions, 0 deletions
controls/model/test_model.slx
with
66 additions
and
5 deletions
controls/model/modelParameters.m
+
66
−
5
View file @
a44bd63f
% Model Parameters
% Log Analysis Toggle
logAnalysisToggle
=
1
;
% 1 for log analysis, 0 for normal operation
% Model Parameters
m
=
1.244
;
% Quadrotor + battery mass
g
=
9.81
;
% Acceleration of gravity
% Jxx = 0.0277; % Quadrotor and battery motor of inertia around bx (pitch)
% Jyy = 0.0218; % Quadrotor and battery motor of inertia around by (roll)
% Jzz = 0.0332; % Quadrotor and battery motor of inertia around bz (yaw)
Jxx
=
0.0130
;
% Quadrotor and battery motor of inertia around bx (pitch)
Jyy
=
0.0140
;
% Quadrotor and battery motor of inertia around by (roll)
Jzz
=
0.0285
;
% Quadrotor and battery motor of inertia around bz (yaw)
...
...
@@ -33,4 +33,65 @@
height_controlled_o
=
(((
Rm
*
If
+
...
+
(((
omega_o
*
2
*
Rm
*
Kv
*
Kq
...
*
Kd
+
1
)
^
2
)
-
1
)/(
4
*
Rm
*
Kv
^
2
*
Kq
...
*
Kd
))/
Vb
)
*
(
Pmax
-
Pmin
)
+
Pmin
);
\ No newline at end of file
*
Kd
))/
Vb
)
*
(
Pmax
-
Pmin
)
+
Pmin
);
% Import Data and determine errors
if
logAnalysisToggle
==
1
% Import Data to Workspace
data
=
importdata
(
'loggingAnalysis/logFiles/logData.csv'
);
% Set up time vector
time
=
data
.
data
(:,
1
);
% Determine x position error
x_setpoint
=
data
.
data
(:,
25
);
x_position
=
data
.
data
(:,
20
);
x_error
=
timeseries
(
x_setpoint
-
x_position
,
time
);
% Determine y position error
y_setpoint
=
data
.
data
(:,
26
);
y_position
=
data
.
data
(:,
21
);
y_error
=
timeseries
(
y_setpoint
-
y_position
,
time
);
% Determine z position error
z_setpoint
=
data
.
data
(:,
27
);
z_position
=
data
.
data
(:,
22
);
z_error
=
timeseries
(
z_setpoint
-
z_position
,
time
);
% Determine pitch error
pitch_setpoint
=
data
.
data
(:,
9
);
pitch_value
=
data
.
data
(:,
23
);
pitch_error
=
timeseries
(
pitch_setpoint
-
pitch_value
,
time
);
% Determine roll error
roll_setpoint
=
data
.
data
(:,
10
);
roll_value
=
data
.
data
(:,
24
);
roll_error
=
timeseries
(
roll_setpoint
-
roll_value
,
time
);
% Determine yaw error
yaw_setpoint
=
zeros
(
length
(
time
),
1
);
% NEEDS UPDATED WHEN LOG FILE INCLUDES YAW SETPOINT
yaw_value
=
ones
(
length
(
time
),
1
);
% NEEDS UPDATED WHEN LOG FILE INCLUDES YAW VALUE
yaw_error
=
timeseries
(
yaw_setpoint
-
yaw_value
,
time
);
% Determine pitch rate error
pitchrate_setpoint
=
data
.
data
(:,
11
);
pitchrate_value
=
data
.
data
(:,
6
);
pitchrate_error
=
timeseries
(
pitchrate_setpoint
-
pitchrate_value
,
time
);
% Determine roll rate error
rollrate_setpoint
=
data
.
data
(:,
12
);
rollrate_value
=
data
.
data
(:,
5
);
rollrate_error
=
timeseries
(
rollrate_setpoint
-
rollrate_value
,
time
);
% Determine yaw rate error
yawrate_setpoint
=
data
.
data
(:,
13
);
yawrate_value
=
data
.
data
(:,
7
);
yawrate_error
=
timeseries
(
yawrate_setpoint
-
yawrate_value
,
time
);
% Pull motor commands from log
x_command
=
data
.
data
(:,
14
);
y_command
=
data
.
data
(:,
15
);
z_command
=
data
.
data
(:,
8
);
yaw_command
=
data
.
data
(:,
16
);
end
This diff is collapsed.
Click to expand it.
controls/model/test_model.slx
+
0
−
0
View file @
a44bd63f
No preview for this file type
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