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
Community forum
Contribute to GitLab
Provide feedback
Terms and privacy
Keyboard shortcuts
?
Snippets
Groups
Projects
Show more breadcrumbs
Lennard Kloock
MessdatenSilo
Compare revisions
c58bea19e09a987bac4a6b17ce146f5871205215 to c66a530e32be068f07d62fc8fdb733f9e8ae5132
Compare revisions
Changes are shown as if the
source
revision was being merged into the
target
revision.
Learn more about comparing revisions.
Source
Lennard/messdatensilo
Select target project
No results found
c66a530e32be068f07d62fc8fdb733f9e8ae5132
Select Git revision
Branches
main
Tags
latest
2 results
Swap
Target
Lennard/messdatensilo
Select target project
Lennard/messdatensilo
1 result
c58bea19e09a987bac4a6b17ce146f5871205215
Select Git revision
Show changes
Only incoming changes from source
Include changes to target since source was created
Compare
Commits on Source (2)
Update DmsMessung.ino
· 2645ae35
Lennard
authored
2 years ago
2645ae35
Update backupCount for the DataLogger and fix offset calculation
· c66a530e
Lennard
authored
2 years ago
c66a530e
Show whitespace changes
Inline
Side-by-side
Showing
3 changed files
config.yml
+1
-1
1 addition, 1 deletion
config.yml
main.py
+1
-1
1 addition, 1 deletion
main.py
sketches/DmsMessung/DmsMessung.ino
+39
-106
39 additions, 106 deletions
sketches/DmsMessung/DmsMessung.ino
with
41 additions
and
108 deletions
config.yml
View file @
c66a530e
DataLogger
:
backupCount
:
7
0
# number of datalogs to keep
backupCount
:
35
0
# number of datalogs to keep
levels
:
# log level for outputting to file and to stdout respectivly
-
INFO
-
WARNING
...
...
This diff is collapsed.
Click to expand it.
main.py
View file @
c66a530e
...
...
@@ -181,7 +181,7 @@ def main(config: Any) -> None:
if
time
.
time
()
-
last_write
>
delta_time
:
# write data
data_logger
.
info
(
"
,
"
.
join
([
f
"
{
(
value
/
n
)
*
factors
[
i
]
-
offsets
[
i
]
:
.
5
f
}
"
for
i
,
value
in
enumerate
(
data
)])
+
f
"
,
{
n
}
"
)
data_logger
.
info
(
"
,
"
.
join
([
f
"
{
(
value
/
n
)
*
factors
[
i
]
+
offsets
[
i
]
:
.
5
f
}
"
for
i
,
value
in
enumerate
(
data
)])
+
f
"
,
{
n
}
"
)
logger
.
debug
(
"
Wrote data
"
)
n
=
0
data
=
np
.
zeros
((
8
,))
...
...
This diff is collapsed.
Click to expand it.
sketches/DmsMessung/DmsMessung.ino
View file @
c66a530e
#include
<HX711_ADC.h>
HX711_ADC
LoadCell
(
2
,
3
);
HX711_ADC
LoadCell2
(
6
,
7
);
HX711_ADC
LoadCell3
(
8
,
9
);
HX711_ADC
LoadCell4
(
12
,
13
);
static
float
Offset
=
0
;
static
float
Offset2
=
0
;
static
float
Offset3
=
0
;
static
float
Offset4
=
0
;
int
anzahl
=
1000
;
int
caltime
=
2
;
float
calFac
=
2500
;
float
calFac2
=
2500
;
float
calFac3
=
2500
;
float
calFac4
=
2500
;
HX711_ADC
loadCell
[]
=
{
HX711_ADC
(
2
,
3
),
HX711_ADC
(
6
,
7
),
HX711_ADC
(
8
,
9
),
HX711_ADC
(
12
,
13
)};
float
measurement
[
4
];
float
offset
[
4
];
int
count
=
1000
;
long
stabilisation
=
2000
;
boolean
t_are
=
true
;
float
messwertges
;
float
messwertges2
;
float
messwertges3
;
float
messwertges4
;
float
messwert
;
float
messwert2
;
float
messwert3
;
float
messwert4
;
void
regelbetrieb
(
HX711_ADC
zelle
,
HX711_ADC
zelle2
,
HX711_ADC
zelle3
,
HX711_ADC
zelle4
)
{
float
messwertAlt
=
messwert
;
float
messwertAlt2
=
messwert2
;
float
messwertAlt3
=
messwert3
;
float
messwertAlt4
=
messwert4
;
messwert
=
0
;
messwert2
=
0
;
messwert3
=
0
;
messwert4
=
0
;
for
(
int
i
=
1
;
i
<=
anzahl
;
i
++
)
{
zelle
.
update
();
zelle2
.
update
();
zelle3
.
update
();
zelle4
.
update
();
messwert
=
messwert
+
(
getDaten
(
Offset
,
zelle
));
messwert2
=
messwert2
+
(
getDaten
(
Offset2
,
zelle2
));
messwert3
=
messwert3
+
(
getDaten
(
Offset3
,
zelle3
));
messwert4
=
messwert4
+
(
getDaten
(
Offset4
,
zelle4
));
delay
(
1
);
void
readData
()
{
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
measurements
[
i
]
=
0
;
}
messwert
=
messwert
/
anzahl
;
messwert2
=
messwert2
/
anzahl
;
messwert3
=
messwert3
/
anzahl
;
messwert4
=
messwert4
/
anzahl
;
messwert
=
messwert
/
calFac
;
messwert2
=
messwert2
/
calFac2
;
messwert3
=
messwert3
/
calFac3
;
messwert4
=
messwert4
/
calFac4
;
for
(
int
i
=
0
;
i
<
count
;
i
++
)
{
for
(
int
j
=
0
;
j
<
4
;
j
++
)
{
loadCells
[
j
].
update
();
}
float
getDaten
(
float
offset
,
HX711_ADC
zelle
)
{
float
Offsetnew
=
offset
;
float
data
;
for
(
int
j
=
0
;
j
<
4
;
j
++
)
{
measurement
[
j
]
+=
loadCell
[
j
].
getRareData
()
-
offset
[
j
];
}
data
=
(
float
)
zelle
.
getRareData
()
-
Offsetnew
;
delay
(
1
);
}
return
data
;
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
measurements
[
i
]
/=
count
*
2500
;
}
}
void
writeInData
()
{
void
loop
()
{
if
(
Serial
.
available
())
{
Serial
.
read
();
delay
(
20
);
Serial
.
println
(
1
);
regelbetrieb
(
LoadCell
,
LoadCell2
,
LoadCell3
,
LoadCell4
);
Serial
.
println
(
messwert
);
delay
(
20
);
Serial
.
println
(
1
);
// for identification
Serial
.
println
(
messwert2
);
delay
(
20
);
readData
();
Serial
.
println
(
messwert3
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
Serial
.
println
(
measurements
[
i
]);
delay
(
20
);
Serial
.
println
(
messwert4
);
}
}
float
epsilonumgebung
(
float
hierMesswert
,
float
hierMesswertAlt
)
{
if
(
hierMesswert
<
hierMesswertAlt
+
0.25
&&
hierMesswert
>
hierMesswertAlt
-
0.25
)
{
hierMesswert
=
hierMesswertAlt
;
}
return
hierMesswert
;
}
void
setup
()
{
Serial
.
begin
(
9600
);
LoadCell
.
begin
();
LoadCell2
.
begin
();
LoadCell3
.
begin
();
LoadCell4
.
begin
();
LoadCell
.
start
(
stabilisation
,
t_are
);
LoadCell2
.
start
(
stabilisation
,
t_are
);
LoadCell3
.
start
(
stabilisation
,
t_are
);
LoadCell4
.
start
(
stabilisation
,
t_are
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
loadCell
[
i
].
begin
();
}
LoadCell
.
update
();
LoadCell2
.
update
();
LoadCell3
.
update
();
LoadCell4
.
update
();
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
loadCell
[
i
].
start
(
stabilisation
,
true
);
}
Offset
=
getDaten
(
0
,
LoadCell
);
Offset2
=
getDaten
(
0
,
LoadCell2
);
Offset3
=
getDaten
(
0
,
LoadCell3
);
Offset4
=
getDaten
(
0
,
LoadCell4
);
readData
();
delay
(
500
);
for
(
int
i
=
0
;
i
<
4
;
i
++
)
{
offset
[
i
]
=
measurement
[
i
];
}
void
loop
()
{
writeInData
();
delay
(
500
);
}
\ No newline at end of file
This diff is collapsed.
Click to expand it.