The present method provides a method for avoiding singularities in the
movement of CMGs in an array of CMGs in a spacecraft. In a first step, a
torque command representing a desired torque to produce an attitude
adjustment for the spacecraft is received. Next, a range-space gimbal
rate required to produce the desired torque based on the desired torque
and a Jacobian matrix is calculated. Then, a null-space gimbal rate that
assists in the avoidance of singularities is calculated. The total gimbal
rate command is determined by summing the range-space gimbal rate and the
null-space gimbal rate. Then, the total gimbal rate command is provided
to the CMGs to produce the total gimbal rate.