Sudden drop in altitude

Hello everyone I am working on PX4 and i have built my own frame. Generally it flies well but there are these times when the aircraft suddenly drops a couple of feet while flying in manual mode. Are there any ideas what could be going on or how i should debug.?
Any help is greatly appreciated

Have you tried altitude control mode?

Recently I tune PID paramaters of altitude control.
But I find the performance of it is not so good.
How to tune the pid in altctl mode.

Yes … i did. It shows this behavior only in manual mode.