Controller for an elevator