# Optical flow reject position control

**URL:** <https://discuss.px4.io/t/optical-flow-reject-position-control/17458>\
**Category:** Pixhawk\
**Created:** [July 2, 2020, 9:41pm UTC](https://discuss.px4.io/t/optical-flow-reject-position-control/17458 "2020-07-02T21:41:49Z")\
**Posts on this page:** 1\
**Page:** 1

<div class="post-metadata">

**Author:** ![Haijie\_Zhang](https://discuss.px4.io/user_avatar/discuss.px4.io/haijie_zhang/32/4448_2.png) [@Haijie\_Zhang](https://discuss.px4.io/u/Haijie_Zhang)\
**Post date:** [July 2, 2020, 9:41pm UTC](https://discuss.px4.io/t/optical-flow-reject-position-control/17458/1 "2020-07-02T21:41:49Z")

</div>

Hello,  
I am trying to use the flow breakboard [https://docs.px4.io/master/en/sensor/pmw3901.html](https://docs.px4.io/master/en/sensor/pmw3901.html)and teraranger one ([https://www.terabee.com/connection-to-pixhawk-autopilots-teraranger-one/](https://www.terabee.com/connection-to-pixhawk-autopilots-teraranger-one/)) to do indoor flight control. I am running px4 1.9.2 on a pixhawk 4. I followed the tutorial on PX4 to set:  
EKF2\_AID\_MASK = 2  
EKF2\_HGT\_MODE = range sensor  
EKF2\_OF\_QMIN = 0  
EKF2\_RNG\_AID = enabled

I can see that both sensors are working in MAVlink inpector. But it continues to reject the position control. I have checked the available posts here. Seems people are haveing the same issue with me but without a working solution. Could you anyone guide me how to solve this? Thanks!

I found that when I plug the battery in (powering the distance sensor), the pmw3901 will lose connection. I will try to figure out what’s wrong with the circuit.
