Using pmw3901 for position hold

I have been testing position hold using px4flow so far and it works ok.
Now I switch this sensor to pmw3901 optical flow sensor for position estimation
The datasheet is here.
http://www.pixart.com.tw/upload/POT0189-PMW3901MB-TXQT-DS-R1.10-200617%20(NonNDA)_20170720181537_20170802183402.pdf

I checked changes made for utilizing the sensor as described here airspeed drivers: add PX4_I2C_BUS_ONBOARD as possible bus · PX4/PX4-Autopilot@a936dc2 · GitHub

In QGC analyzer, optical flow data shows x, y accordingly and local position estimator works when hovering.

Now problems are,

  1. Altitude hold mode.
  • setpoint vz is not correct and lots of zitter.
  • Even with full throttle, drone doesn’t goes up and keep hitting the ground.
  1. Position hold mode
  • Drifting in one direction and never stop.
  • Position estimation explodes. but it was ok when in stabilized mode.

Below is the log
https://logs.px4.io/plot_app?log=0102165e-a2d0-4ba2-bd86-6af1be56f4da

Oh by the way, what does optical flow check bits mean? I have no idea what these numbers for.

My colleague says pmw3901 on crazyflie works just fine.

I guess you connect CS pin to wrong position.