Attitude control of a satellite with three flexible elements is considered. Control torque is developed by a set of reaction wheels, which are installed on the central hub of the satellite. The flexible elements are large, so the control torque constraints must be taken into account. In the paper, a control algorithm based on a linear-quadratic regulator is studied. The asymptotic stability of this control is shown. The choice of the control parameters is based on the closed form solution of the corresponding algebraic Riccati equation, which is supplemented by the linear matrix inequality. To increase the convergence rate, particle swarm optimization is used to tune the control parameters.