Explorar o código

SP600加入根据soc和放电电流加大放电速度

Signed-off-by: huhui <huhui@sharkgulf.com>
huhui %!s(int64=4) %!d(string=hai) anos
pai
achega
44ce456a26
Modificáronse 2 ficheiros con 18 adicións e 9 borrados
  1. 9 9
      Application/app/sox/soc.c
  2. 9 0
      Application/bsp/shark_bsp.h

+ 9 - 9
Application/app/sox/soc.c

@@ -101,27 +101,27 @@ static void soc_update_discharger_coeff(void){
 	if (_soc.flags & SOC_FLAG_CALIBRATED) {
 		float coff = 1.0f;
 		if (_soc.capacity <= 20) {
-			if (abs(measure_value()->load_current) >= 50000) {
+			if (abs(measure_value()->load_current) >= CURRENT_BIGER) {
 				coff = 1.06f;
-			}else if (abs(measure_value()->load_current) >= 40000) {
+			}else if (abs(measure_value()->load_current) >= CURRENT_MID) {
 				coff = 1.05f;
-			}else if (abs(measure_value()->load_current) >= 30000) {
+			}else if (abs(measure_value()->load_current) >= CURRENT_NORMAL) {
 				coff = 1.03f;
 			}
 		}else if (_soc.capacity <= 40) {
-			if (abs(measure_value()->load_current) >= 50000) {
+			if (abs(measure_value()->load_current) >= CURRENT_BIGER) {
 				coff = 1.05f;
-			}else if (abs(measure_value()->load_current) >= 40000) {
+			}else if (abs(measure_value()->load_current) >= CURRENT_MID) {
 				coff = 1.03f;
-			}else if (abs(measure_value()->load_current) >= 30000) {
+			}else if (abs(measure_value()->load_current) >= CURRENT_NORMAL) {
 				coff = 1.02f;
 			}
 		}else if (_soc.capacity <= 60) {
-			if (abs(measure_value()->load_current) >= 50000) {
+			if (abs(measure_value()->load_current) >= CURRENT_BIGER) {
 				coff = 1.03f;
-			}else if (abs(measure_value()->load_current) >= 40000) {
+			}else if (abs(measure_value()->load_current) >= CURRENT_MID) {
 				coff = 1.02f;
-			}else if (abs(measure_value()->load_current) >= 30000) {
+			}else if (abs(measure_value()->load_current) >= CURRENT_NORMAL) {
 				coff = 1.01f;
 			}
 		}

+ 9 - 0
Application/bsp/shark_bsp.h

@@ -29,12 +29,21 @@
 #define MAX_SOFT_CURRENT (50)
 #define MAX_I2T  (2500.0f * 2)
 #define UART_NUM 2
+#define CURRENT_BIGER 50000
+#define CURRENT_MID   40000
+#define CURRENT_NORMAL 30000
 #elif (CONFIG_BOARD_TYPE==SHARK_BOARD_SP600)
 #define r_resistor 2.0f
 #ifdef CONFIG_CAP_15AH
 #define MAX_HA (15.0f)
+#define CURRENT_BIGER 35000
+#define CURRENT_MID   20000
+#define CURRENT_NORMAL 15000
 #else
 #define MAX_HA (22.5f)
+#define CURRENT_BIGER 40000
+#define CURRENT_MID   30000
+#define CURRENT_NORMAL 20000
 #endif
 #define MAX_SOFT_CURRENT (25)
 #define MAX_I2T  (900.0f * 2)