I2Cdevlib Forums

hatt0002

Members

15

4

Reputation Activity

1. hatt0002 got a reaction from Johnnydofs in roll affecting yaw?
Hi friends,

I have managed to read from two mpu6050 on DMP. Both sensors are fitted on a piece of board and are perfectly levelled.
My problem is that when I tilt the sensors such that I increase/decrease Roll, the Yaw is changed, even when the sensors are not rotated on the z axis. Is it normal that rolling affects yawing? Furthermore, the change in Yaw for both sensors is not the same, and there will be a difference in yaw of 8 deg between the two sensors for a 45deg rolling.

Hatt
2. hatt0002 got a reaction from Johnnydofs in velocity from acceleration
Hi,

I am currently doing a project in which I need to capture the acceleration of a pivoted rotating wooden beam. From the acceleration, I need to determine the velocity.

I am using Jeff's teapot sketch with the mpu6050 and I have managed to also include the acceleration in the teapotPacket to print acceleration in processing. I know that velocity is the first integral of acceleration. Such integral can be expressed as:
v = u + AT, where v is the current velocity, u is the velocity before, A is the acceleration and T is a time interval.

This is my code for the velocities in the three directions with sampling time of 1ms:

vX = uX + (AX)*0.001; //vX = current velocity in the X direction, uX = velocity in the previous iteration, AX = acceleration in the x direc  uX = vX;                      //setting the current velocity as the previous velocity              vY = uY + (AY)*0.001;  uY = vY;                  vZ = uZ + (AZ)*0.001;  uZ = vZ;        If I move the sensor say in the x direction, acceleration in the x direction increases and when I stop the sensor, acceleration becomes negative and converges to zero, as expected. The velocity seems to be calculated and printed right when increasing from zero to a particular value. Now my problem is, that when I stop moving the sensor, velocity does not go back to zero when the sensor is stationary, but it decreases by a small amount only (say it stops decreasing at 0.5m/s. This gets worse when the sensor is moved faster.

It seems like the acceleration is read more than the deceleration (decreasing acceleration) and therefore, less negative values for acceleration are captured.    Can anybody help me?

Thanks, Hatt

3. hatt0002 got a reaction from sidhulinux in velocity from acceleration
I have tried something similar to your code earlier and I have noticed the velocity drift. In my latest code, I have the actual acceleration which is the acceleration minus gravity component rounded to 1 decimal place using nfc() multiplied by 9.81 to get real acceleration as follows;
String AccelX2i = nfc(AccelX2, 1); //This rounds up the acceleration to 1 decimal place and therefore I will always get the same absolute value during acceleration and decelleration, thus perfect cancellation gravity2i[0] = nfc(gravity2[0], 1); //similar to previous line ActualAccelX2=(float(AccelX2i)-float(gravity2i[0]))*9.81; //this gives me the real acceleration By these three lines of code, I know I am reducing the accuracy of acceleration, but I am also eliminating the drift.

Then I am sampling the ActualAccelX2 data and store it in an array whose size increases with time. Also I am creating another array for the velocity;

float [] AccX = new float[time]; //array for the current acceleration after sampling float [] vXn2 = new float[time]; //array for the current velocity if(millis() % 1 == 0) //sampling at 1KHz { for(int n = 1; n<time; n++) { AccX2[n] = ActualAccelX2; //filling the array with the current accel vXn2[n] = vXn2[n-1] + (AccX2[n])*0.001; //vX2[n] is the current velocity, vX2[n-1] is the previous velocity and AccX2[n] is the current accel } }  This returns exactly what I need, but I am not sure if it is giving the correct values or not. If it is correct, then the drift is eliminated since the velocity always converges to zero when the sensor is stationary and increases as I start moving the sensor.

Thanks, Hatt.

4. hatt0002 got a reaction from Ekbergdub in velocity from acceleration
Hi,

I am currently doing a project in which I need to capture the acceleration of a pivoted rotating wooden beam. From the acceleration, I need to determine the velocity.

I am using Jeff's teapot sketch with the mpu6050 and I have managed to also include the acceleration in the teapotPacket to print acceleration in processing. I know that velocity is the first integral of acceleration. Such integral can be expressed as:
v = u + AT, where v is the current velocity, u is the velocity before, A is the acceleration and T is a time interval.

This is my code for the velocities in the three directions with sampling time of 1ms:

vX = uX + (AX)*0.001; //vX = current velocity in the X direction, uX = velocity in the previous iteration, AX = acceleration in the x direc  uX = vX;                      //setting the current velocity as the previous velocity              vY = uY + (AY)*0.001;  uY = vY;                  vZ = uZ + (AZ)*0.001;  uZ = vZ;        If I move the sensor say in the x direction, acceleration in the x direction increases and when I stop the sensor, acceleration becomes negative and converges to zero, as expected. The velocity seems to be calculated and printed right when increasing from zero to a particular value. Now my problem is, that when I stop moving the sensor, velocity does not go back to zero when the sensor is stationary, but it decreases by a small amount only (say it stops decreasing at 0.5m/s. This gets worse when the sensor is moved faster.

It seems like the acceleration is read more than the deceleration (decreasing acceleration) and therefore, less negative values for acceleration are captured.    Can anybody help me?

Thanks, Hatt

5. hatt0002 got a reaction from Samellanak in velocity from acceleration
Hi,

I am currently doing a project in which I need to capture the acceleration of a pivoted rotating wooden beam. From the acceleration, I need to determine the velocity.

I am using Jeff's teapot sketch with the mpu6050 and I have managed to also include the acceleration in the teapotPacket to print acceleration in processing. I know that velocity is the first integral of acceleration. Such integral can be expressed as:
v = u + AT, where v is the current velocity, u is the velocity before, A is the acceleration and T is a time interval.

This is my code for the velocities in the three directions with sampling time of 1ms:

vX = uX + (AX)*0.001; //vX = current velocity in the X direction, uX = velocity in the previous iteration, AX = acceleration in the x direc  uX = vX;                      //setting the current velocity as the previous velocity              vY = uY + (AY)*0.001;  uY = vY;                  vZ = uZ + (AZ)*0.001;  uZ = vZ;        If I move the sensor say in the x direction, acceleration in the x direction increases and when I stop the sensor, acceleration becomes negative and converges to zero, as expected. The velocity seems to be calculated and printed right when increasing from zero to a particular value. Now my problem is, that when I stop moving the sensor, velocity does not go back to zero when the sensor is stationary, but it decreases by a small amount only (say it stops decreasing at 0.5m/s. This gets worse when the sensor is moved faster.

It seems like the acceleration is read more than the deceleration (decreasing acceleration) and therefore, less negative values for acceleration are captured.    Can anybody help me?

Thanks, Hatt

6. hatt0002 got a reaction from Samellanak in roll affecting yaw?
Hi friends,

I have managed to read from two mpu6050 on DMP. Both sensors are fitted on a piece of board and are perfectly levelled.
My problem is that when I tilt the sensors such that I increase/decrease Roll, the Yaw is changed, even when the sensors are not rotated on the z axis. Is it normal that rolling affects yawing? Furthermore, the change in Yaw for both sensors is not the same, and there will be a difference in yaw of 8 deg between the two sensors for a 45deg rolling.