Skip to content
GitLab
Explore
Sign in
Primary navigation
Search or go to…
Project
F
Firmware
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
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
Alberto Ruiz Garcia
Firmware
Commits
6de02c46
Commit
6de02c46
authored
8 years ago
by
Lorenz Meier
Browse files
Options
Downloads
Patches
Plain Diff
Battery estimation: Widen thresholds and filter more
parent
4c61f522
No related branches found
Branches containing commit
No related tags found
Tags containing commit
No related merge requests found
Changes
2
Hide whitespace changes
Inline
Side-by-side
Showing
2 changed files
src/modules/systemlib/battery.cpp
+2
-2
2 additions, 2 deletions
src/modules/systemlib/battery.cpp
src/modules/systemlib/battery_params.c
+3
-3
3 additions, 3 deletions
src/modules/systemlib/battery_params.c
with
5 additions
and
5 deletions
src/modules/systemlib/battery.cpp
+
2
−
2
View file @
6de02c46
...
...
@@ -102,7 +102,7 @@ Battery::updateBatteryStatus(hrt_abstime timestamp, float voltage_v, float curre
void
Battery
::
filterVoltage
(
float
voltage_v
)
{
if
(
_voltage_filtered_v
<
0
)
{
if
(
_voltage_filtered_v
<
0
.0
f
)
{
_voltage_filtered_v
=
voltage_v
;
}
...
...
@@ -146,7 +146,7 @@ Battery::estimateRemaining(float voltage_v, float throttle_normalized)
// remaining battery capacity based on voltage
const
float
rvoltage
=
(
voltage_v
-
(
_param_n_cells
.
get
()
*
bat_v_empty_dynamic
))
/
(
_param_n_cells
.
get
()
*
voltage_range
);
const
float
rvoltage_filt
=
rvoltage
*
0.99
f
+
_remaining_voltage
*
0.0
1
f
;
const
float
rvoltage_filt
=
rvoltage
*
0.99
7
f
+
_remaining_voltage
*
0.0
03
f
;
if
(
PX4_ISFINITE
(
rvoltage_filt
))
{
_remaining_voltage
=
rvoltage_filt
;
...
...
This diff is collapsed.
Click to expand it.
src/modules/systemlib/battery_params.c
+
3
−
3
View file @
6de02c46
...
...
@@ -55,7 +55,7 @@
* @decimal 2
* @increment 0.01
*/
PARAM_DEFINE_FLOAT
(
BAT_V_EMPTY
,
3
.
5
f
);
PARAM_DEFINE_FLOAT
(
BAT_V_EMPTY
,
3
.
4
f
);
/**
* Full cell voltage (5C load)
...
...
@@ -68,7 +68,7 @@ PARAM_DEFINE_FLOAT(BAT_V_EMPTY, 3.5f);
* @decimal 2
* @increment 0.01
*/
PARAM_DEFINE_FLOAT
(
BAT_V_CHARGED
,
4
.
1
f
);
PARAM_DEFINE_FLOAT
(
BAT_V_CHARGED
,
4
.
05
f
);
/**
* Low threshold
...
...
@@ -116,7 +116,7 @@ PARAM_DEFINE_FLOAT(BAT_CRIT_THR, 0.07f);
* @decimal 2
* @increment 0.01
*/
PARAM_DEFINE_FLOAT
(
BAT_V_LOAD_DROP
,
0
.
25
f
);
PARAM_DEFINE_FLOAT
(
BAT_V_LOAD_DROP
,
0
.
3
f
);
/**
* Number of cells.
...
...
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