PaulS:
Your interrupt service routines are LwheelSpeed() and RwheelSpeed(). These refer to the array coder[], which is not declared volatile.In loop(), you refer to the same array. Those references do not necessarily get the latest values from the array elements, because the compiler does not know that the values can change outside of loop.
At the beginning of the code coder is declared as a long I have to change that to volatile?