Embedded Code Generation for AC Motor Controllers