Study of Stability of Rotational Motion of Spacecraft with Canonical Variables