Go Down

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

bill_lask

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)?

Thank you in advance.

jremington

#1
Nov 16, 2017, 07:46 pm Last 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.

bill_lask

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 pm Last 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.

bill_lask

Yes i want to put the device without direction
Can i calculate one direction force from all forces?

jremington

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.

bill_lask

Can i measure the force if i dont know the rotation?

jremington

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

bill_lask

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 pm Last Edit: Nov 17, 2017, 05:27 pm by jremington
Quote
So if i know the acceleration i can measure the velocity correct?
See reply #1.

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

bill_lask

yes my problem is that i cant calculate the acceleration from mpu6050
i can calculate only in one axis
but i want to read where is the gravity and i want to read only the vertical axis

Go Up