Control solution of AC variable frequency motor