Dynamic electric braking by short circuiting the motor