Reactions wheels are used for controlling spacecraft attitude to a very high precision. It works by using an electric motor to spin a flywheel that causes the spacecraft to rotate in the opposite direction. A set of three orthogonally arranged reaction wheels can fully control the spacecraft attitude. In an isolated system, a reaction wheel assembly (RWA) can be used indefinitely without requiring any energy input other than power for the motors. However, disturbance torques add energy into the system, causing the angular momentum of the wheels to increase. When they get saturated, some other source of torque, such as RCS thrusters or torque-rods need to be used to desaturate them.
Torque allocation to a 3-wheel system can be accomplished by projecting the torque vector to each individual spin axis via a dot product. With more than three wheels, the added degrees of freedom results in an infinite number of possible solutions. The optimal solution in this case is picked by one of the following strategies. More generalized strategies are available for allocating torques in systems with more than three reaction wheels .
 Section 4.3.8, “Fundamentals of Spacecraft Attitude Determination and Control”, Markley, F. L. and Crassidis, J. L.,