From 2dc04716854c89b2e0b6080430f304da127c6412 Mon Sep 17 00:00:00 2001 From: Matias Soini Date: Fri, 19 Jan 2024 09:54:24 +0200 Subject: [PATCH] Update battery characteristics for more accurate battery level estimation --- .../init.d/airframes/4400_ssrc_fog_x | 12 +++++----- .../init.d/airframes/4401_ssrc_fog_x_tmotor | 23 ++++++++++++++---- .../init.d/airframes/4420_ssrc_arwing | 21 +++++++++++----- .../init.d/airframes/4430_ssrc_strivermini | 24 ++++++++++++++++--- 4 files changed, 61 insertions(+), 19 deletions(-) diff --git a/ROMFS/px4fmu_common/init.d/airframes/4400_ssrc_fog_x b/ROMFS/px4fmu_common/init.d/airframes/4400_ssrc_fog_x index 680c874c476b..3708278758d4 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/4400_ssrc_fog_x +++ b/ROMFS/px4fmu_common/init.d/airframes/4400_ssrc_fog_x @@ -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 diff --git a/ROMFS/px4fmu_common/init.d/airframes/4401_ssrc_fog_x_tmotor b/ROMFS/px4fmu_common/init.d/airframes/4401_ssrc_fog_x_tmotor index a3e50962904f..59ffc5030294 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/4401_ssrc_fog_x_tmotor +++ b/ROMFS/px4fmu_common/init.d/airframes/4401_ssrc_fog_x_tmotor @@ -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 @@ -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 diff --git a/ROMFS/px4fmu_common/init.d/airframes/4420_ssrc_arwing b/ROMFS/px4fmu_common/init.d/airframes/4420_ssrc_arwing index b8ed145b1170..fc593aed3b5b 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/4420_ssrc_arwing +++ b/ROMFS/px4fmu_common/init.d/airframes/4420_ssrc_arwing @@ -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 diff --git a/ROMFS/px4fmu_common/init.d/airframes/4430_ssrc_strivermini b/ROMFS/px4fmu_common/init.d/airframes/4430_ssrc_strivermini index 0963ba0733a4..f14099545ceb 100644 --- a/ROMFS/px4fmu_common/init.d/airframes/4430_ssrc_strivermini +++ b/ROMFS/px4fmu_common/init.d/airframes/4430_ssrc_strivermini @@ -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 @@ -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