To get the printer to 'home' to a zero x, y and z position the controlling electronics needs some feedback to let it know when it's reached a minimum travel on each axis. I'm using opto endstops to do this. They are mounted in a fixed position, and a 'flag', a little strip of aluminium in my case, is attached to the moving part which is carefully alligned to pass through the opto gate, breaking the beam. The photo below shows my x-axis opto/flag...