hehe, well, I bet everything could be better if I could use more parts, but this would increase the project costs which is something I have to avoid here
The zerocrossing triggers an interrupt of the microcontroller
using the potentiometer (ADC value) I can calculate the ontime and offtime, IOW the time it takes after the ZC triggering until the triac is triggered
so right now I have a µC controlled dimmer and it's working quite good.
another problem is, that the peak from the optocoupler is quite wide.
I powered it with an old sinus generator while testing the code and it didn't work as nicely as I thought. So I tried it with 110V and up to 250V (along with the resistors of course) and the peaks looked better.
schematics are at work but I didn't chance much about them yet, but I will post an update later (I'm currently not at work)
I don't have screenshots yet, but I try to take some later
my next problem is that I can't use the code for the dimmer to control the motor because there's no feedback from the RPM counter yet.
That means I can't control the on/off-time of the triac with the potentiometer, I have to let the µC control it by comparing a defined RPM value (set with the potentiometer) and the value from the feedback counter.
I'm currently looking into the arduino PID controller library but it's totally new to me and doesn't work as expected yet :/
here's the code for the phase control:
http://playground.arduino.cc/Code/ACPhaseControlI removed the verbose lines and altered the serial connection value input to be able to set this value using the variable resistor on the ADC port