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.

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

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.