Instead of looking for 'zero' as being 512, let 'zero' be any read value (for example) between 502 and 522. The 'deadband' in this case is +/- 10 counts. Now if the joystick produces a value between 502 and 522 the system will assume a position value of 'zero'