feat: Add rfid feature and .gitignore file
This commit is contained in:
95
apps/earphone/xtell_Sensor/README.md
Normal file
95
apps/earphone/xtell_Sensor/README.md
Normal file
@ -0,0 +1,95 @@
|
||||
# 时间间隔 -- 软件模拟iic的情况下
|
||||
|
||||
目前测试代码如下:
|
||||
|
||||
```c
|
||||
create_process(&test_id, "test",NULL, test, (int)(DELTA_TIME*1000));
|
||||
```
|
||||
|
||||
对于test函数的调用时间设置的是10ms调用一次,test代码如下:
|
||||
|
||||
```c
|
||||
void test(){
|
||||
signed short acc_data_buf[3] = {0};
|
||||
signed short gyr_data_buf[3] = {0};
|
||||
signed short acc_gyro_input[6] = {0};
|
||||
float Angle_output[3] = {0};
|
||||
SL_SC7U22_RawData_Read(acc_data_buf,gyr_data_buf);
|
||||
BLE_send_data = sensor_processing_task(acc_data_buf, gyr_data_buf);
|
||||
//----省略-----
|
||||
//一些ble数据发送
|
||||
|
||||
memset(&BLE_send_data, 0, sizeof(BLE_send_data_t));
|
||||
memset(&data, 0, 50);
|
||||
// xlog("end============\n");
|
||||
|
||||
}
|
||||
```
|
||||
|
||||
sensor_processing_task当中就进行了计算,包括卡尔曼等,在timer设置成10ms的情况下,实际上test函数(或者是sensor_processing_task函数),距离上次调用到本次调用,实际间隔为40ms
|
||||
|
||||
计算距离不能直接采用timers设置的时间间隔作为dt来求距离,实际每次计算求速度的时间应该是40ms
|
||||
|
||||
|
||||
# 11.13
|
||||
|
||||
代码主要文件夹:apps\earphone\xtell_Sensor
|
||||
|
||||
- apps\earphone\xtell_Sensor\send_data.c,‘ xtell_task_create ’ 函数,传感器计算程序逻辑开始位置,包括传感器读取数据的任务、蓝牙发送任务、速度距离计算任务
|
||||
|
||||
- apps\earphone\xtell_Sensor\calculate:目前只有计算传感器去除重力分量的代码
|
||||
- 问题:存在漂移
|
||||
- 水平的情况下三轴去掉重力分量,计算出来的结果, 误差有0.0x m/s^s
|
||||
- original(g): x -0.02, y 0.00, z 1.00
|
||||
device(m/s^2) no g: x -0.08, y -0.01, z -0.04, all 0.08
|
||||
|
||||
- 在板子任意倾斜角度下,去掉各轴重力分量的情况下,误差有0.3x m/s^s
|
||||
- ===original(g): x -0.20, y -0.85, z 0.41===
|
||||
|
||||
- ===device(m/s^2) no g: x 0.06, y 0.31, z -0.10, all 0.33===
|
||||
|
||||
- apps\earphone\xtell_Sensor\sensor:传感器驱动,参与编译的为SC7U22.c和SC7U22.h
|
||||
- apps\earphone\xtell_Sensor\A_hide:速度和距离计算代码
|
||||
- 最新一版为apps\earphone\xtell_Sensor\A_hide\10\,水平距离测速2、3m误差
|
||||
- 要使用只需要把代码复制粘贴到calculate文件夹下
|
||||
|
||||
|
||||
|
||||
# 11.18
|
||||
|
||||
去除重力分量后仍有误差:
|
||||
|
||||
- 数据对齐?
|
||||
- 有没有丢数据?
|
||||
- 重复定位的数据?
|
||||
- 静态时的角度误差?
|
||||
|
||||
|
||||
|
||||
定时器1的回调函数(10ms调用一次)**A**:读取传感器数据,放进buff
|
||||
|
||||
定时器2的回调函数(5ms调用一次)**B**:读取buff的传感器数据,去除重力分离的计算
|
||||
|
||||
- **数据没有对齐**,A 的回调调用计数 > B 的回调调用计数
|
||||
- **丢数据了**,A 读取传感器数据的回调函数中,打印了buff已满的log
|
||||
- **重复定位**:移动后回到原先的位置,前后的计算得到的三轴角度相同
|
||||
- **静态时的角度误差**:1°左右
|
||||
- 定时器2不进行重力分离计算,只进行计数,也仍然有数据没有对齐和丢数据的情况
|
||||
|
||||
|
||||
|
||||
将读取传感器数据、去除重力分量计算放到同一个任务下,同步进行
|
||||
|
||||
- 数据没有丢失,数据也对齐了
|
||||
- 在小倾斜的坡面下,去除重力分量后的总的加速度,**小于0.1m/s^2**
|
||||
- 在大倾斜的坡面下(如旋转超过70°),去除重力分量后的总的加速度,在**0.4m/s^2上下**
|
||||
- 貌似是角度越大,越接近方向锁,导致角度更容易漂移造错数据错误
|
||||
|
||||
采用四元数的方式做去除重力分量的计算:
|
||||
|
||||
- 将读取传感器数据、去除重力分量计算放到同一个任务下
|
||||
|
||||
- 在小倾斜的坡面下,去除重力分量后的总的加速度,低于**0.04m/s^2**
|
||||
- 在大倾斜的坡面下(如旋转超过70°),去除重力分量后的总的加速度,在**0.1m/s^2上下**
|
||||
|
||||
- 大倾斜角度的误差要靠磁力计来消除(yaw无法通过加速度计来消除偏差)
|
||||
Reference in New Issue
Block a user