# Heavy drift on VOXL 2

Source: https://forum.modalai.com/topic/4385/heavy-drift-on-voxl-2
Category: General Questions (https://forum.modalai.com/category/2/general-questions)
Posted: 2025-04-29 09:48:49 UTC by nikolahm
Replies: 5 · Views: 1287

## nikolahm · 2025-04-29 09:48:49 UTC

Hello,

I am encountering a heavy drift problem on my drone running VOXL 2 with VOXL 2 4-in-1 mini ESC. It drifts when it is set to position hold. We were thinking that this is because of vibrations, but then i saw some flight logs of other drones with similar vibrations that didn't seem to have this issue. I have between 2-4m/s^2 vibrations, and i'm wondering if this is "common" for VOXL based drones to drift like this (we're talking 50cm in different directions trying to hold a position), with the vibration numbers i'm getting. Maybe it's something else that causes the drift?

Thanks

## Reply by Zachary Lowell 0 · 2025-04-29 13:15:59 UTC

@nikolahm is your drone PID tuned? How are you flying in position mode? GPS based flight, VIO based flight, etc. What is the environment you are testing in, can you paste a log in here please?

## Reply by astro_phil · 2025-05-03 09:44:03 UTC

@Zachary-Lowell-0 

Hei there, I'm from the same team as @nikolahm 
I've been investigating this issue for more then two month now. We are testing inside a motion capture system, closed hall, enough distance to ground and other object to not induce aerodynamical effects. We use a Qualysis system with 150hz update rate and an average tracking precision of ~0.5mm. The drone has been PID tuned. Attitude control works flawless. 

I've seen this behaviour across different voxl2 based drones I've tested: https://youtube.com/shorts/URm6XqTt3CM?feature=share
All fly solid in attitude control. Also i tried manually tuning the Velocity and Position controller, without any improvement. LP-Filtering also yields no improvement.

I'm certain the issue lies in the velocity estimate that gets fused into px4s EKF. Hence the issue is most sensitive to linear acceleration.
A [Flight log](https://drive.google.com/file/d/1W2eIa2K2Isw4NFbR_tnorP7SbJecjvG6/view?usp=sharing) from testing.

Correct me if i get this wrong, but my assumption that the fluctuation in cycle update time - as shown in the following fig - plus noisy linear acceleration seems to cause wrong velocity estimation scince px4 assumes equally spaced samples, which is not always the case.

![Figure_1.png](https://forum.modalai.com/assets/uploads/files/1746264844252-figure_1.png) 
y-axis = micro seconds to previous update
x-axis = update cycle count

The fact that classical stm32 based flightcontroller with the same IMU handle these vibration significantlly better on similar drones leads me to the conclusion that it might be due the different way the voxl handles the data. - cycle time fluctuation.

## Reply by Moderator (ModalAI staff) · 2025-05-04 15:29:01 UTC (in reply to astro_phil)

@astro_phil what do you mean by position control? How are you achieving your position estimate? If it's VIO, we achieve <1cm drift in position hold on our drone platforms

https://docs.modalai.com/flying-with-vio/#troubleshooting-vio

## Reply by astro_phil · 2025-05-04 22:23:27 UTC (in reply to Moderator)

@Moderator 

as written above we use a Qualysis system as external VIO. Which is calibrated and achieves a precision of sub 1mm. With all none voxel based drones it does work without any issue, even when vibration are present we achieve tracking errors with position hold of ~1cm. Only the voxl based drones have a hard time. PX4's position estimate align closely with the VIO but velocity estimate randomly spikes in arbitrary directions.

## Reply by astro_phil · 2025-05-05 11:09:20 UTC (in reply to astro_phil)

@astro_phil with some further investigation over the weekend, i found a small fix in the px4 codebase that seems to reduce the velocity estimation error. I low pass filtered the delta time (dt) value that is used to integrate the linear acceleration to obtain the velocity estimate. 

![vibration_fix.png](https://forum.modalai.com/assets/uploads/files/1746443064707-vibration_fix-resized.png) 

Left is without the "fix" and right is with the "fix". Flying in position hold.

![WhatsApp Image 2025-05-03 at 15.50.57.jpeg](https://forum.modalai.com/assets/uploads/files/1746443272985-whatsapp-image-2025-05-03-at-15.50.57.jpeg) 

I tried to induce more vibration on purpose to test the impact on position tracking. 
Both flights shown in the plot where done with the system shown in the picture.
