Optical Flow Oscillations

Hello,

I am tuning a larger 4 arm octocopter. It flies well in manual flight mode, and I can not see anything drastically off with the PIDS,
https://review.px4.io/plot_app?plots=pid_analysis&log=d9cc7634-8c02-4f0e-81c0-56526c2d7d0c

but once I move to position flight mode I am seeing strong oscillations. (We are using optical flow with the Ark Flow)
https://review.px4.io/plot_app?log=2a7e9d1f-e62b-4ca9-ac3e-d47e2d9b2df3

Just hoping for a bit more guidance into what I should be looking into for further debug.

  • velocity PID loop
  • optical flow settings
  • etc…

Thank you in advance

I take a look at the velocity setpoints and response, and I can see they are very far apart

but i have never seemed to tune the velocity controller before, so I am hesitant to point towards it

It looks like pixel flow is minimal, might not be but the logging rate is low. The the gyro oscillations are dominating the velocity calculation.

We have a piece of glass that is over the optical flow sensor. we are going to try and remove that to see if it is causing any unintended reflections.

Looks like it might have been the glass
Before:

After:

Solution:

The glass had a smudge on it. After removing the glass entirely our pixel flow rate went up, and the drone is now stable in flight

@AlexKlimaj Thank you for your assistance!

This solution seemed to work to get rid of large oscillations, but we seem to still have a problem with position hold and smaller oscillations. Alex indicated that we should NOT be dampening the arkflow. So we are going to hard mount it to the airframe to see if this resolves our issue.

Alex was able to show us that our compensated flow integral was actual HIGHER than our uncompensated flow integral

This indicates an issue that the gyro is outputting. Probably due to our mounting of it. Thus, we are hard mounting

We got this working. Here are the 3 things that we did

  1. Ensured that there was no glass in front of optical flow sensor (there can be glass, but ours was smudged a bit so we just took it off)
  2. Hard Mounted: we have the flight controller on some heavy vibration dampeners. The theory is that this screwed with the gyro on the ark flow. we hard mounted it to the airframe without the vibration dampeners
  3. Ensured white emitter had hole: In our original case we covered this white emitter that was on the board. We uncovered it
    image

Position hold is working very well

2 Likes

Wanted to show here what a healthy optical flow chart looks like

this was from Alex btw