Need help quad unable to hold altitude with sonar sensor

Hi,

Just tested my x quad with new downward facing sonar sensor.

I flew the whole flight in loiter, however from the minute it took of, it either ascended or descended and I had to play with the throttle to maintain altitude the whole flight.

To configure I followed the instructions here.

RNGFND_MAX_CM was set to 700 cm.

Can someone take a look at my log file? I’m not sure but looking at the log for rfnd dist1 shows some crazy ups and downs, maybe my sensor is broken?

my log

thanks,
Gal