Reven,
I've not used that circuit or code you are reffering to but by just looking at your waveforms it seems that the triac is triggered at the same phase angle in case 1, 2, 3 & 4.
The triac only needs a short pulse on the gate and will then hold itself 'on' untill the AC-line crosses zero, at which point it will turn 'off'. That short pulse should be delayed a certain amount of time from the zero crossing.
On your scope pics the triac seems to be triggered exactly 1div from the zero crossing in all cases except full on and full off.
/Henrik Olsson.
Bookmarks