How are attitude indicators kept accurate? The attitude indicator is very important for any sort of instrument flying, so it must be accurate at all times regardless of the plane's movements.

I presume that the indicator would be connnected to a gyroscope. However, gyroscopes drift, and a drifting attitude indicator would be pretty useless. Of course, you might have a reset button, but safely using it would require a visual reference to a horizon, which obviously you don't have during IFR flight.

Another idea might be to periodically reset the indicator based on gravity --- many model aircraft use this something like this approach to drive an attitude calculation; however, during coordinated turns, the gravity vector is indistinguishable from the vector during level flight. If a plane continually turns in a coordinated way, such an attitude indicator would be confused in exactly the same way that a human would be, resulting in bad things like the autopilot doing a graveyard spiral. A gravity sensor + accelerometer wouldn't be able to detect the difference between a gradual turn into a steeper and steeper coordinated spiral and simply a gradual gyroscope drift while remaining in level flight.

How are attitude indicators kept from drifting?
A gyroscopic AI has an erection mechanism, which continuously corrects the AI to be upright based on the local level, or downward acceleration vector. The correction rate is generally 3-5 degrees per minute.

The way that the AI corrects itself is a system of pendulous vanes. When the gyro is not upright relative to the local level, centrifugal force pushes open vanes on the gyro's case. Air escapes through the uncovered holes, applying a force to the case, and correcting for precession.


(FAA AC 65-15A)

The second half is somewhat counter-intuitive, but flying in a coordinated turn will not continuously increase the error in the AI. For the first half of the turn, the AI will add error; in the second half, it removes the error. After a 360 degree turn, the precession error will be removed completely. For more detail, see another answer: If I fly a balanced turn long enough, will the AI show I'm level?