A new optimal sliding mode (OSM) controller is developed for a linear stochastic system and applied to the Middeck Active Control Experiment (MACE) which represents the control structure interaction problem for a precision spacecraft. The OSM controller minimizes the expected value of a quadratic objective function consisting of only states with the constraints that estimated states always remain on the intersection of sliding hyperplanes. This controller is designed for two subsets of MACE problems: a single input, single output gimbal inertial pointing problem and a three input, three output torque wheel attitude control problem. Using numerical simulations, performance of the OSM controller is compared to that of the classical LQG controller. The OSM controllers are digitally implemented on the Development Model of MACE. The experimental results are shown to be in good agreement with theoretical results.