You signed in with another tab or window. Reload to refresh your session.You signed out in another tab or window. Reload to refresh your session.You switched accounts on another tab or window. Reload to refresh your session.Dismiss alert
I am using a Robodyn and ESP32 (so not a nice pulse), so I set semiPeriodShrinkMargin == 400
When using freq detection + filtering, semiPeriodLength == 0 so this code always makes the function return because the comparison leads to true because there is a comparison with an unsigned and signed value.
#ifdef FILTER_INT_PERIOD
// Filters out spurious interrupts. The effectiveness of this simple// filter could vary depending on noise on electrical networ.if (diff < semiPeriodLength - Thyristor::semiPeriodShrinkMargin) { return; }
#endif
This code could be fixed like that, but the problem is that wrong "diff" could end up in the queue, so I don't really know how to fix that.
#ifdef FILTER_INT_PERIOD
// Filters out spurious interrupts. The effectiveness of this simple// filter could vary depending on noise on electrical networ.if (semiPeriodLength && diff < semiPeriodLength - Thyristor::semiPeriodShrinkMargin) { return; }
#endif
With this fix, I can see the "wrong" detected frequencies.
It seems to me that filtering is quite linked to DimmableLightLinearized::setFrequency(), meaning as soon as we need filtering, we also need to set a frequency value we with it is good for where we are, so that filtering can work properly.
semiPeriodShrinkMargin == 400
When using freq detection + filtering,
semiPeriodLength == 0
so this code always makes the function return because the comparison leads to true because there is a comparison with an unsigned and signed value.This code could be fixed like that, but the problem is that wrong "diff" could end up in the queue, so I don't really know how to fix that.
With this fix, I can see the "wrong" detected frequencies.
It seems to me that filtering is quite linked to
DimmableLightLinearized::setFrequency()
, meaning as soon as we need filtering, we also need to set a frequency value we with it is good for where we are, so that filtering can work properly.The text was updated successfully, but these errors were encountered: