The machine was running fine then the Y axis ran away and tripped with a 'gross positioning error' halfway through a job. Now whenever you try to reference it runs away then faults immediately after referencing. I can't see it being a drive problem as it is perfectly controlled while referencing. Once it has faulted out, if you manually move the Z axis you can see the Z position display changing so the encoder appears to be working.