Open monte-monte opened 2 years ago
Hi
You do not need to adapt/rescale the table. When using the class/lib you can set the mains frequency in the initializer ("freq" variable).
Regarding the equation to calculate the time I don't have it here with me right now but you can check if yours is/isn't correct simply by checking the half value (50% of power). At 50% of power at 60Hz we should have: (1/60) / 2 / 2 = 4.167ms. Looking at the LUT table we have that the 50th element is 83. So 83 times 50us tick equals to 4.15ms which is ~4.167ms.
Changing the tick duration is the only thing you need to do to change to 50Hz mains.
Regards, Alex.
Alex Monteiro Sartin Engenheiro Eletricista - USP/EESC Fone: (14) 98819-1888
On Jan 30, 2022, at 12:02 PM, monte-monte @.***> wrote:
I want to adapt LUT for 50Hz mains, but can't figure out exactly what equation you were using for it: https://github.com/circuitar/Dimmer/blob/da15bc7ad725089b1f2918dbfada7464c7f77f25/src/Dimmer.cpp#L48 The one I have gives similar results but not quiet the same. I am using acos(1-(2*(level/100))) to calculate angle and then convert it to delay in microseconds, but it seems to ramp up more gradually, though the overall shape of the curve is the same.
— Reply to this email directly, view it on GitHub, or unsubscribe. You are receiving this because you are subscribed to this thread.
I want to adapt LUT for 50Hz mains, but can't figure out exactly what equation you were using for it: https://github.com/circuitar/Dimmer/blob/da15bc7ad725089b1f2918dbfada7464c7f77f25/src/Dimmer.cpp#L48 The one I have gives similar results but not quiet the same. I am using
acos(1-(2*(level/100)))
to calculate angle and then convert it to delay in microseconds, but it seems to ramp up more gradually, though the overall shape of the curve is the same.