Drift problem in altitude hold mode

Hi,
in altitude hold mode quadcopter maintains its altitude but it moves sideways. I am not giving any roll and pitch but still it moves sideways. What could be the reason for this problem? I am using only inbuilt sensors of pixhawk.

Hi,

In altitude mode the position is not controlled so it is not supposed to compensate for any movement.
In position mode the vehicle will however try to stand still.

Thank you for your input. I understand that since it is not in position control mode it is not supposed to compensate for any side movement. I want to know what is the reason for this movement when I am not giving any manual roll and pitch command?

are you talking about a slow drifting movement or is the quad almost flying away by itself? It would be very helpful if you could upload a log file illustrating the behavior

Drift can be cause of wind or by not precise horizon calibration. Only few degrees of error is enough to start drifting copter.

I am talking about slow drifting movement. Coming to calibration part : I am using gyro, baro and accelerometer data . gyro gets calibrated automatically each time we turn on the quad and for baro there is no manual calibartion left out is only acclerometer. So is it because of accelerometer calibration?

This can also happen if your pixhawk is not close to the center of mass, so either you have to compensate for the offset and misalignment by setting appropriate parameters or consider moving the controller to its accurate location.