Rotary encoder 4 choices

You might want that but the problem with rotary encoders is they show relative motion how many steps (clockwise and counter clockwise) have been made since the starting of the program, it doesn't report absolute position of the rotation axis.

So you need to either use an extra method to reset the current encoder position as a given direction (push a button to tell arduino encoder points to N)

Or use a different type of encoder (e.g. magnet on a wheel + magnetometer) that gives you absolute position values.