Optical Flow Drifting while Hover indoor

Setup

  • Frame 6 inch
  • Mateksys H743
  • Custom Copter4.3 Firmware
  • Micolink MTF-01 Optical flow

I made all the necessary settings and calibrations, and the flowX is identical to bodyX, same for Y axis along with gyros. FLOW_POS_X,Y,Z + Lidar are verified.

When I hover in indoor (texture floor), there’s still a drift on loiter mode.
I try to tune PSC_VEL_xx param but it still drift out of it position.

This is my log
https://drive.google.com/file/d/1GF65cawJ7OZiu6CT8tGAnVYc8wUmvTN5/view?usp=drive_link

Thank you

Has the vehicle been properly configured and tuned without optical flow first ?

Yes, already tuned follow https://ardupilot.org/copter/docs/common-tuning.html

And in which exact order did you do those steps? Doing Notch filter after autotune is not a good idea for example.

Do you mean MicoAir MTF-01 Optical Flow Sensor?
if yes, try to follow these parameters. following are not correct.
do an inflight flow calibration with GPS in Loiter flight mode. Also check your mounting orientation.

FLOW_FXSCALER,-450 # Inflight Calibration will give good result
FLOW_FYSCALER,-450 # Inflight Calibration will give good result
FLOW_ORIENT_YAW,0
FLOW_POS_X,-0.128
FLOW_POS_Y,0
FLOW_POS_Z,0
FLOW_TYPE,11 # no such number
RNGFND1_TYPE,38 # why 38 NoopLoop_TOFSense_CAN, external RNGFND??
INS_HNTCH_ENABLE,0
INS_LOG_BAT_MASK,0
INS_LOG_BAT_OPT,0 #consider checking your UA noise/vibration level
LOG_FILE_DSRMROT,1 # consider log each flight separately
MOT_PWM_MAX,2000  #consider to find out ESC/Motor PWM range 
MOT_PWM_MIN,1000 #consider to find out ESC/Motor PWM range

put back to the default first. do it after inflight optical flow calibration if needed.

My guess is you have not done Quiktune and Autotune yet.

Yes, it looks like he skipped a ton of steps. He should complete the tuning of the vehicle first and only after that try to add optical flow.

@jiratto It is a pain to do it in the wrong order and the results will be really really bad.

1 Like

Thank you. I custom OpticalFlow driver to receive Micoair protocol for both RngFnd and OpticalFlow, This is my new device ID (FLOW_TYPE=11, and RNGFND1_TYPE=38)

I tried Inflight Calibration but result are “no better scalar x and y” so I manual adjust FLOW_FXSCALER and FLOW_FYSCALER by using log method.

These control parameters have been successfully implemented in GPS loiter with low position overshoot and low vibration.

I am confused by your problem. If MTF-01 is the optical flow sensor you bought, some experts have already done the source code integration on both sides. We are just users, who follow the correct flight controller firmware to use and follow both the wiring and configuration. Then, focus the energy on getting the Application working with the sensor.

Where does your custom driver sit? Please elaborate more on your truth problem. What is the thing you wanted to achieve? Also, should you work on a companion computer “talking” to the flight controller unit instead?

[Edit] Have you changed MTF-01 to the right protocol?