初级会员

- 积分
- 55
- 金钱
- 55
- 注册时间
- 2013-7-20
- 在线时间
- 0 小时
|

楼主 |
发表于 2013-8-3 22:48:02
|
显示全部楼层
一阶互补
// a=tau / (tau + loop time)
// newAngle = angle measured with atan2 using the accelerometer
//加速度传感器输出值
// newRate = angle measured using the gyro
// looptime = loop time in millis()
float tau=0.075;
float a=0.0;
float Complementary(float newAngle, float newRate,int looptime)
{
float dtC = float(looptime)/1000.0;
a=tau/(tau+dtC);
x_angleC= a* (x_angleC + newRate * dtC) + (1-a) * (newAngle);
return x_angleC;
}
这是在网上找到的最多的一阶互补滤波的程序,looptime怎么得到的,tau怎么选?
回复【6楼】lsj9383:
---------------------------------
一阶互补
// a=tau / (tau + loop time)
// newAngle = angle measured with atan2 using the accelerometer
//加速度传感器输出值
// newRate = angle measured using the gyro
// looptime = loop time in millis()
float tau=0.075;
float a=0.0;
float Complementary(float newAngle, float newRate,int looptime)
{
float dtC = float(looptime)/1000.0;
a=tau/(tau+dtC);
x_angleC= a* (x_angleC + newRate * dtC) + (1-a) * (newAngle);
return x_angleC;
}
这是在网上找到的最多的一阶互补滤波的程序,looptime怎么得到的,tau怎么选? |
|