speed encoder working