Generating the sinewaves is pretty simple.
You need to generate a look-up table (simple array) with the sine values, and then do analogWrite(pin, value).
//Sinus lookup table
static int sinusTabelle =
Now since a three phase motor requires 120° phase shift, i did the following:
Define three counters (a, b, c) with a = 0, b = 85 and c = 170.
360° / 3 = 120°. Therefore 255 / 3 = 85. So if a looks at array position 0, b looks at 85 and c at 170, they are exactly 120° phase shifted.
Now you need a loop like
if (a == 255), a = 0; //255 can be changed for whatever amount of samples is used in the sine look-up table
if (b == 255), b = 0;
if (c == 255), c = 0;
delayMicroseconds(X); //Factor X can be used to change frequency of the sine wave
/*If you also want to adjust the amplitude, you can add a divider in the analogWrite function.
For example */
analogWrite(PhaseU, sinusTabelle[a] / 2); //This would half your amplitude
Maybe someone with better programming skills could make it a bit neater. I am not really a good programmer, but the code works.