added ENCODER_TICKS_IN_CYCLE and implemented it.