Firmware
Functions
battery_params.c File Reference

Parameters defined by the battery lib. More...

#include <px4_config.h>
#include <parameters/param.h>

Functions

 PARAM_DEFINE_FLOAT (BAT_V_EMPTY, 3.5f)
 Empty cell voltage (5C load) More...
 
 PARAM_DEFINE_FLOAT (BAT_V_CHARGED, 4.05f)
 Full cell voltage (5C load) More...
 
 PARAM_DEFINE_FLOAT (BAT_LOW_THR, 0.15f)
 Low threshold. More...
 
 PARAM_DEFINE_FLOAT (BAT_CRIT_THR, 0.07f)
 Critical threshold. More...
 
 PARAM_DEFINE_FLOAT (BAT_EMERGEN_THR, 0.05f)
 Emergency threshold. More...
 
 PARAM_DEFINE_FLOAT (BAT_V_LOAD_DROP, 0.3f)
 Voltage drop per cell on full throttle. More...
 
 PARAM_DEFINE_FLOAT (BAT_R_INTERNAL, -1.0f)
 Explicitly defines the per cell internal resistance. More...
 
 PARAM_DEFINE_INT32 (BAT_N_CELLS, 0)
 Number of cells. More...
 
 PARAM_DEFINE_FLOAT (BAT_CAPACITY, -1.0f)
 Battery capacity. More...
 

Detailed Description

Parameters defined by the battery lib.

Author
Julian Oes julia.nosp@m.n@oe.nosp@m.s.ch

Function Documentation

§ PARAM_DEFINE_FLOAT() [1/8]

PARAM_DEFINE_FLOAT ( BAT_V_EMPTY  ,
3.  5f 
)

Empty cell voltage (5C load)

Defines the voltage where a single cell of the battery is considered empty. The voltage should be chosen before the steep dropoff to 2.8V. A typical lithium battery can only be discharged down to 10% before it drops off to a voltage level damaging the cells.

Battery Calibration V 2 0.01 true

§ PARAM_DEFINE_FLOAT() [2/8]

PARAM_DEFINE_FLOAT ( BAT_V_CHARGED  ,
4.  05f 
)

Full cell voltage (5C load)

Defines the voltage where a single cell of the battery is considered full under a mild load. This will never be the nominal voltage of 4.2V

Battery Calibration V 2 0.01 true

§ PARAM_DEFINE_FLOAT() [3/8]

PARAM_DEFINE_FLOAT ( BAT_LOW_THR  ,
0.  15f 
)

Low threshold.

Sets the threshold when the battery will be reported as low. This has to be higher than the critical threshold.

Battery Calibration norm 0.12 0.4 2 0.01 true

§ PARAM_DEFINE_FLOAT() [4/8]

PARAM_DEFINE_FLOAT ( BAT_CRIT_THR  ,
0.  07f 
)

Critical threshold.

Sets the threshold when the battery will be reported as critically low. This has to be lower than the low threshold. This threshold commonly will trigger RTL.

Battery Calibration norm 0.05 0.1 2 0.01 true

§ PARAM_DEFINE_FLOAT() [5/8]

PARAM_DEFINE_FLOAT ( BAT_EMERGEN_THR  ,
0.  05f 
)

Emergency threshold.

Sets the threshold when the battery will be reported as dangerously low. This has to be lower than the critical threshold. This threshold commonly will trigger landing.

Battery Calibration norm 0.03 0.07 2 0.01 true

§ PARAM_DEFINE_FLOAT() [6/8]

PARAM_DEFINE_FLOAT ( BAT_V_LOAD_DROP  ,
0.  3f 
)

Voltage drop per cell on full throttle.

This implicitely defines the internal resistance to maximum current ratio and assumes linearity. A good value to use is the difference between the 5C and 20-25C load. Not used if BAT_R_INTERNAL is set.

Battery Calibration V 0.07 0.5 2 0.01 true

§ PARAM_DEFINE_FLOAT() [7/8]

PARAM_DEFINE_FLOAT ( BAT_R_INTERNAL  ,
-1.  0f 
)

Explicitly defines the per cell internal resistance.

If non-negative, then this will be used in place of BAT_V_LOAD_DROP for all calculations.

Battery Calibration Ohms -1.0 0.2 true

§ PARAM_DEFINE_FLOAT() [8/8]

PARAM_DEFINE_FLOAT ( BAT_CAPACITY  ,
-1.  0f 
)

Battery capacity.

Defines the capacity of the attached battery.

Battery Calibration mAh 0 -1.0 100000 50 true

§ PARAM_DEFINE_INT32()

PARAM_DEFINE_INT32 ( BAT_N_CELLS  ,
 
)

Number of cells.

Defines the number of cells the attached battery consists of.

Battery Calibration S 0 Unconfigured 2 2S Battery 3 3S Battery 4 4S Battery 5 5S Battery 6 6S Battery 7 7S Battery 8 8S Battery 9 9S Battery 10 10S Battery 11 11S Battery 12 12S Battery 13 13S Battery 14 14S Battery 15 15S Battery 16 16S Battery true