Skip to content
GitLab
Explore
Sign in
Register
Primary navigation
Search or go to…
Project
M
MessdatenSilo
Manage
Activity
Members
Labels
Plan
Issues
Issue boards
Milestones
Wiki
Code
Merge requests
Repository
Branches
Commits
Tags
Repository graph
Compare revisions
Snippets
Build
Pipelines
Jobs
Pipeline schedules
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
Model experiments
Help
Help
Support
GitLab documentation
Compare GitLab plans
GitLab community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Kloock
MessdatenSilo
Commits
f771bea8
Commit
f771bea8
authored
3 years ago
by
Lennard
Browse files
Options
Downloads
Patches
Plain Diff
Small updates
parent
431e9356
No related branches found
No related tags found
No related merge requests found
Changes
4
Show whitespace changes
Inline
Side-by-side
Showing
4 changed files
config.yml
+3
-3
3 additions, 3 deletions
config.yml
main.py
+2
-2
2 additions, 2 deletions
main.py
scripts/write.bash
+8
-3
8 additions, 3 deletions
scripts/write.bash
sketches/DmsMessung/DmsMessung.ino
+18
-8
18 additions, 8 deletions
sketches/DmsMessung/DmsMessung.ino
with
31 additions
and
16 deletions
config.yml
+
3
−
3
View file @
f771bea8
...
@@ -7,13 +7,13 @@ DataLogger:
...
@@ -7,13 +7,13 @@ DataLogger:
InfoLogger
:
InfoLogger
:
backupCount
:
10
# number of logs to keep
backupCount
:
10
# number of logs to keep
maxBytes
:
1000000
# size of single log
maxBytes
:
1000000
# size of single log
in bytes
filename
:
log
# filename for logs
filename
:
log
# filename for logs
levels
:
# log level for outputting to file and to stdout respectivly
levels
:
# log level for outputting to file and to stdout respectivly
-
INFO
-
INFO
-
WARNING
-
WARNING
Data
:
Data
:
factors
:
[
1
,
1
,
1
,
0.9
]
# factors for the 4 dms
factors
:
[
1
,
1
,
1
,
1
]
# factors for the 4 dms
delta_time
:
30
# time between logging data
delta_time
:
30
# time between logging data
smoothing
:
false
# wether to smoothe the logged data
smoothing
:
false
# w
h
ether to smoothe the logged data
This diff is collapsed.
Click to expand it.
main.py
+
2
−
2
View file @
f771bea8
...
@@ -77,8 +77,8 @@ def get_offset() -> np.ndarray:
...
@@ -77,8 +77,8 @@ def get_offset() -> np.ndarray:
f
"
Time difference between last logged value and current time is very large:
{
difference
.
total_seconds
()
:
.
0
f
}
s.
"
f
"
Time difference between last logged value and current time is very large:
{
difference
.
total_seconds
()
:
.
0
f
}
s.
"
)
)
return
np
.
array
([
float
(
num
)
for
num
in
lines
[
-
1
].
split
(
"
,
"
)[
1
:
5
]])
return
np
.
array
([
float
(
num
)
for
num
in
lines
[
-
1
].
split
(
"
,
"
)[
1
:
5
]])
# didnt find any old files, so no offset
# didn
'
t find any old files, so no offset
logger
.
warning
(
f
"
Didnt find any old offsets, so starting at 0.
"
)
logger
.
warning
(
f
"
Didn
'
t find any old offsets, so starting at 0.
"
)
return
np
.
array
([
0
,
0
,
0
,
0
])
return
np
.
array
([
0
,
0
,
0
,
0
])
...
...
This diff is collapsed.
Click to expand it.
scripts/write.bash
+
8
−
3
View file @
f771bea8
...
@@ -7,13 +7,18 @@ core=arduino:avr
...
@@ -7,13 +7,18 @@ core=arduino:avr
id
=
$(
python3 ../scripts/serial_id.py
)
id
=
$(
python3 ../scripts/serial_id.py
)
if
[[
$id
!
=
"
0
"
]]
if
[[
$id
=
=
"
1
"
]]
then
then
serial_dms
=
/dev/ttyACM0
serial_dms
=
/dev/ttyACM0
serial_temp
=
/dev/ttyACM1
serial_temp
=
/dev/ttyACM1
else
elif
[[
$id
==
"0"
]]
then
serial_temp
=
/dev/ttyACM0
serial_temp
=
/dev/ttyACM0
serial_dms
=
/dev/ttyACM1
serial_dms
=
/dev/ttyACM1
else
echo
-e
"
\x
1b[31mError: Something went wrong.
\x
1b[0m"
echo
-e
"Exiting"
exit
1
fi
fi
echo
-e
"Info: DMS arduino:
$serial_dms
, Temp arduino:
$serial_temp
"
echo
-e
"Info: DMS arduino:
$serial_dms
, Temp arduino:
$serial_temp
"
...
@@ -25,7 +30,7 @@ connected_devices=$(echo -e $device_list | grep "^\(\($serial_dms\)\|\($serial_t
...
@@ -25,7 +30,7 @@ connected_devices=$(echo -e $device_list | grep "^\(\($serial_dms\)\|\($serial_t
if
[[
$connected_devices
!=
"2"
]]
if
[[
$connected_devices
!=
"2"
]]
then
then
echo
-e
"
\x
1b[31mError: not all arduino devices are connected
\x
1b[0m"
echo
-e
"
\x
1b[31mError: not all arduino devices are connected
,
\x
1b[0m"
echo
-e
"Connected devices are:
\n
$device_list
"
echo
-e
"Connected devices are:
\n
$device_list
"
echo
-e
"Exiting."
echo
-e
"Exiting."
exit
1
exit
1
...
...
This diff is collapsed.
Click to expand it.
sketches/DmsMessung/DmsMessung.ino
+
18
−
8
View file @
f771bea8
#include
<HX711_ADC.h>
#include
<HX711_ADC.h>
#include
"cstring"
HX711_ADC
loadCells
[]
=
{
HX711_ADC
(
2
,
3
),
HX711_ADC
(
6
,
7
),
HX711_ADC
(
8
,
9
),
HX711_ADC
(
12
,
13
)};
HX711_ADC
loadCells
[]
=
{
HX711_ADC
(
2
,
3
),
HX711_ADC
(
6
,
7
),
HX711_ADC
(
8
,
9
),
HX711_ADC
(
12
,
13
)};
float
measurements
[
4
];
float
measurements
[
4
];
float
offsets
[
4
];
float
offsets
[
4
];
int
count
=
100
0
;
int
count
=
100
;
long
stabilization
=
2000
;
long
stabilization
=
2000
;
void
readData
()
{
void
readData
()
{
// write the averaged data over 'count' measurements into 'measurements'.
std
::
memset
(
measurements
,
0
,
sizeof
measurements
);
// zero out measurements
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
for
(
int
j
=
0
;
j
<
sizeof
(
loadCells
)
/
sizeof
(
*
loadCells
);
j
++
)
{
loadCells
[
j
].
update
();
measurements
[
j
]
+=
loadCells
[
j
].
getRareData
()
-
offsets
[
j
];
}
}
for
(
int
i
=
0
;
i
<
sizeof
(
loadCells
)
/
sizeof
(
*
loadCells
);
i
++
)
{
for
(
int
i
=
0
;
i
<
sizeof
(
loadCells
)
/
sizeof
(
*
loadCells
);
i
++
)
{
loadCells
[
i
].
update
();
measurements
[
i
]
/=
count
;
measurements
[
i
]
=
loadCells
[
i
].
getRareData
()
-
offsets
[
i
];
}
}
}
}
...
@@ -21,12 +32,11 @@ void setup() {
...
@@ -21,12 +32,11 @@ void setup() {
loadCells
[
i
].
begin
();
loadCells
[
i
].
begin
();
loadCells
[
i
].
start
(
stabilization
,
true
);
loadCells
[
i
].
start
(
stabilization
,
true
);
}
loadCells
[
i
].
update
();
// zero out load cells
// zero out load cells
offsets
[
i
]
=
loadCells
[
i
].
getRa
reData
();
re
ad
Data
();
}
std
::
memcpy
(
offsets
,
measurements
,
sizeof
offsets
);
}
}
void
loop
()
{
void
loop
()
{
...
...
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