2" inch pavo20 copter with MiroAir AIO V2 + Optical Flow + v1.15.4 PX4 firmware
It’s stable, but it will drift a little bit, why?
Any idea or suggestion is well appreciated.
https://review.px4.io/plot_app?log=bf1110a0-9d5c-405e-bb1e-4e78d546cd44
— EDIT 260909
https://review.px4.io/plot_app?log=6fbf5fa9-098b-4201-a3be-94a3a1ee6bbf
Since the vehicle is stable and the symptom is a slow drift rather than an immediate instability, I would first separate control performance from position-estimation drift.
With optical-flow-only horizontal positioning, I’d check the log in this order:
- Compare estimated local X/Y position and velocity during the hover.
- Check optical-flow quality and whether it changes when the drift starts.
- Compare flow-derived motion with EKF velocity innovations/test ratios.
- Check the distance-to-ground measurement used for optical-flow scaling.
- Look for estimator resets or changes in fusion status.
A particularly useful test would be to place the vehicle over a well-textured surface, hold approximately constant height, and identify the first point where a stationary hover begins accumulating horizontal velocity/position error.
If the EKF already sees a persistent non-zero horizontal velocity while the vehicle is physically stationary, tuning the position controller would only compensate for an upstream estimation error rather than explain it.
I would also repeat exactly the same hover over two surfaces with very different texture and lighting. If the drift changes substantially while the controller and vehicle configuration remain unchanged, that gives a strong clue toward the optical-flow measurement path.
Since you already have two ULogs, comparing the same signals between them could be particularly useful: find the earliest signal that differs before the visible position drift develops.
If you can attach the .ulg files directly, I’d be interested in comparing the estimator/flow timeline between the two runs.
@yigitcan-ozturk Thanks for your steps to check this issue.
Here are the .ulg files and some progress updates.
a) The .ulg file can be downloaded from the flight review link above if you have other tools for further analysis.
b) The vibration from the power line is the direct cause.
Further possible causes of minor drift might be:
a) PID (rate-angle-position) tuning
b) optical flow mounting (do not mount on the protective ring)
c) an optical flow module with an IMU is recommended if possible
Thanks for the update and for making the ULog available.
It’s useful that you’ve identified vibration from the power line as a contributing factor. I would separate that issue from the remaining minor position drift before changing PID parameters.
For the next step, I would compare the IMU vibration/clipping indicators, optical-flow quality and fusion status, EKF2 velocity/position innovations, and the vehicle’s actual motion against its commanded response.
That should help distinguish three possibilities:
-
Residual measurement or estimator error.
-
Optical-flow mounting or vibration sensitivity.
-
Genuine control-loop tracking error.
If you have a flight log after correcting the power-line vibration, a before/after comparison would be particularly valuable.
I’d be happy to review the ULog and identify the first observable divergence associated with the remaining drift.
Thanks again for sharing the results.