[英]Signal Vector Magnitude - Accelerometer MPU6050
I'm creating a kind of pedometer on a bracelet with an MPU6050 accelerometer, and for that I'm relying on the following code https://github.com/Perseus14/Pedometer/blob/master/Pedometer.ino .我正在使用 MPU6050 加速度计在手镯上创建一种计步器,为此我依赖以下代码https://github.com/Perseus14/Pedometer/blob/master/Pedometer.ino 。 I managed to make the code work, but I am in doubt in the following calculation made in the algorithm:
我设法使代码工作,但我对算法中的以下计算表示怀疑:
int mag = sqrt (pow (x - angle_x, 2) + pow (y - angle_y, 2) + pow (z - angle_z, 2)); int mag = sqrt (pow (x -angle_x, 2) + pow (y -angle_y, 2) + pow (z -angle_z, 2)); (A)
(一种)
In this line of code that I put he calculates the vector of magnitude of the signal, but to make this calculation x, y and z are equivalent to the previous angles already obtained and angle_x, angle_y, angle_z balance the current ones.在我放置的这行代码中,他计算了信号幅度的向量,但为了进行此计算,x、y 和 z 等效于之前已经获得的角度,并且angle_x、angle_y、angle_z 平衡了当前的角度。 My question is related to this subtraction of values, because the formula for calculating the magnitude vector of the sign is as follows:
我的问题与这个值的减法有关,因为计算符号幅度向量的公式如下:
int mag = sqrt (pow (x, 2) + pow (y, 2) + pow (z, 2)); int mag = sqrt (pow (x, 2) + pow (y, 2) + pow (z, 2)); (B)
(二)
Can anyone understand why the values were subtracted in the first formula (A) before calculating the signal magnitude vector?谁能理解为什么在计算信号幅度向量之前在第一个公式(A)中减去这些值?
Thank you!谢谢!
I thing this is beeing used to calculate the accelarion variation... And than is basicly the derevative.我认为这被用来计算加速度变化......而且基本上是derevative。
When you derivate a position you get the velocity.当你推导一个位置时,你会得到速度。 When you derivate the velocity you get the acceleration.
当你推导速度时,你会得到加速度。
(Considering time constant is "1"). (考虑时间常数为“1”)。
声明:本站的技术帖子网页,遵循CC BY-SA 4.0协议,如果您需要转载,请注明本站网址或者原文地址。任何问题请咨询:yoyou2525@163.com.