updated code so that midpoint of encoder can be arbitrary
updated motor software