Motor control for industrial automation