It seems that IMUs suffer from integration errors that build up over time, so they are not the most accurate means of determining the attitude of your spacecraft.
So what then would be the most accurate system for this? GPS? Star trackers? Other?
Star trackers are by far the most precise. Sun sensors are used for coarse knowledge and IMUs only for estimating the attitude during a maneuver.
Attitude determination typically relies on several sensors. Most (all?) spacecraft have at least two modes: coarse and fine attitude determination. The first is to have a general idea of your attitude and the second is to have a very precise knowledge of your attitude.
For fine attitude determination, nothing beats star trackers. One of the most used STA (Star Tracker Assembly) is manufactured by Adcole and achieves an accuracy of 10 arcseconds, or 0.0027 degrees. That is the precision at which the star tracker will tell your spacecraft how well it is pointed compared to a reference.
Star trackers require the spacecraft to be relatively stable before they can spit out a good attitude estimate (e.g. Adcole needs the spacecraft to rotate at less than 2 degrees per second. That's where coarse sun sensors (CSS) come into play: they tell the spacecraft whether they can see the sun. That is sufficient to have coarse attitude knowledge and to determine a tumbling/angular rate of your spacecraft. The angular rate (also called "body rates") is all you need to know to stabilize your spacecraft (I won't derive it here, but Schaub and Junkins derive in their book, which is one of the references on attitude control).
So far, we know that star trackers provide the most precise attitude determination, and that sun sensors allow for imprecise attitude. In practice, that's what a lot of spacecraft fly: use the sun sensors to detumble/stablize your spacecraft, then turn on the star trackers to achieve the correct attitude pointing.
Where do the IMUs come into play? Typically they're used for high thrust maneuvers (not an attitude control maneuver). During a maneuver, the spacecraft may spin at a rate larger than what the star trackers can follow. So the IMUs are used to track the acceleration imparted on the spacecraft. With a good knowledge of the inertia tensor of the spacecraft and the location and orientation of each thruster, it is possible to determine what kind of spin rate that maneuver has caused. Spacecraft will then use that attitude estimate from the IMUs to guarantee a specific spin rate at the end of the maneuver (typically by modulating the thrusters during the burn), and then again use the star trackers to acquire precise attitude position. Hence, their drift rate isn't a deal breaker because they are re-initialized from star tracker data before a maneuver. Note that for very long burns (over 5 minutes), that drift rate may become problematic.
The most accurate attitude determination depends very much on the needs of the vehicle. It is important to remember that perfection is the enemy of good enough. Different spacecraft have different requirements for what "good enough" is. Going beyond "good enough" is not very smart.
But what if the "good enough" requirement is less than 1/10 of an arcsecond in terms of accuracy, 1/100 of an arcsecond in terms stability? (That describes the Hubble Space Telescope and the James Webb Telescope, BTW.) If that is the case, sensors are only one of the concerns. Other concerns include
What about sensors?
No single sensor does the job. Star trackers do not quite have the accuracy needed, and they are slow, nominally once a second per update, but sometimes with significantly larger gaps. Magnetometers reply on a closely planet with a well-mapped magnetic field, and aren't all that precise. Rate gyros have a dead reckoning problem.
These problems can be overcome by using multiple kinds of sensors. The drift that is inherent in rate gyros can be rectified by using the slow updates from a star tracker. Kalman filters do exactly that. Star trackers are telescopes, very good telescopes, but they do not qualify as "good enough" for the extremely precise attitude requirements of the Hubble and the Webb. While both the Hubble and the Webb do use star trackers for coarse attitude control, they use their own space telescopes for fine grain attitude. In particular, once coarse attitude control has aimed the telescope in more or less the right direction, those spacecraft look for a suitable guide star in the telescope's field of view and rotate so as to keep that guide star's position in the field of view fixed.
Both the Hubble and the Webb use gyros to estimate attitude between star tracker / guide star updates. The use of a Kalman filter addresses issues associated with bias, drift, and noise. Neither the Hubble nor the Webb use microelectromechanical systems (MEMS) gyros; they're nowhere close to "good enough", at least not yet. Neither use ring laser gyros or fiber optic gyros. Both have bias, stability, and accuracy issues. The Hubble uses gas bearing gyros while the Webb uses hemispherical resonator gyros. These are not cheap (not by a long shot), but when it comes to spacecraft as expensive as the Hubble or the Webb, cheaping out on gyros is a bad idea.
Yes but basically you have to have several (at least three) antennas that are widely spaced apart. You can either have separate GPS systems at each antenna and use simple trigonometry to calculate your attitude, or feed the the signals from all antennas to a fancy receiver that solves the whole problem at once.
The objects labeled Fine Guidance Sensors use CCDs at the edge of the Hubble's field of view to track stars:
The FGSs use starlight captured by the telescope’s mirrors to find and maintain a lock on guide stars to ensure that the spacecraft’s attitude does not change. One FGS can also be used as a scientific instrument to determine a star’s position with high accuracy. The level of stability and precision that the FGSs provide gives Hubble the ability to remain pointed at a target with no more than 0.007 arcsecond of deviation over extended periods of time. This is the same as holding a laser beam focused on Franklin D. Roosevelt’s head on a dime roughly 200 miles away — which is about the distance from Washington, D.C., to the Empire State Building in New York City — for 24 hours.
It may not be practical for your spacecraft application to have two 2.4 m diameter Hubble Space Telescopes oriented at 90 degrees but that's what I would do if I needed accurate determination of attitude of a spacecraft that wasn't rotating appreciably at all.
However, you might opt instead for three fiber optic gyroscopes. According to Wikipedia:
Like all other gyroscope technologies and depending on detailed FOG design, FOGs may require initial calibration (determining which indication corresponds to zero angular velocity).
So you may need at least a pair of modest star cameras to correct the integration errors that may arise.
Originally I'd thought that a ring laser or fiber optic gyroscope would be drift free and have essentially zero integration error because it seems to operate like an interference fringe-counting laser interferometer for linear position measurements (which basically don't gain/lose counts) but apparently their operation is more complex and real-world issues of laser phase noise and coherent backscattering within the fiber and other things I don't understand mean that these will always have a slow drift problem.
You are always going to need a star camera or some other method to "zero" your gyros and compensate for integration error.
It's probably the system used by the Gaia mission, which uses the astrometric telescope payload as its most precise sensor.
"The challenges for the AOCS design are to provide attitude control within a restricted pointing domain, due to thermal constraints, and to provide a fine pointing mode with relative pointing error (RPE) of a few milli-arcseconds (mas). The fine pointing mode needs to use the scientific payload as an AOCS sensor in order to measure angular rate to the accuracy required."