Why Is My MATLAB Program Returning Incorrect Values for Airplane Path?

  • Context: Undergrad 
  • Thread starter Thread starter Buzz23
  • Start date Start date
  • Tags Tags
    Acceleration Position
Click For Summary

Discussion Overview

The discussion revolves around a student's MATLAB program that is intended to analyze the path of an airplane in micro-gravity conditions. The focus is on understanding the discrepancies in the calculated altitude, which erroneously drops to negative values during the simulation of parabolic flight paths. The conversation includes aspects of data processing, theoretical modeling, and the implications of accelerometer readings in a micro-gravity environment.

Discussion Character

  • Exploratory, Technical explanation, Debate/contested, Mathematical reasoning

Main Points Raised

  • One participant requests example data to clarify the issue, noting that the code contains many unclear conversions.
  • Another participant emphasizes the importance of the gravity vector being correctly oriented, questioning whether it is set to +9.81 instead of -9.81.
  • Some participants assert that during micro-gravity, the accelerometer should read zero acceleration on the z-axis, while the airplane still experiences gravitational acceleration.
  • There is a discussion about the centripetal acceleration component during curved flight paths and its effect on readings.
  • A participant suggests that the student may need to add the gravitational acceleration to their z measurements to account for the downward force.
  • Concerns are raised about how the accelerometer's reference frame is aligned with the airplane's movement, which could affect the accuracy of the data.
  • Another participant questions whether the student should add or subtract the gravitational acceleration when adjusting the z-axis readings.
  • A later reply highlights the scenario where accelerometers read zero while the airplane is still accelerating downwards, indicating a potential misunderstanding of the readings in a micro-gravity context.

Areas of Agreement / Disagreement

Participants express differing views on the interpretation of accelerometer data in micro-gravity conditions and the correct handling of gravitational forces in the calculations. There is no consensus on the best approach to resolve the discrepancies in the MATLAB program.

Contextual Notes

Participants note the potential confusion arising from the alignment of the accelerometer's reference frame with the airplane's movement, as well as the implications of gravitational acceleration on the readings during parabolic flight.

Buzz23
Messages
5
Reaction score
0
Hello
I've just subscribe because I've a problem with a project.
First, I'm a student in France, in prep school. My team and I are working on a project : we study the perfect path for an airplane to be in micro-gravity (it means the only acceleration is the one due to gravity, like what we have here :http://www.airzerog.com/)

So, in order to verify our theoretical model, we experienced in an aerobatic plane (CAP10) and we had a accelerometer installed in the plane (desc of the accelerometer :http://www.gcdataconcepts.com/GCDC_X16-1D_User_Manual.pdf). It's a 3 axis accelerometer, which returns the measures in a CSV file with : time-accX-accY-accZ)

The purpose of those measures were to obtain the path followed by the plane, to actually see the parabola. I did a program on MATLAB :
-to import the measures from the csv file and pu them into variables (it works fine)
-to filter it (with a butterworth filter), because the signal was very noisy, due to the plane's vibration) (it works fine too)
-and then to integer it, twice. And here is the problem : the program run well, but it returns ironical values ; when we begun our parabola at 610 m (2000ft), it ends in the abyssal (approximatly -2000m..).

I don't understand why. I used the cumptrapz function of MATLAB (i just wanted an idea of the path, not a very precise one). I also converted all the mesaures, after having filtered them, to SI system. I multiplied them to 1/2048(accelerometer's gain), then to 9.81 to have it in m/s². I didn't forgot the constant when i integrated (610 m and v0 m/s).
As we did several parabola (10) with different initial velocity (remember : the purpose was to see the influence of several factors such as the velocity and the angle with which we began the parabola), i ran the algorithm with different parabola and there's always the same mistake.

Please find in attachment my different programs:
-importation(i) import the measures into different variable
-filtrage_butterworth filter my measures
-integrale_trapz integrate the signal
-trajectoire return the position to Z and X in order to plot(X,Z), and temps (the vector time) to plot(temps,Z)

Thank you for reading me and I would appreciate any kind off commentaries to my code.
Buzz23

PS : please forgive my approximate english :)
 

Attachments

Physics news on Phys.org
Do you have an example path with accelerations, velocities and positions? The code has many magic numbers and conversions that are hard to understand, data would help to see where the error comes from.
 
The gravity vector should be -9.81 pointing down. I can't tell from the code whether your gravity vector is pointing up or down... the code shows +9.81?
 
Here are some samples we had from our theoretical analysis.
-velocity on z axis (up)
-path : x=f(z)
-z acceleration :http://www.google.fr/imgres?imgurl=...r=3072&page=1&start=0&ndsp=37&ved=0CC4QrQMwBA (the blue one)
Vz.jpg
Z=f(X).png
 
bahamagreen said:
The gravity vector should be -9.81 pointing down. I can't tell from the code whether your gravity vector is pointing up or down... the code shows +9.81?

No, during the period of micro-gravity, the value for the acceleration on z is 0.
 
Buzz23 said:
No, during the period of micro-gravity, the value for the acceleration on z is 0.
But the gravity component doesn't change! When you are flying a curve, there is an additional centripetal acceleration component, to bring the resultant to 'zero'.
 
Buzz23 said:
No, during the period of micro-gravity, the value for the acceleration on z is 0.
That's what your accelerometer will read. The real airplane will still accelerate downwards.
The velocity/time-diagram does not show a microgravity environment.
 
mfb said:
That's what your accelerometer will read. The real airplane will still accelerate downwards.
The velocity/time-diagram does not show a microgravity environment.
So what do I have to do? Add to my measure on Z the gravity?
 
Sure.

Also, how did you convert the three acceleration measurements to your reference frame? The plane will change its position, if you don't have some special mechanism the accelerometer axes won't be aligned with the coordinates all the time.
 
  • #10
That's what I thougt! I'm actually trying to place them in the correct reference(Earth), whether they are measured in the reference of the plane.

So I also have to substract the Earth attraction.. I put the Z axis down, do I have to add 9.81, or substract 9.81?
 
  • #11
Consider the case where the accelerometers read zero, but the airplane is accelerating downwards...
 

Similar threads

Replies
2
Views
2K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 2 ·
Replies
2
Views
4K
  • · Replies 1 ·
Replies
1
Views
11K
  • · Replies 5 ·
Replies
5
Views
6K
  • · Replies 11 ·
Replies
11
Views
2K
  • · Replies 5 ·
Replies
5
Views
5K