A slight movement of ailerons when you switch between manual and stabilized mode during a ground test is normal. There are a couple of possibilities:
1. After power up, the gyro drift compensation still takes a few minutes to completely settle. Part of the reason for that is there is some dependence of gyro offset on temperature, and the UDB4 warms slightly. Also, we have seen that some of the gyros take longer to stabilize than others.
2. Possibly you have changed the orientation slightly.
3. Perhaps your ROLL_KP gain is a bit on the high side.
If you want to explore further, do the following:
1. Power up. Make sure that your plane is motionless for 10 seconds prior to the first wag.
2. After initialization is complete, switch between manual and stabilize and observe aileron deflection.
3. Repeat step 2 once every minute for 5 minutes.
If there is a little bit of gyro drift, you will see the amount of aileron deflection reduce with time, as the
drift compensation controller adjusts for it.
Best regards,