Do you have home switches?
If you dont pressing RefAll will set machine zero at the point you press it, if you do then it will move to the switches and set machine zero there.
A bit more info would likely help on understaning what your problem is, also attaching your xml file would help.
Hood