补滤波器方程式中的“ dt”是什么,我如何找出“ dt”?

时间:2019-05-05 09:57:59

标签: python-3.x

我将在系统中实现互补滤波器,但是我不太了解“ dt”的含义,以及如何在互补滤波器方程式中找出“ dt”。在这里,我找到了互补滤波器方程https://www.pieter-jan.com/node/11,这是方程角度= 0.98 *(agnle + gyrData * dt)+ 0.02 *(accData)。

while n!= 10:

data = bus.read_i2c_block_data(0x68, 0x3B, 6)

xAccl = data[0] * 256 + data[1]
if xAccl > 32767 :
        xAccl -= 65536

yAccl = data[2] * 256 + data[3]
if yAccl > 32767 :
        yAccl -= 65536

zAccl = data[4] * 256 + data[5]
if zAccl > 32767 :
        zAccl -= 65536

data = bus.read_i2c_block_data(0x68, 0x43, 6)

xGyro = data[0] * 256 + data[1]
if xGyro > 32767 :
        xGyro -= 65536

yGyro = data[2] * 256 + data[3]
if yGyro > 32767 :
        yGyro -= 65536

zGyro = data[4] * 256 + data[5]
if zGyro > 32767 :
        zGyro -= 65536

totZdata += zAccl
totXdata += xAccl
totYdata += yAccl
totGyroXdata += xGyro
totGyroYdata += yGyro
totGyroZdata += zGyro
zAcclG = (zAccl - AcclzOff) / Accl_scale
xAcclG = (xAccl - AcclxOff) / Accl_scale
yAcclG = (yAccl - AcclyOff) / Accl_scale
xGyroDPS = (xGyro - GyroxOff) / Gyro_scale
yGyroDPS = (yGyro - GyroyOff) / Gyro_scale
zGyroDPS = (zGyro - GyrozOff) / Gyro_scale    


print ("Acceleration in X-Axis : %.2f G" %xAcclG)
print ("Acceleration in Y-Axis : %.2f G" %yAcclG)
print ("Acceleration in Z-Axis : %.2f G" %zAcclG)
print (" X rotation : %f" % (get_x_rotation(xAcclG, yAcclG, zAcclG)))
print (" Y rotation : %f" % (get_y_rotation(xAcclG, yAcclG, zAcclG)))
print ("X-Axis of Rotation : %.2f" %xGyroDPS)
print ("Y-Axis of Rotation : %.2f" %yGyroDPS)
print ("Z-Axis of Rotation : %.2f" %zGyroDPS)
n += 1

这些是我现在正在使用的代码,如何从互补滤波器方程式确定“ dt”?

0 个答案:

没有答案