The controller calculation.