working cycle detection