Go Down

### Topic: Help Calculate Velocity/Speed OR G-Force from MPU6050 (Read 176 times)previous topic - next topic

##### Nov 16, 2017, 07:31 pm
Hello

I have a problem with my project and i need you help.

My project is to make a timer to calculate an acceleration of a car (0-100kph).
For the speed i am using the MTK3339 at 10hz.
My problem is to trigger the timer on the launch of the car because the gps lose some time to understand the launch.

So I want to use the MPU6050 to calculate the velocity until 10kph and after I can use the GPS for the speed.

Can anyone help me to calculate the velocity from MPU6050 or the acceleretion (g-force) of the car(in one direction)?

#### jremington

#1
##### Nov 16, 2017, 07:46 pmLast Edit: Nov 16, 2017, 07:46 pm by jremington
In principle you can calculate the velocity by integrating the acceleration over time

Vfinal = Vinitial + acc*(time in seconds), with acc measured in units of meters/second^2.

However, in practice this is difficult for two reasons: accelerometer noise, and the fact that the accelerometer measures the acceleration due to gravity in addition to that due to other forces. It is difficult to subtract the gravity contribution correctly to get the horizontal acceleration.

See this discussion of the problem.

#2
##### Nov 16, 2017, 07:56 pm
Yes that's my problem that I can't calculate the Force in one direction.
Do you think i can use another sensor?

#### jremington

#3
##### Nov 16, 2017, 08:08 pmLast Edit: Nov 16, 2017, 08:13 pm by jremington
Quote
Yes that's my problem that I can't calculate the Force in one direction.
If you align the accelerometer such that the MPU-6050 X axis is horizontal and along the direction of travel and the Z axis is directly down, then just use the X acceleration.

But the alignment has to be done very, very carefully to be useful. Don't forget that with rear wheel drive, automobiles tilt backwards when accelerating! That is why this is not a simple problem.

It is probably easier and certainly more accurate to measure the speed by measuring wheel revolutions per second.

#4
##### Nov 16, 2017, 08:12 pm
Yes i want to put the device without direction
Can i calculate one direction force from all forces?

#### jremington

#5
##### Nov 16, 2017, 08:23 pm
The accelerometer measures the total acceleration, which is the vector sum of the accelerations along three axes, and can be caused by several different forces acting at once.

If you are interested in measuring only the acceleration in (for example) the X direction, you have to know where X is pointed to make sense of it.

#6
##### Nov 16, 2017, 08:42 pm
Can i measure the force if i dont know the rotation?

#### jremington

#7
##### Nov 16, 2017, 10:07 pmLast Edit: Nov 16, 2017, 10:08 pm by jremington
Yes, you always measure the total acceleration, regardless of "rotation".

#8
##### Nov 17, 2017, 12:33 pm
So if i know the acceleration i can measure the velocity correct?
But how can measure the acceleration?

#### jremington

#9
##### Nov 17, 2017, 05:25 pmLast Edit: Nov 17, 2017, 05:27 pm by jremington
Quote
So if i know the acceleration i can measure the velocity correct?

Quote
But how can measure the acceleration?
Use an accelerometer, like the MPU6050.