A Self-Learning Solution for Torque Ripple Reduction for Non-Sinusoidal Permanent Magnet Motor Drives Based on Artificial Neural Networks