Linear Quadratic Regulator. You define a cost function which is a weighted combination of state energy and control energy. Then you can find a control which minimizes the cost function. You can vary the weighting factors (a pair of matrices) to balance control effort and speed of response.