Need help on Servo Motor Control using ATMega169

Hello. I’m developing a project using AVR Butterfly ATmega169PV to generate PWM for a position control application using industrial AC servo motor. The AVR interfaces with GUI (Using Visual Basic) via RS232 to provide user control and the actual position from the feedback pulses of the built-in optical rotary encoder. Currently I’m having problem to develop the program for such application. Thus, I would like to seek your expertise.

The system specification and GUI are provided. I just need to do the program and configure my GUI for the interfacing purpose.

For those who willing to help, Please PM/email me ocean_six@hotmail.com

Thank you in advance.