A suboptimal controller based upon on-line quadratic programming is described. Theoretical results are presented to show that such a controller is optimal under the assumption that there are no constraints on the computation time. Finally, an implementation of a suboptimal controller that takes such constraints into account is described.