Thanks Jason
I know what the problem was now.
The setting steps per unit was set to 508.(after using Axis Calibration)
In this case the returned values are never zero.
Changed the value to 500 and all works fine now.
It took me 2 days to find this problem