Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
MechaRaptor - Arduino Controller
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 - Arduino Controller
Commits
64fd523d
Verified
Commit
64fd523d
authored
2 years ago
by
Thomas Lambert
Browse files
Options
Downloads
Patches
Plain Diff
feat(log): logging with serial-studio
parent
f0f5aa7a
No related branches found
No related tags found
No related merge requests found
Changes
3
Hide whitespace changes
Inline
Side-by-side
Showing
3 changed files
README.md
+8
-0
8 additions, 0 deletions
README.md
controller/controller.ino
+19
-5
19 additions, 5 deletions
controller/controller.ino
mechaRaptor.json
+96
-0
96 additions, 0 deletions
mechaRaptor.json
with
123 additions
and
5 deletions
README.md
+
8
−
0
View file @
64fd523d
...
...
@@ -13,6 +13,13 @@ This repository contains the Arduino code and mounting schematics.
-
To be determined
## Data logging and visualization
The controller sends the important data through serial. A
[
_json_ configuration
file
](
mechaRaptor.json
)
is provided in order to visualize the output stream in
real time with [serial-studio]. This also allows the logging and retention of
all data in _csv_ spreadsheets for future analysis.
## Material
The system consists in two independent sets of wings, powered separately. A
...
...
@@ -26,3 +33,4 @@ single Arduino board is used to control both motors.
## Schematics
[
plettenberg
]:
https://plettenbergmotors.com/
[
serial-studio
]:
https://serial-studio.github.io/
This diff is collapsed.
Click to expand it.
controller/controller.ino
+
19
−
5
View file @
64fd523d
...
...
@@ -42,13 +42,27 @@ void loop() {
int
potAnal
=
analogRead
(
A0
);
// read potentiometer value (between 0 and 1023)
int
potVal
=
map
(
potAnal
,
0
,
1023
,
0
,
180
);
// scale potentiometer value to use with servo lib
// [DEBUG] SERIAL OUTPUT
Serial
.
print
(
"Pot analogue: "
);
Serial
.
print
(
potAnal
);
Serial
.
print
(
", Mapped: "
);
Serial
.
println
(
potVal
);
// [TEST] Write sine values for visualization in serial-studio
float
freq
=
10
;
float
angleL
=
sin
(
millis
()
*
1000
*
freq
);
float
angleR
=
cos
(
millis
()
*
1000
*
freq
);;
// Send values to ESCs (currently both receive the same input)
ESC1
.
write
(
potVal
);
ESC2
.
write
(
potVal
);
// Print all useful data to serial for processing in serial-studio
Serial
.
print
(
"/*"
);
// Frame start sequence [/*]
Serial
.
print
(
millis
()
/
1000.0
);
// %1, MCU runtime [s]
Serial
.
print
(
","
);
Serial
.
print
(
potAnal
*
5.0
/
1023.0
);
// %2, Tension of potentiometer [V]
Serial
.
print
(
","
);
Serial
.
print
(
potVal
);
// %3, Mapped value of potentiometer [-]
Serial
.
print
(
","
);
Serial
.
print
(
angleL
);
// %4, Left wing angle [deg]
Serial
.
print
(
","
);
Serial
.
print
(
angleR
);
// %5, Right wing angle [deg]
Serial
.
println
(
"*/"
);
// Frame finish sequence [*/]
delay
(
50
);
// Reduce number of data to output
}
This diff is collapsed.
Click to expand it.
mechaRaptor.json
0 → 100644
+
96
−
0
View file @
64fd523d
{
"frameEnd"
:
""
,
"frameStart"
:
""
,
"groups"
:
[
{
"datasets"
:
[
{
"alarm"
:
0
,
"fft"
:
false
,
"fftSamples"
:
1024
,
"graph"
:
false
,
"led"
:
false
,
"log"
:
false
,
"max"
:
0
,
"min"
:
0
,
"title"
:
"Runtime"
,
"units"
:
"s"
,
"value"
:
"%1"
,
"widget"
:
""
}
],
"title"
:
"Runtime"
,
"widget"
:
""
},
{
"datasets"
:
[
{
"alarm"
:
0
,
"fft"
:
false
,
"fftSamples"
:
1024
,
"graph"
:
false
,
"led"
:
false
,
"log"
:
false
,
"max"
:
0
,
"min"
:
0
,
"title"
:
"Potentiometer tension"
,
"units"
:
"V"
,
"value"
:
"%2"
,
"widget"
:
""
},
{
"alarm"
:
180
,
"fft"
:
false
,
"fftSamples"
:
1024
,
"graph"
:
false
,
"led"
:
false
,
"log"
:
false
,
"max"
:
180
,
"min"
:
0
,
"title"
:
"Potentiometer mapped"
,
"units"
:
""
,
"value"
:
"%3"
,
"widget"
:
"gauge"
}
],
"title"
:
"Inputs"
,
"widget"
:
""
},
{
"datasets"
:
[
{
"alarm"
:
0
,
"fft"
:
false
,
"fftSamples"
:
1024
,
"graph"
:
false
,
"led"
:
false
,
"log"
:
false
,
"max"
:
0
,
"min"
:
0
,
"title"
:
"Left"
,
"units"
:
"deg"
,
"value"
:
"%4"
,
"widget"
:
""
},
{
"alarm"
:
0
,
"fft"
:
false
,
"fftSamples"
:
1024
,
"graph"
:
false
,
"led"
:
false
,
"log"
:
false
,
"max"
:
0
,
"min"
:
0
,
"title"
:
"Right"
,
"units"
:
"deg"
,
"value"
:
"%5"
,
"widget"
:
""
}
],
"title"
:
"Wing angles"
,
"widget"
:
"multiplot"
}
],
"separator"
:
","
,
"title"
:
"MechaRaptor"
}
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