How to calculate power consumption of motor