How can I calculate vertical speed?

How can I calculate vertical speed?


A lot of people have said it is impossible but It has been done with variometer apps. I can’t figure out the code. Can anyone guide me in the right direction?

Posted on Aug 7, 2025 04:28 PM

Reply
4 replies

Aug 7, 2025 05:46 PM in response to BMaxCR

Can't I just add up all of the accelerations of the accelerometer and then use this physics equation to get distance?


d = v(i) x t + (1/2) x a x t ^2


In this:

v(i) would be 0

t = 1 second

a = all accelerometer speeds added together for.1 second

t = 1 second


Can't I just use this equation to get vertical velocity? A lot of people have said it is impossible but It has been done with variometer apps. I can’t figure out the code. Can anyone guide me in the right direction?


v(f) = v(i) + a x t


v(i) = 0

a = y-axis acceleration for 1 second

t = 1 second


Please let me know if this is possible.


Thank you so much for your help.

Aug 7, 2025 10:03 PM in response to BMaxCR

ChatGPT says:


What you’re describing is partially correct in theory, but it runs into serious practical problems when you try to do it with a phone’s accelerometer.


Let’s break it down.




1. The theory


You’re using two standard kinematic equations:


  1. Distance



In an ideal world:


  • You’d take acceleration data from the accelerometer.
  • Integrate once to get velocity.
  • Integrate again to get displacement.


That’s exactly what’s in your equations.




2. Why this breaks in real life


Phone accelerometers are noisy and measure total acceleration, which includes:


  • Gravity (~9.81 m/s²) — which is huge compared to small motion changes.
  • Sensor bias (a constant tiny offset error).
  • Random noise.


When you integrate noisy acceleration:


  • Even a 0.01 m/s² bias turns into a large velocity error in seconds.
  • A small velocity error turns into a massive position error when integrated again.


That’s why:


  • In practice, purely integrating accelerometer data without correction drifts like crazy.
  • After just a few seconds, your “distance” can be completely wrong — sometimes by meters.




3. How variometer apps make it work


Variometers (used in paragliding, skydiving, etc.) do detect vertical speed from accelerometers, but:


  • They don’t rely on just raw acceleration integration.
  • They use sensor fusion with the barometer (altimeter) to correct drift.
  • The barometer provides an absolute vertical position (pressure → altitude), while the accelerometer fills in short-term responsiveness.
  • Some also use GPS as a correction source (slow, but drift-free over time).


Without a barometer, your vertical velocity estimate will drift almost immediately.




Bottom line


  • Possible in principle: Yes, your physics equations are fine.
  • Accurate with a phone accelerometer alone: No, because of noise, bias, and gravity removal issues.
  • How apps do it: They combine an accelerometer, gyroscope, and barometer (and sometimes GPS).
  • If you want to make a working vertical velocity sensor, Start by learning how to remove gravity via gyroscope data, then combine accelerometer with barometer readings to prevent drift.


How can I calculate vertical speed?

Welcome to Apple Support Community
A forum where Apple customers help each other with their products. Get started with your Apple Account.