From 0fab14bd3b70cdb16f134eaeeaac7d0947f2078f Mon Sep 17 00:00:00 2001
From: zhyinch <zhyinch@gmail.com>
Date: 星期三, 25 十一月 2020 19:36:16 +0800
Subject: [PATCH] 增加速度滤波阈值

---
 源码/核心板/Src/main.c |    7 ++++++-
 1 files changed, 6 insertions(+), 1 deletions(-)

diff --git "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c" "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c"
index f341743..509aec6 100644
--- "a/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c"
+++ "b/\346\272\220\347\240\201/\346\240\270\345\277\203\346\235\277/Src/main.c"
@@ -52,7 +52,7 @@
 uint16_t vel_factor,pos_factor;
 
 extern u8 module_power;
-u16 slottime,max_slotnum,current_slotpos;
+u16 slottime,max_slotnum,current_slotpos,dist_threshold;
 void Program_Init(void)
 {uint16_t i;
 	float temp;
@@ -80,6 +80,11 @@
 		group_id=g_com_map[GROUP_ID];
 		vel_factor=g_com_map[FILTER_COEFFICIENT];
 		pos_factor=g_com_map[FILTER_COEFFICIENT];
+		dist_threshold = g_com_map[SPEEDFILTER_THRES]/(1000/g_com_map[COM_INTERVAL]);
+		if(dist_threshold<30)
+		{dist_threshold = 30;}
+		if(dist_threshold>15000)
+		{dist_threshold = 15000;}
 		if(dev_id==0)
 			sync_mainbase=1;
 		module_power = g_com_map[POWER];

--
Gitblit v1.9.3