Velocity and Acceleration Relationship

Ok, so, in summary, the provided acceleration data has issues with systematic errors and a broad scatter, which may be due to issues with the accelerometer.
  • #1
Ash_Sdr

Homework Statement


Given Ax,Ay,Az . I need to find the Vx,Vy,Vz ... The Coordinate Frame is Vehicle Axis System .. I have actual Speed to compare once i get the Vx,Vy,Vz ... The vehicle starts from the rest i.e Speed is zero and Accelerations are sampled at 0.05 seconds///

This is not a homework question

Homework Equations


Vx = Vix + integration(Ax*dt)
Vy = Viy + integration(Ay*dt)
Vz = Viz + integration(Az*dt)

V = sqrt(Vx^2 + Vy^2 + Vz^2)

The Attempt at a Solution



I have done the steps above with Initial velocity components as zero and did get some solution (Vx,Vy,Vz) , But they are not matching with that of actual speed .

If I just plot Vx and actual Speed , Its following the same trend as actual Speed of vehicle but has higher values...
What I am assuming is that , Do I need to do any coordinate conversion as it is Vehicle Body frame to Navigation frame.. Kind of... Please comment on this

Please let me know if anyone needs the data and also the Code which i wrote to calculate the velcoity
 
Physics news on Phys.org
  • #2
Yes, the data and code would be of help. Can you post it using the [ code ] tags?
 
  • #3
t = 0.05;
% Initial velocity components are zero
Vx(1) = 0 + Ax(1)*t;
Vy(1) = 0 + Ay(1)*t;
Vz(1) = 0 + Az(1)*t;

for i = 2:length(Ax)
Vx(i) = Vx(i-1) + (Ax(i)+Ax(i-1))*t*0.5;
Vy(i) = Vy(i-1) + (Ay(i)+Ay(i-1))*t*0.5;
Vz(i) = Vz(i-1) + (Az(i)+Az(i-1))*t*0.5;
endI have attached the complete MATLAB Code as a AccelTest.txt .. Please rename the extension to .m
 

Attachments

  • AccelTest.txt
    624 bytes · Views: 501
  • AccelTest.txt
    624 bytes · Views: 381
  • #4
Here is the DATA File... Please add te
Ash_Sdr said:
t = 0.05;
% Initial velocity components are zero
Vx(1) = 0 + Ax(1)*t;
Vy(1) = 0 + Ay(1)*t;
Vz(1) = 0 + Az(1)*t;

for i = 2:length(Ax)
Vx(i) = Vx(i-1) + (Ax(i)+Ax(i-1))*t*0.5;
Vy(i) = Vy(i-1) + (Ay(i)+Ay(i-1))*t*0.5;
Vz(i) = Vz(i-1) + (Az(i)+Az(i-1))*t*0.5;
endI have attached the complete MATLAB Code as a AccelTest.txt .. Please rename the extension to .m
And I have attached the Data file "AccelData_StartWithZeroSpeed" . please add .mat extension to it
 

Attachments

  • AccelData_StartWithZeroSpeed.txt
    53.3 KB · Views: 360
  • #5
Ash_Sdr said:
for i = 2:length(Ax)
Vx(i) = Vx(i-1) + (Ax(i)+Ax(i-1))*t*0.5;
Vy(i) = Vy(i-1) + (Ay(i)+Ay(i-1))*t*0.5;
Vz(i) = Vz(i-1) + (Az(i)+Az(i-1))*t*0.5;
end
Is there a reason you are averaging the acceleration like that?
 
  • #6
berkeman said:
Is there a reason you are averaging the acceleration like that?

You mean the Current and Previous Acceleration values ... Trying out different ways of doing... Since these are raw accelerations, would averae out some noise...

but I did use Current acceleration and tried it .. IT didn't work either... And I used the discrete time integrator block in simulink with trapezoidal rule method and I got pretty much the same results ...
 
  • #7
Ash_Sdr said:
Here is the DATA File... Please add te
And I have attached the Data file "AccelData_StartWithZeroSpeed" . please add .mat extension to it
Can you attach the data in a more generic format, so it does not require matlab? Maybe .csv?
 
  • #8
haruspex said:
Can you attach the data in a more generic format, so it does not require matlab? Maybe .csv?
I have added the AccelData ... Its a csv file... You can rename the extension .txt to .csv to load it up in excel. Thanks
 

Attachments

  • AccelData.txt
    251.9 KB · Views: 502
  • #9
Ash_Sdr said:
I have added the AccelData ... Its a csv file... You can rename the extension .txt to .csv to load it up in excel. Thanks
Sorry for the slow reply - was busy.

Two things...
1. You have only provided the acceleration data. I can compute speeds from that, but you have not given me the actual speed data to compare wit
2. The accelerations jump around hugely from one reading to the next. This says your time intervals are too long to get an accurate measure of velocity.
 
  • #10
The AccelData.txt has four columns... Ax,Ay,Ax,Speed... Time intervals are too long as in ??/ It was 0.050 seconds and from Vehicle CAN ... (in vehicle coordinate system)
 
  • #11
Ash_Sdr said:
The AccelData.txt has four columns... Ax,Ay,Ax,Speed... Time intervals are too long as in ??/ It was 0.050 seconds and from Vehicle CAN ... (in vehicle coordinate system)
Ok, I was misled by the way the initial speeds are all zero, when the accelerations say they should not be.

Try this in a spreadsheet, starting with cols A to D as in the file you posted.
Col E = the speeds from integrating the accelerations
Col F = computed speed minus actual
Col G = change between consecutive values in col F
Plot col G in a chart (points only, small icons).

I observe that
1. There are periods where this produces a steady horizontal line, but not on the y-axis.
E.g. 0-300, 6730-7300, 10670-11590, 11840-end.
These imply a systematic error in the measured acceleration. E.g. for 10670-11590, the offset hovers around 0.015. That is, the discrepancy between calculated speed and actual speed is growing at 0.015 every 0.05 seconds, so the acceleration measured is persistently wrong by 0.3. The other horizontal periods imply different systematic errors.
The systematic error for 0-300 is clearest. From the zero actual speeds, these should obviously all be zero accelerations, but they are measured at around -0.4.

2. Elsewhere, there is a general and rather broad scatter from -0.05 to +0.05.

3. Quite often, there is a near-vertical burst of dots going out as far as -0.27 to +0.2.
Intriguingly, some bursts rise then fall in what looks like a parabolic arc. See e.g. 8749-8755.

In summary, there appear to be some issues with the accelerometer.
 
  • Like
Likes berkeman
  • #12
haruspex said:
Ok, I was misled by the way the initial speeds are all zero, when the accelerations say they should not be.

Try this in a spreadsheet, starting with cols A to D as in the file you posted.
Col E = the speeds from integrating the accelerations
Col F = computed speed minus actual
Col G = change between consecutive values in col F
Plot col G in a chart (points only, small icons).

I observe that
1. There are periods where this produces a steady horizontal line, but not on the y-axis.
E.g. 0-300, 6730-7300, 10670-11590, 11840-end.
These imply a systematic error in the measured acceleration. E.g. for 10670-11590, the offset hovers around 0.015. That is, the discrepancy between calculated speed and actual speed is growing at 0.015 every 0.05 seconds, so the acceleration measured is persistently wrong by 0.3. The other horizontal periods imply different systematic errors.
The systematic error for 0-300 is clearest. From the zero actual speeds, these should obviously all be zero accelerations, but they are measured at around -0.4.

2. Elsewhere, there is a general and rather broad scatter from -0.05 to +0.05.

3. Quite often, there is a near-vertical burst of dots going out as far as -0.27 to +0.2.
Intriguingly, some bursts rise then fall in what looks like a parabolic arc. See e.g. 8749-8755.

In summary, there appear to be some issues with the accelerometer.

****************************************************************************************

Thanks for your reply. I did exactly as you said and it seems that there is some bais with accelerations .. Since these accelerations are extracted from a Vehicle CAN bus and I assume vehicle calculates the acceleration using wheel ticks (this is my thought which can be wrong.)

I quickly took some more data from a High Grade IMU at 0.01 seconds of delta time and applied the same algorithm .. Good thing is that the IMU provides , A_Forward,A_Lateral,A_Down ,V_Forward,V_Lateral,V_Down , V_north , V_East , V_down and Speed... My calculated V_Forward is Kind of matching with V_foward which IMU gives .. But Calculated V_Lateral doesn't even match with that of actual.. Do you have any suggestion for me on that. ? And regarding V_Down , IMU adds 1g of value to it. (as per the data)
But as per the documentation , Speed is vector addition of V_North and V_East... DO u have any idea how I can convert my Vx to V_North... Here is the CSV File if you might want to look into.. Its called IMUData.csv
 

Attachments

  • IMUData.xlsx
    2 MB · Views: 201
  • #13
Ash_Sdr said:
Calculated V_Lateral doesn't even match with that of actual
Please clarify what lateral velocity means. My assumption would have been that forward and lateral are defined in terms of current direction of movement, but then that would mean forward velocity equals speed and lateral velocity equals zero.

The heading units are radians, not degrees. The same is likely true of roll and pitch.
With that correction, the lateral acceleration closely matches the yaw rate (rate of change of heading) multiplied by the forward velocity - which is as should be.

Edit:
I can think of two reasons why there may be some lateral velocity recorded:
  1. Some misalignment between the true forward direction of the vehicle and the direction the sensor is taking as forward.
Plotting lateral velocity against speed would give a straight line, the slope being the angle mismatch. At speeds above 5, this is roughly true, but the mismatch only appears to be about 0.007 radians. In principle, we could adjust all the forward and lateral velocities and accelerations accordingly, but it hardly seems worth it.​
  1. Skidding.
At speeds below 5, the graph is much more erratic. It could be skidding, but it would be strange that this occurs at the low speeds, not the high ones.​
 
Last edited:
  • #14
Perhaps you mistakenly thought the lateral velocity is simply the integral of the lateral acceleration.
Except for the two possibilities I mentioned in post #13, the lateral acceleration should consist of centripetal acceleration. This only changes direction; it does not lead to lateral velocity.
I'm wondering how the sensor you used determines lateral velocity. Perhaps it computes the expected centripetal acceleration from rate of change of heading x forward speed, subtracts that from measured lateral acceleration, and integrates whatever remains. If so, the reported lateral velocity could be just an accumulation of rounding error. That would be strange, but I struggle to understand how it gets these numbers.
 
Last edited:

1. What is the formula for calculating velocity from acceleration?

The formula for calculating velocity from acceleration is v = u + at, where v is the final velocity, u is the initial velocity, a is the acceleration, and t is the time interval.

2. How is velocity related to acceleration?

Velocity and acceleration are related in that acceleration is the rate of change of velocity over time. In other words, acceleration is the change in velocity divided by the change in time. This means that if an object's acceleration increases, its velocity will also increase.

3. Can velocity be negative when calculated from acceleration?

Yes, velocity can be negative when calculated from acceleration. This occurs when an object is slowing down, or decelerating. In this case, the acceleration would be negative and would result in a negative velocity.

4. How does the direction of acceleration affect velocity?

The direction of acceleration affects velocity in that if the acceleration is in the same direction as the velocity, the velocity will increase. However, if the acceleration is in the opposite direction as the velocity, the velocity will decrease.

5. Why is it important to consider both velocity and acceleration in scientific experiments and calculations?

It is important to consider both velocity and acceleration in scientific experiments and calculations because they are both key factors in determining the motion of an object. Velocity tells us the speed and direction of an object, while acceleration tells us how the velocity is changing. By understanding both of these concepts, we can accurately predict and analyze the motion of objects in various situations.

Similar threads

  • Introductory Physics Homework Help
Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
6
Views
4K
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
1
Views
723
  • Introductory Physics Homework Help
Replies
2
Views
1K
  • Introductory Physics Homework Help
Replies
14
Views
1K
  • Special and General Relativity
Replies
11
Views
1K
  • Introductory Physics Homework Help
Replies
4
Views
1K
  • Introductory Physics Homework Help
Replies
23
Views
2K
  • Introductory Physics Homework Help
Replies
6
Views
1K
Back
Top