Fault detection and tolerance of electrical machines in automotive applications