# Loss and gain of altitude of in position mode flight

Source: https://forum.modalai.com/topic/2039/loss-and-gain-of-altitude-of-in-position-mode-flight
Category: VOXL 2 and VOXL 2 Mini (https://forum.modalai.com/category/26/voxl-2-and-voxl-2-mini)
Tags: voxl-2
Posted: 2023-04-06 06:39:42 UTC by Tamas Pal 0
Replies: 1 · Views: 612

## Tamas Pal 0 · 2023-04-06 06:39:42 UTC

I am using flight core as external flight controller with voxl2. Additionally, it has a range finder as primary sensor to augment the altitude data. I have observed that when I move forward with throttle at 50%, it is gaining some altitude and come reverse (along negative x axis w.r.t body frame axis ) it is loosing altitude. The gain and loss of altitude is around +-0.2m. It is not a sensor issue, as during flight the changes in altitude are visible in mavlink inspector in distance sesnor segment and as soon as I stop giving pitch or roll input (throttle always at 50%) it comes back to its correct altitude. This  phenomena is only observed when the quad is in motion. I have set the offset parameters **with respect to cg** for both the flight-core and range finder. But, I am still observing this issue. How to solve it?

## Reply by Eric Katzfey (ModalAI staff) · 2023-04-06 18:59:31 UTC

@Tamas-Pal-0 That sounds like a good question for the PX4 community. We don't have any experience flying with a distance sensor but I'm sure others in the PX4 community do this all the time.
