PX4 Firmware
PX4 Autopilot Software http://px4.io
sensor_params_battery.c File Reference

Go to the source code of this file.

Functions

 PARAM_DEFINE_FLOAT (BAT_CNT_V_VOLT, -1.0f)
 Scaling from ADC counts to volt on the ADC input (battery voltage) More...
 
 PARAM_DEFINE_FLOAT (BAT_CNT_V_CURR, -1.0)
 Scaling from ADC counts to volt on the ADC input (battery current) More...
 
 PARAM_DEFINE_FLOAT (BAT_V_OFFS_CURR, 0.0)
 Offset in volt as seen by the ADC input of the current sensor. More...
 
 PARAM_DEFINE_INT32 (BAT_SOURCE, 0)
 Battery monitoring source. More...
 
 PARAM_DEFINE_INT32 (BAT_ADC_CHANNEL, -1)
 Battery ADC Channel. More...
 

Function Documentation

◆ PARAM_DEFINE_FLOAT() [1/3]

PARAM_DEFINE_FLOAT ( BAT_CNT_V_VOLT  ,
-1.  0f 
)

Scaling from ADC counts to volt on the ADC input (battery voltage)

This is not the battery voltage, but the intermediate ADC voltage. A value of -1 signifies that the board defaults are used, which is highly recommended.

Battery Calibration 8

◆ PARAM_DEFINE_FLOAT() [2/3]

PARAM_DEFINE_FLOAT ( BAT_CNT_V_CURR  ,
-1.  0 
)

Scaling from ADC counts to volt on the ADC input (battery current)

This is not the battery current, but the intermediate ADC voltage. A value of -1 signifies that the board defaults are used, which is highly recommended.

Battery Calibration 8

◆ PARAM_DEFINE_FLOAT() [3/3]

PARAM_DEFINE_FLOAT ( BAT_V_OFFS_CURR  ,
0.  0 
)

Offset in volt as seen by the ADC input of the current sensor.

This offset will be subtracted before calculating the battery current based on the voltage.

Battery Calibration 8

◆ PARAM_DEFINE_INT32() [1/2]

PARAM_DEFINE_INT32 ( BAT_SOURCE  ,
 
)

Battery monitoring source.

This parameter controls the source of battery data. The value 'Power Module' means that measurements are expected to come from a power module. If the value is set to 'External' then the system expects to receive mavlink battery status messages.

0 1 0 Power Module 1 External Battery Calibration

◆ PARAM_DEFINE_INT32() [2/2]

PARAM_DEFINE_INT32 ( BAT_ADC_CHANNEL  ,
1 
)

Battery ADC Channel.

This parameter specifies the ADC channel used to monitor voltage of main power battery. A value of -1 means to use the board default.

Battery Calibration