dc42:
madmurg:
Thanks that sound good to me I know how to do the calcs for the ct comparisons and put it to code but I am not sure on the code to control the phase control, any help here would be apreciated.If you use the smoothed output from a pwm pin as I suggested, you just need to use analogWrite to write a value between 41 (to get the minimum 0.8v input to the controller, i.e. minimum power) to 255 (to get very nearly 5v, i.e. full power). To determine what value you need to equalise the generated and consumed power, I suggest a PID controller algorithm.
Thanks for you help. I will now order the kit now I am sure it will work ok.