Skip to content

Commit

Permalink
Update battery characteristics for more accurate battery level estima…
Browse files Browse the repository at this point in the history
…tion
  • Loading branch information
kordets committed Feb 12, 2024
1 parent ab2f774 commit 2dc0471
Show file tree
Hide file tree
Showing 4 changed files with 61 additions and 19 deletions.
12 changes: 6 additions & 6 deletions ROMFS/px4fmu_common/init.d/airframes/4400_ssrc_fog_x
Original file line number Diff line number Diff line change
Expand Up @@ -65,23 +65,23 @@ param set-default UAVCAN_EC_FUNC4 104
param set-default MPC_XY_VEL_P_ACC 2.4

# Battery parameters
# Ref: tattu 6500mah 4s
param set-default BAT1_N_CELLS 4
param set-default BAT1_V_CHARGED 4.2
param set-default BAT1_V_EMPTY 3.6
param set-default BAT1_V_DIV 18.1
param set-default BAT1_R_INTERNAL -1.0
param set-default BAT1_V_LOAD_DROP 0.3000
param set-default BAT1_R_INTERNAL 0.0011
param set-default BAT1_V_EMPTY 3.5000
param set-default BAT1_SOURCE 0
param set-default BAT1_CAPACITY 6000


param set-default BAT2_N_CELLS 4
param set-default BAT2_V_CHARGED 4.2
param set-default BAT2_V_EMPTY 3.6
param set-default BAT2_V_DIV 18.1
param set-default BAT2_R_INTERNAL -1.0
param set-default BAT2_V_LOAD_DROP 0.3000
param set-default BAT2_R_INTERNAL 0.0011
param set-default BAT2_V_EMPTY 3.5000
param set-default BAT2_SOURCE 0
param set-default BAT2_CAPACITY 6000

# Enable LL40LS in i2c
param set-default SENS_EN_LL40LS 2
Expand Down
23 changes: 19 additions & 4 deletions ROMFS/px4fmu_common/init.d/airframes/4401_ssrc_fog_x_tmotor
Original file line number Diff line number Diff line change
Expand Up @@ -61,10 +61,25 @@ param set-default HIL_ACT_FUNC4 104
param set-default MPC_XY_VEL_P_ACC 2.4

# Battery parameters
param set-default BAT1_N_CELLS 4
param set-default BAT1_V_CHARGED 4.2
param set-default BAT1_V_EMPTY 3.6
# Ref: t-drone 22000mah 6s Lion
param set-default BAT1_N_CELLS 6
param set-default BAT1_V_CHARGED 4.1
param set-default BAT1_V_EMPTY 3.2
param set-default BAT1_V_DIV 18.1
param set-default BAT1_SOURCE 0
# Rough guess 50 mOhm
param set-default BAT1_R_INTERNAL 0.0050
param set-default BAT1_CAPACITY 22000

# Ref: t-drone 22000mah 6s Lion
param set-default BAT2_N_CELLS 6
param set-default BAT2_V_CHARGED 4.1
param set-default BAT2_V_EMPTY 3.2
param set-default BAT2_V_DIV 18.1
param set-default BAT2_SOURCE 0
# Rough guess 50 mOhm
param set-default BAT2_R_INTERNAL 0.0050
param set-default BAT2_CAPACITY 22000

# Enable LL40LS in i2c
param set-default SENS_EN_LL40LS 2
Expand Down Expand Up @@ -95,4 +110,4 @@ param set-default GPS_SAT_INFO 1
param set-default COM_RC_OVERRIDE 0

# Change current sense shunt resistor value
param set-default INA226_SHUNT 0.00025
param set-default INA226_SHUNT 0.0005
21 changes: 15 additions & 6 deletions ROMFS/px4fmu_common/init.d/airframes/4420_ssrc_arwing
Original file line number Diff line number Diff line change
Expand Up @@ -41,14 +41,23 @@ param set-default FW_AIRSPD_STALL 12.0
param set-default FW_AIRSPD_TRIM 18.0

# Battery parameters
# Ref: tattu 6500mah 4s
param set-default BAT1_N_CELLS 4
param set-default BAT1_R_INTERNAL 0.0050
param set-default BAT1_V_EMPTY 3.6000
param set-default BAT1_V_LOAD_DROP 0.1000
param set-default BAT1_V_CHARGED 4.2
param set-default BAT1_V_DIV 18.1
param set-default BAT1_R_INTERNAL 0.0011
param set-default BAT1_V_EMPTY 3.5000
param set-default BAT1_SOURCE 0
param set-default BAT1_CAPACITY 1800

param set-default BAT2_R_INTERNAL 0.0050
param set-default BAT2_V_EMPTY 3.6000
param set-default BAT2_V_LOAD_DROP 0.1000

param set-default BAT2_N_CELLS 4
param set-default BAT2_V_CHARGED 4.2
param set-default BAT2_V_DIV 18.1
param set-default BAT2_R_INTERNAL 0.0011
param set-default BAT2_V_EMPTY 3.5000
param set-default BAT2_SOURCE 0
param set-default BAT2_CAPACITY 1800

# Disable internal magnetometer
param set CAL_MAG0_PRIO 0
Expand Down
24 changes: 21 additions & 3 deletions ROMFS/px4fmu_common/init.d/airframes/4430_ssrc_strivermini
Original file line number Diff line number Diff line change
Expand Up @@ -81,10 +81,25 @@ param set-default FW_AIRSPD_STALL 12.0
param set-default FW_AIRSPD_TRIM 18.0

# Battery parameters
param set-default BAT1_N_CELLS 4
param set-default BAT1_V_CHARGED 4.2
param set-default BAT1_V_EMPTY 3.6
# Ref: t-drone 22000mah 6s Lion
param set-default BAT1_N_CELLS 6
param set-default BAT1_V_CHARGED 4.1
param set-default BAT1_V_EMPTY 3.2
param set-default BAT1_V_DIV 18.1
param set-default BAT1_SOURCE 0
# Rough guess 50 mOhm
param set-default BAT1_R_INTERNAL 0.0050
param set-default BAT1_CAPACITY 22000

# Ref: t-drone 22000mah 6s Lion
param set-default BAT2_N_CELLS 6
param set-default BAT2_V_CHARGED 4.1
param set-default BAT2_V_EMPTY 3.2
param set-default BAT2_V_DIV 18.1
param set-default BAT2_SOURCE 0
# Rough guess 50 mOhm
param set-default BAT2_R_INTERNAL 0.0050
param set-default BAT2_CAPACITY 22000

# Disable internal magnetometer
param set CAL_MAG0_PRIO 0
Expand Down Expand Up @@ -124,3 +139,6 @@ param set-default VT_FW_MIN_ALT 5
# QuadChute angle limits
param set-default VT_FW_QC_P 35
param set-default VT_FW_QC_R 60

# Change current sense shunt resistor value
param set-default INA226_SHUNT 0.0005

0 comments on commit 2dc0471

Please sign in to comment.