Real-Time Emulation Of Electrical Machines For Hardware-In-The-Loop Applications